Note: In this homework, you will use tolerance epsi lon=10^(-10) for the termination threshold. The n in
the following represents n^(th ) iteration.
Answer the following questions based on Newton method and Secant method.
(a) (on paper) Derive the Newton method for solving nonlinear equation f(x)=0.
(b) (on paper) Derive the Secant method for solving nonlinear equation f(x)=0.
(c) Given a nonlinear equation f(x)=0, where f(x)=(x)/(1+e^(x))+1.
i. (on paper) Write the Newton scheme to solve this equation.
ii. Code for the Newton scheme derived above.
iii. (on paper) Use initial guess x_(0)=0 and x_(0)=2 to run the code, respectively. Output
the results, plot n vs log|f(x_(n))| or n vs log|x_(n+1)-x_(n)| for each case, and explain
what you observed.
iv. (on paper) Write the Secant scheme to solve this equation.
v. Code for the Secant scheme derived above.
vi. (on paper) Use initial guess x_(0)=0 and x_(0)=0.1 to run your Secant code. Output
the result, plot n vs log|f(x_(n))| or n vs log|x_(n+1)-x_(n)|, compare the convergence
speed with the Newton scheme with x_(0)=0, and explain what you observed.
(d) (on paper) Given a nonlinear equation f(x)=0, where f(x)=x^(3)-2x+2. Can we use
x_(0)=sqrt((2)/(3)) to initialize the Newton scheme, explain why?
(e) (on paper) Given a nonlinear equation f(x)=0, where f(x)=x^((1)/(3)). Are we able to use
Newton method solving this nonlinear equation, explain why?
Note: In this honework, you will use tolerance e = 10-10 for the termination threshold. The n in the following represents nth iteration.
1. Answer the following questions based on Newton method and Secant method.
(a) (on paper) Derive the Newton method for solving nonlinear equation f(x) = 0. (b) (on paper) Derive the Secant method for solving nonlinear equation f (x) = 0 (c) Given a nonlinear equation f(x) = 0, where f(x) = i+e+ + 1. i. (on paper) Write the Newton scheme to solve this equation. ii. Code for the Newton scheme derived above.
iii. (on paper) Use initial guess xo = 0 and co = 2 to run the code, respectively. Output the results, plot n vs log|f(xn)| or n vs log|xn+1 - xn| for each case, and explain what you observed. iv. (on paper) Write the Secant scheme to solve this equation. v. Code for the Secant scheme derived above.
vi. (on paper) Use initial guess xo = 0 and xo = 0.1 to run your Secant code. Output the result, plot n vs log|f(cn)] or n vs logxn+1 - xn, compare the convergence speed with the Newton scheme with xo = 0, and explain what you observed.
(d) (on paper) Given a nonlinear equation f() = 0, where f(x) = x3 -- 2x +2. Can we use To = V3 to initialize the Newton scheme, explain why?
(e) (on paper) Given a nonlinear equation f(x) = 0, where f(x) = x3. Are we able to use Newton method solving this nonlinear equation, explain why?