Use both the bisection method and fixed-point iteration to find an approximation to \(\sqrt[3]{25}\) that is accurate to within \(10^{-7}\).
For the bisection method, use \(f(x)=x^3-25\) with the search interval \([1,3]\).
For the fixed-point iteration, use \(g(x)=\frac{2x^3+25}{3x^2}\) to identify the fixed point \(g(x)=x\) with some initial point (says, \(p_0=1\) or \(p_0=2\)).
# Your code goes here
Recall that Newton’s method does not exhibit quadratic convergence when one of the following two cases occur:
Case 1: The derivative of the function \(f\) is zero at the root \(p\) with \(f(p)=0\).
Case 2: The second-order derivative of the function \(f\) does not exist at the root \(p\) with \(f(p)=0\).
We already demonstrate the exact linear convergence of Newton’s
method under Case 1 in the Lecture 8 slides. Now, we will
explore Case 2 by implementing Newton’s method on \(f(x)=x+x^{\frac{4}{3}}\). In addition,
output the limiting point \(p^*\) of
Newton’s method under the initialization \(p_0=3\) and the tolerance level \(\epsilon=10^{-13}\). Moreover, apply the
Aitken’s \(\Delta^2\) method to the
sequence produced by Newton’s method. Finally, plot the
logarithm of the error \(|p_n-p^*|\) against the number of
iterations for both the Newton’s method and Aitken’s \(\Delta^2\) method in the same plot. (Hint:
You can adopt the code in Lecture 8 slides, but the ylim
and legend location for the plot need adjusting.)
library(latex2exp)
# Your code goes here
# Your code goes here
integrate()
.# Your code goes here