For the function fx 2 x 3 x2 Calculate the true error fro
For the function f(x) = 2 + x - 3 x^2 Calculate the true error from evaluating f(x) at x=l by using A forward difference with a step of h=0.25 A backward difference with a step of h=0.25 A central difference with a step of h=0.25
Solution
f(x) = 2 + x - 3x^2
f\'(x) using differentiation
f\'(x) = 1 - 6x
f\'(1) = 1 - 6(1) = -5
Using the forward differnce we get
f\'(1) = [f(1.25) - f(1)]/0.25
=> [(2 + 1.25 - 3(1.25)^2) - (2 + 1 - 3(1)^2)]/0.25
=> -5.75
Error = (-5.75 + 6)/-6 * 100 = 4.1667%
Using the backward differnce we get
f\'(1) = [f(1) - f(0.75)]/0.25
=> [(2 + 1 - 3(1)^2) - (2 + 0.75 - 3(0.75)^2)]/0.25
=> -4.25
Error Percentagte = 1.75/6 * 100 = 29.16%
Error = (-5.75 + 6)/-6 * 100 = 4.1667%
