The roots of f(x) are known or are easily found. Use 5 iterations of Newton’s Method with the given initial approximation to approximate the root. Compare it to the known value of the root. f(x) = x2 + x - 2, x0 = 0
Solution
f(x) = x2 + x - 2, x0 = 0
f’(x) = 2x + 1
\[x1 = x0 - \frac {f(1)} {f ′(1)} = 0 - \frac {x^2 + x -2} {2x + 1} = 0 - \frac {0^2 + 0 -2}{2*0 + 1} = 0 + 2 = 2\] \[x2 = x1 - \frac {f(2)} {f ′(2)} = 2 - \frac {2^2 + 2 -2} {2*2 + 1} = 2 - \frac {4} {5} = 1.2\]
\[x3 = x2 - \frac {f(1.2)} {f ′(1.2)} = 1.2 - \frac {1.2 ^ 2 + 1.2 - 2}{2 * 1.2 + 1} = 1.2 - \frac {0.64}{3.4} = 1.011765\] \[x4 = x3 - \frac {f(1.011765)} {f ′(1.011765)} = 1.011765 - \frac {1.011765 ^ 2 + 1.011765 - 2}{2 * 1.011765 + 1} = 1.011765 - \frac {0.03543342}{3.02353} = 1.000046\]
\[x5 = x4 - \frac {f(1.000046)} {f ′(1.000046)} = 1.000046 - \frac {1.000046 ^ 2 + 1.000046 - 2}{2 * 1.000046 + 1} = 1.000046 - \frac {0.0001380021}{3.000092} = 1\]
We performed 5 iterations of Newton’s Method:
library(kableExtra)
x0 = 0
x1 = 2
x2 = 1.2
x3 = 1.011765
x4 = 1.000046
x5 = 1
iteration <- c(x0,x1,x2,x3,x4,x5)
names(iteration) <- c('x0', 'x1', 'x2', 'x3', 'x4', 'x5')
kable(iteration, col.names = "Values") %>%kable_paper('hover', full_width = F)| Values | |
|---|---|
| x0 | 0.000000 |
| x1 | 2.000000 |
| x2 | 1.200000 |
| x3 | 1.011765 |
| x4 | 1.000046 |
| x5 | 1.000000 |