MHB 205.q4.2 very painful Newton's Method

karush
Gold Member
MHB
Messages
3,240
Reaction score
5
%\section{Newton's Method }
%\subsubsection{205.q4.2 }
%\footnote{Leeward Community College}method m ,
$\textsf{a. Use Newton's Method: }$0000
\begin{align}
\displaystyle
x_{n+1}&=x_n-\frac{f(x_n)}{f'(x_n)}
\end{align}
$\textsf{b. Use Newton's Method to solve: }$
\begin{align}
\displaystyle
f_{q4.2}(x)&=x^3-\sin\left({x}\right)-2
\end{align}
$\textsf{accurate to 3 decimal places.}$
\begin{array}
\displaystyle
x_0&=\frac{f(0)}{f'(0)}
\therefore\frac{x^3-\sin(x)-2}{3x^2 - \cos(x)}&=0 \\
x_1&=0- \frac{f(0)}{f'(0)} &=-2.00... \\
x_2&=2.00- \frac{f(2.00)}{f'(2.00)}&=-1.267...\\
x_3&=1.267- \frac{f(1.267)}{f'(1.267)}&=-0.586...\\
x_4&=0.586- \frac{f(0.586)}{f'(0.586)}&=7.739...\\
x_5&=7.739- \frac{f(7.739)}{f'(7.739)}&=5.174.. \\
x_6&=5.174- \frac{f(5.174)}{f'(5.174)}&=3.453... \\
x_7&=3.454- \frac{f(3.454)}{f'(3.454)}&=2.378... \\
x_8&=2.378- \frac{f(2.378)}{f'(2.378)}&=1.770... \\
x_9&=1.770- \frac{f(1.770)}{f'(1.770)}&=1.502... \\
x_{10}&=1.502- \frac{f(1.502)}{f'(1.502)}&=1.443... \\
x_{11}&=1443- \frac{f(1443)}{f'(1443)}&=1.440... \\
x_{12}&=1440- \frac{f(1440)}{f'(1440)}&=1.440...\\
x_1 &\approx x_{12}
\end{array}
 
Last edited:
Physics news on Phys.org
Your choice of first guess at the root was made at a place on the function where the sign of its derivative is different than that on the part containing the root. $f$ is decreasing when $x=0$, but it is increasing where $f=0$. That's why Newton's method didn't behave nicely at first. :D
 
karush said:
%\section{Newton's Method }
%\subsubsection{205.q4.2 }
%\footnote{Leeward Community College}method m ,
$\textsf{a. Use Newton's Method: }$0000
\begin{align}
\displaystyle
x_{n+1}&=x_n-\frac{f(x_n)}{f'(x_n)}
\end{align}
$\textsf{b. Use Newton's Method to solve: }$
\begin{align}
\displaystyle
f_{q4.2}(x)&=x^3-\sin\left({x}\right)-2
\end{align}
$\textsf{accurate to 3 decimal places.}$
\begin{array}
\displaystyle
x_0&=\frac{f(0)}{f'(0)}
\therefore\frac{x^3-\sin(x)-2}{3x^2 - \cos(x)}&=0 \\
x_1&=0- \frac{f(0)}{f'(0)} &=-200... \\
x_2&=1.267- \frac{f(1.267)}{f'(1.267)}&=-1.267...\\
x_3&=1.267- \frac{f(1.267)}{f'(1.267)}&=-0.586...\\
x_4&=0.586- \frac{f(0.586)}{f'(0.586)}&=7.739...\\
x_5&=7.739- \frac{f(7.739)}{f'(7.739)}&=5.174.. \\
x_6&=5.174- \frac{f(5.174)}{f'(5.174)}&=3.453... \\
x_7&=3.454- \frac{f(3.454)}{f'(3.454)}&=2.378... \\
x_8&=2.378- \frac{f(2.378)}{f'(2.378)}&=1.770... \\
x_9&=1.770- \frac{f(1.770)}{f'(1.770)}&=1.502... \\
x_{10}&=1.502- \frac{f(1.502)}{f'(1.502)}&=1443... \\
x_{11}&=1443- \frac{f(1443)}{f'(1443)}&=1440... \\
x_{12}&=1440- \frac{f(1440)}{f'(1440)}&=1440...\\
x_1 &\approx x_{12}
\end{array}
I didn't check the actual numbers, but there are some errors that need to be looked into.

1) x_0 is wrong.

2) You are missing decimal places for x_1, x_11, and x_12.

3) x_2=1.267- f(1.267)/f'(1.267) This number is copied wrong.

4) x_3=1.267- f(1.267)/f'(1.267) So is this one.

5) Is your answer correct? You never said why you are posting this.

There might be more errors. Fix these and I'll take another look.

-Dan
 
$\textsf{a. Use Newton's Method: }$
\begin{align}
\displaystyle
x_{n+1}&=x_n-\frac{f(x_n)}{f'(x_n)}
\end{align}
$\textsf{b. Use Newton's Method to solve: }$
\begin{align}
\displaystyle
f_{q4.2}(x)&=x^3-\sin\left({x}\right)-2
\end{align}
$\textsf{accurate to 3 decimal places.}$
\begin{array}
\displaystyle
x_0&=\frac{f(0)}{f'(0)}
\therefore\frac{x^3-\sin(x)-2}{3x^2 - \cos(x)}&=0 \\
x_1&=0- \frac{f(0)}{f'(0)} &=-2.00... \\
x_2&=2.00- \frac{f(2.00)}{f'(2.00)}&=-1.267...\\
x_3&=1.267- \frac{f(1.267)}{f'(1.267)}&=-0.586...\\
x_4&=0.586- \frac{f(0.586)}{f'(0.586)}&=7.739...\\
x_5&=7.739- \frac{f(7.739)}{f'(7.739)}&=5.174.. \\
x_6&=5.174- \frac{f(5.174)}{f'(5.174)}&=3.453... \\
x_7&=3.454- \frac{f(3.454)}{f'(3.454)}&=2.378... \\
x_8&=2.378- \frac{f(2.378)}{f'(2.378)}&=1.770... \\
x_9&=1.770- \frac{f(1.770)}{f'(1.770)}&=1.502... \\
x_{10}&=1.502- \frac{f(1.502)}{f'(1.502)}&=1.443... \\
x_{11}&=1443- \frac{f(1443)}{f'(1443)}&=1.440... \\
x_{12}&=1440- \frac{f(1440)}{f'(1440)}&=1.440...\\
x_{11} &\approx x_{12}
\end{array}

was wondering why so many iterations thot 3 would be enough
 
At a glance we can see:

$$0<f\left(\frac{\pi}{2}\right)<1$$

So, let's let $$x_0=\frac{\pi}{2}$$

And then we have:

$$x_{n+1}=x_n-\frac{x_n^3-\sin\left(x_n\right)-2}{3x_n^2-\cos\left(x_n\right)}$$

Hence:

$$x_1\approx1.4524822857659487$$

$$x_2\approx1.4410028287773716$$

$$x_3\approx1.4408982227972972$$

$$x_4\approx1.4408982141519631$$
 
karush said:
$\textsf{a. Use Newton's Method: }$
\begin{align}
\displaystyle
x_{n+1}&=x_n-\frac{f(x_n)}{f'(x_n)}
\end{align}
$\textsf{b. Use Newton's Method to solve: }$
\begin{align}
\displaystyle
f_{q4.2}(x)&=x^3-\sin\left({x}\right)-2
\end{align}
$\textsf{accurate to 3 decimal places.}$
\begin{array}
\displaystyle
x_0&=\frac{f(0)}{f'(0)}
\therefore\frac{x^3-\sin(x)-2}{3x^2 - \cos(x)}&=0 \\
x_1&=0- \frac{f(0)}{f'(0)} &=-2.00... \\
x_2&=2.00- \frac{f(2.00)}{f'(2.00)}&=-1.267...\\
x_3&=1.267- \frac{f(1.267)}{f'(1.267)}&=-0.586...\\
x_4&=0.586- \frac{f(0.586)}{f'(0.586)}&=7.739...\\
x_5&=7.739- \frac{f(7.739)}{f'(7.739)}&=5.174.. \\
x_6&=5.174- \frac{f(5.174)}{f'(5.174)}&=3.453... \\
x_7&=3.454- \frac{f(3.454)}{f'(3.454)}&=2.378... \\
x_8&=2.378- \frac{f(2.378)}{f'(2.378)}&=1.770... \\
x_9&=1.770- \frac{f(1.770)}{f'(1.770)}&=1.502... \\
x_{10}&=1.502- \frac{f(1.502)}{f'(1.502)}&=1.443... \\
x_{11}&=1443- \frac{f(1443)}{f'(1443)}&=1.440... \\
x_{12}&=1440- \frac{f(1440)}{f'(1440)}&=1.440...\\
x_{11} &\approx x_{12}
\end{array}

was wondering why so many iterations thot 3 would be enough
You still have plenty of sign problems. Such as, why are you saying x_0 = 0 when it's clearly -2.00? etc. for x_1 through x_3. I suspect these are all problems with copying seeing as you are getting the correct answer.

MarkFL answered for the rest. Newton's method is not a high accuracy/speed algorithm. That's why you have to look at your graph and carefully choose an x_0. And even then you might not get an answer that converges and you might get a zero that you weren't even looking for. The advantage is that it's an easy algorithm to use.

-Dan

Addendum: Oh, and I don't know how many decimals you are actually using. Don't round much. The rounding can really screw you up in a problem like this one.
 
it was supposed to go to 3 decimals but yes i see the decimal points missing...must be going blind☕
 
Dan's right, don't round in the intermediary steps...carry as many digits as your machine allows. If you are told to approximate a root to $n$ decimal places, then carry out the recursion as accurately as you can until two successive iterations agree to $n+1$ decimal places so that you can properly round to $n$ places. :D
 
well what i learned from this was start closer to avoid so many iterations and extend the round off at least dounle what is sougth for matching.
I was able to get the TI cx cas to do the recrusion up to 12 but need to extend the round off.

probably best just to graph it first then pick the $x_0$
☕
 
Back
Top