`f(x)=2x^3+x^2-4` and `h = 0.5`, estimate `f^'(2.5) and f^('')(2.5)`
using Three point Forward difference, Backward difference, Central difference formula numerical differentiation
Also find exact value of f', f'' and error for each estimation
Solution:
Equation is `f(x) = 2x^3+x^2-4`.
`:. f^'(x) = 6x^2+2x`
`:. f^('')(x) = 12x+2`
The value of table for `x` and `y`
Three-point FDF (Forward difference formula)
`f^'(x)=1/(2h)[-3f(x)+4f(x+h)-f(x+2h)]`
`f^'(2.5)=1/(2*0.5)[-3f(2.5)+4f(2.5+0.5)-f(2.5+2*0.5)]`
`f^'(2.5)=1/1[-3f(2.5)+4f(3)-f(3.5)]`
`f^'(2.5)=1/1[-3(33.5)+4(59)-94]`
`f^'(2.5)=41.5`
Absolute Error:`|"exact value of " f^'(2.5)-(41.5)|=|42.5 -41.5|=1`
Three-point BDF (Backward difference formula)
`f^'(x)=1/(2h)[f(x-2h)-4f(x-h)+3f(x)]`
`f^'(2.5)=1/(2*0.5)[f(2.5-2*0.5)-4f(2.5-0.5)+3f(2.5)]`
`f^'(2.5)=1/1[f(1.5)-4f(2)+3f(2.5)]`
`f^'(2.5)=1/1[5-4(16)+3(33.5)]`
`f^'(2.5)=41.5`
Absolute Error:`|"exact value of " f^'(2.5)-(41.5)|=|42.5 -41.5|=1`
Three-point CDF (Central difference formula)
`f^'(x)=(f(x+h)-f(x-h))/(2h)`
`f^'(2.5)=(f(2.5+0.5)-f(2.5-0.5))/(2*0.5)`
`f^'(2.5)=(f(3)-f(2))/1`
`f^'(2.5)=(59-16)/1`
`f^'(2.5)=43`
Absolute Error:`|"exact value of " f^'(2.5)-(43)|=|42.5 -43|=0.5`
Three-point FDF (Forward difference formula) for second derivatives
`f^('')(x)=(f(x)-2f(x+h)+f(x+2h))/(h^2)`
`f^('')(2.5)=(f(2.5)-2f(2.5+0.5)+f(2.5+2*0.5))/((0.5)^2)`
`f^('')(2.5)=(f(2.5)-2f(3)+f(3.5))/(0.25)`
`f^('')(2.5)=(33.5-2(59)+94)/(0.25)`
`f^('')(2.5)=38`
Absolute Error:`|"exact value of " f^('')(2.5)-(38)|=|32 -38|=6`
Three-point BDF (Backward difference formula) for second derivatives
`f^('')(x)=(f(x-2h)-2f(x-h)+f(x))/(h^2)`
`f^('')(2.5)=(f(2.5-2*0.5)-2f(2.5-0.5)+f(2.5))/((0.5)^2)`
`f^('')(2.5)=(f(1.5)-2f(2)+f(2.5))/(0.25)`
`f^('')(2.5)=(5-2(16)+33.5)/(0.25)`
`f^('')(2.5)=26`
Absolute Error:`|"exact value of " f^('')(2.5)-(26)|=|32 -26|=6`
Three-point CDF (Central difference formula) for second derivatives
`f^('')(x)=(f(x-h)-2f(x)+f(x+h))/(h^2)`
`f^('')(2.5)=(f(2.5-0.5)-2f(2.5)+f(2.5+0.5))/(0.5)^2`
`f^('')(2.5)=(f(2)-2f(2.5)+f(3))/(0.25)`
`f^('')(2.5)=(16-2(33.5)+59)/(0.25)`
`f^('')(2.5)=32`
Absolute Error:`|"exact value of " f^('')(2.5)-(32)|=|32 -32|=0`
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then