`f(x)=xlnx` and `h = 1`, estimate `f^'(2) and f^('')(2)`
using Two 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) = xln(x)`.
`:. f^'(x) = ln(x)+1`
`:. f^('')(x) = 1/x`
The value of table for `x` and `y`
Two-point FDF (Forward difference formula)
`f^'(x)=(f(x+h)-f(x))/h`
`f^'(2)=(f(2+1)-f(2))/1`
`f^'(2)=(f(3)-f(2))/1`
`f^'(2)=(3.2958-1.3863)/1`
`f^'(2)=1.9095`
Absolute Error:`|"exact value of " f^'(2)-(1.9095)|=|1.6931 -1.9095|=0.2164`
Two-point BDF (Backward difference formula)
`f^'(x)=(f(x)-f(x-h))/h`
`f^'(2)=(f(2)-f(2-1))/1`
`f^'(2)=(f(2)-f(1))/1`
`f^'(2)=(1.3863-0)/1`
`f^'(2)=1.3863`
Absolute Error:`|"exact value of " f^'(2)-(1.3863)|=|1.6931 -1.3863|=0.3069`
Two-point CDF (Central difference formula)
`f^'(x)=(f(x+h)-f(x-h))/(2h)`
`f^'(2)=(f(2+1)-f(2-1))/(2*1)`
`f^'(2)=(f(3)-f(1))/2`
`f^'(2)=(3.2958-0)/2`
`f^'(2)=1.6479`
Absolute Error:`|"exact value of " f^'(2)-(1.6479)|=|1.6931 -1.6479|=0.0452`
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then