Given information:
Step size h=2Δx for i−2 and i+2
Step size h=Δx for i−1 and i+1
Formula used:
The Taylor series expansion about a and x can be expressed as,
f(x)=f(a)+hf'(a)+12h2f"(a)+16h3f‴(a)+124h4f4(a) +1120h5f5(a)+⋅⋅⋅
Calculation:
The Taylor series expansion about a and x is,
f(x)=f(a)+hf'(a)+12h2f"(a)+16h3f‴(a)+124h4f4(a) +1120h5f5(a)+⋅⋅⋅
For forward expansion, substitute a=xi,h=2Δx and x=xi+2 in Taylor series expansion,
f(xi+2)=f(xi)+(2Δx)f'(xi)+12(2Δx)2f"(xi)+16(2Δx)3f‴(xi)+124(2Δx)4f4(xi) +1120(2Δx)5f5(xi)+⋅⋅⋅f(xi+2)=f(xi)+2(Δx)f'(xi)+2(Δx)2f"(xi)+86(Δx)3f'''(xi)+1624(Δx)4f4(xi)+32120(Δx)5f5(xi)+⋅⋅⋅
Now, substitute a=xi,h=Δx and x=xi+1 in Taylor series expansion,
f(xi+1)=f(xi)+(Δx)f'(xi)+12(Δx)2f"(xi)+16(Δx)3f‴(xi)+124(Δx)4 f4(xi) +1120(Δx)5f5(xi)+⋅⋅⋅f(xi+1)=f(xi)+(Δx)f'(xi)+12(Δx)2f"(xi)+16(Δx)3f'''(xi) +124(Δx)4 f4(xi)+1120(Δx)5f5(xi)+⋅⋅⋅
Multiply above equation by 2,
2f(xi+1)=2f(xi)+2(Δx)f'(xi)+22(Δx)2f"(xi)+26(Δx)3f'''(xi)+224(Δx)4f4(xi)+2120(Δx)5f5(xi)+⋅⋅⋅2f(xi+1)=2f(xi)+2(Δx)f'(xi)+(Δx)2f"(xi)+13(Δx)3f'''(xi)+112(Δx)4f4(xi)+160(Δx)5f5(xi)+⋅⋅⋅
Thus, the value of f(xi+2)−2f(xi+1) is,
f(xi+2)−2f(xi+1)=f(xi)−2f(xi)+2(Δx)f'(xi)−2(Δx)f'(xi)+2(Δx)2f"(xi)−(Δx)2f"(xi)+86(Δx)3f'''(xi)−13(Δx)3f'''(xi)+1624(Δx)4f4(xi)−112(Δx)4f4(xi)+32120(Δx)5f5(xi)−160(Δx)5f5(xi)+⋅⋅⋅
f(xi+2)−2f(xi+1)=−f(xi)+(Δx)2f"(xi)+(Δx)3f'''(xi)+712(Δx)4f4(xi)+14(Δx)5f5(xi)+..... …… (1)
For backward expansion, substitute a=xi,h=−2Δx and x=xi−2 in Taylor series expansion,
f(xi−2)=f(xi)+(−2Δx)f'(xi)+12(−2Δx)2f"(xi)+16(−2Δx)3f‴(xi)+124(−2Δx)4f4(xi) +1120(−2Δx)5f5(xi)+⋅⋅⋅f(xi−2)=f(xi)−2(Δx)f'(xi)+2(Δx)2f"(xi)−86(Δx)3f'''(xi)+1624(Δx)4f4(xi)−32120(Δx)5f5(xi)+⋅⋅⋅
Now, substitute a=xi,h=−Δx and x=xi−1 in Taylor series expansion,
f(xi−1)=f(xi)+(−Δx)f'(xi)+12(−Δx)2f"(xi)+16(−Δx)3f'''(xi)+124(−Δx)4f4(xi) +1120(−Δx)5f5(xi)+⋅⋅⋅f(xi−1)=f(xi)−(Δx)f'(xi)+12(Δx)2f"(xi)−16(Δx)3f'''(xi) +124(Δx)4f4(xi)−1120(Δx)5f5(xi)+⋅⋅⋅
Multiply above equation by 2,
2f(xi−1)=2f(xi)−2(Δx)f'(xi)+22(Δx)2f"(xi)−26(Δx)3f'''(xi)+224(Δx)4f4(xi)−2120(Δx)5f5(xi)+⋅⋅⋅2f(xi−1)=2f(xi)−2(Δx)f'(xi)+(Δx)2f"(xi)−13(Δx)3f'''(xi)+112(Δx)4f4(xi)−160(Δx)5f5(xi)+⋅⋅⋅
Thus, the value of 2f(xi−1)−f(xi−2) is,
2f(xi−1)−f(xi−2)=2f(xi)−f(xi)−2(Δx)f'(xi)+2(Δx)f'(xi)+(Δx)2f"(xi)−2(Δx)2f"(xi)−13(Δx)3f'''(xi)+86(Δx)3f'''(xi)+112(Δx)4f4(xi)−1624(Δx)4f4(xi)−160(Δx)5f5(xi)+32120(Δx)5f5(xi)+⋅⋅⋅
2f(xi−1)−f(xi−2)=f(xi)−(Δx)2f"(xi)+66(Δx)3f'''(xi)−1424(Δx)4f4(xi)+30120(Δx)5f5(xi) …… (2)
Now, add equation (1) and equation (2),
f(xi+2)+f(xi−2)−2f(xi+1)+2f(xi−1)=f(xi)−(Δx)2f"(xi)+66(Δx)3f'''(xi)−1424(Δx)4f4(xi)+30120(Δx)5f5(xi)−f(xi)+(Δx)2f"(xi)+(Δx)3f'''(xi)+712(Δx)4f4(xi)+(Δx)54f5(xi)+.....f(xi+2)+f(xi−2)−2f(xi+1)+2f(xi−1)=2(Δx)3f'''(xi)+(Δx)52f5(xi)
Rearrange the above equation as,
f'''(xi)=f(xi+2)+f(xi−2)−2f(xi+1)+2f(xi−1)2(Δx)3−(Δx)54f5(xi)(Δx)3+....f'''(xi)=f(xi+2)+f(xi−2)−2f(xi+1)+2f(xi−1)2(Δx)3−(Δx)24f5(xi)+....
Therefore, the centered finite-difference approximation to the third derivative which is second order correct is,
f'''(xi)=f(xi+2)+f(xi−2)−2f(xi+1)+2f(xi−1)2(Δx)3−(Δx)24f5(xi)+....