`f(x)=xlnx` and `h = 1`, estimate `f^'(5) and f^('')(5)`
using Five 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`
x | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
---|
y | 0 | 1.3863 | 3.2958 | 5.5452 | 8.0472 | 10.7506 | 13.6214 | 16.6355 | 19.775 |
---|
Five-point FDF (Forward difference formula)
`f^'(x)=1/(12h)[-25f(x)+48f(x+h)-36f(x+2h)+16f(x+3h)-3f(x+4h)]`
`f^'(5)=1/(12*1)[-25f(5)+48f(5+1)-36f(5+2*1)+16f(5+3*1)-3f(5+4*1)]`
`f^'(5)=1/(12)[-25f(5)+48f(6)-36f(7)+16f(8)-3f(9)]`
`f^'(5)=1/(12)[-25(8.0472)+48(10.7506)-36(13.6214)+16(16.6355)-3(19.775)]`
`f^'(5)=2.6101`
Absolute Error:`|"exact value of " f^'(5)-(2.6101)|=|2.6094 -2.6101|=0.0007`
Five-point CDF (Central difference formula)
`f^'(x)=1/(12h)[f(x-2h)-8f(x-h)+8f(x+h)-f(x+2h)]`
`f^'(5)=1/(12*1)[f(5-2*1)-8f(5-1)+8f(5+1)-f(5+2*1)]`
`f^'(5)=1/12[f(3)-8f(4)+8f(6)-f(7)]`
`f^'(5)=1/12[3.2958-8(5.5452)+8(10.7506)-13.6214]`
`f^'(5)=2.6098`
Absolute Error:`|"exact value of " f^'(5)-(2.6098)|=|2.6094 -2.6098|=0.0004`
Five-point CDF (Central difference formula) for second derivatives
`f^('')(x)=1/(12h^2)[-f(x-2h)+16f(x-h)-30f(x)+16f(x+h)-f(x+2h)]`
`f^('')(5)=1/(12*(1)^2)[-f(5-2*1)+16f(5-1)-30f(5)+16f(5+1)-f(5+2*1)]`
`f^('')(5)=1/12[-f(3)+16f(4)-30f(5)+16f(6)-f(7)]`
`f^('')(5)=1/12[-3.2958+16(5.5452)-30(8.0472)+16(10.7506)-13.6214]`
`f^('')(5)=0.1999`
Absolute Error:`|"exact value of " f^('')(5)-(0.1999)|=|0.2 -0.1999|=0.0001`
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then