Difference between revisions of "OSH/Example/3"
m (Cytryn moved page OSH/Examples demonstrating how to write up your answers/3 to OSH/Example/3) |
|||
Line 2: | Line 2: | ||
====Example problem statement==== | ====Example problem statement==== | ||
− | Estimate $\sqrt{15}$ to | + | Estimate $\sqrt{15}$ to 8 decimal places using Newton's method. |
====Solution==== | ====Solution==== | ||
− | In order to use Newton's method, | + | In order to use Newton's method, I needed a polynomial that has a zero at $\sqrt{15}$. I used the function |
:\(f(x)= x^2-15.\) | :\(f(x)= x^2-15.\) | ||
− | For Newton's method, | + | For Newton's method, I also needed the derivative of this function: |
:\(f'(x)= 2x.\) | :\(f'(x)= 2x.\) | ||
− | The last thing | + | The last thing I needed before starting with Newton's method was an initial guess. The nearest perfect square to 15 is 16 so $x=4$ was a good candidate for an initial guess. Graphing $f(x)$, it was clear that $x=4$ is positioned well so that Newton's method should converge to $\sqrt{15}$. |
− | The Newton's method iterates | + | I used a spreadsheet to calculate the iterates by entering "4" into cell A1, "=A1-(A1^2-15)/(2*A1)" into cell A2 and copying the formula in A2 to A3 through A10. Examining the decimal places, it was clear that by cell A4 the first 8 decimal places were no longer changing. The Newton's method iterates were |
<math> | <math> | ||
Line 20: | Line 20: | ||
x_{1} &= 3.875\\ | x_{1} &= 3.875\\ | ||
x_{2} &= 3.872983871\\ | x_{2} &= 3.872983871\\ | ||
− | x_{3} &= 3.872983346 | + | x_{3} &= 3.872983346\\ |
+ | x_{4} &= 3.872983346 | ||
\end{align} | \end{align} | ||
</math> | </math> | ||
− | As the first | + | As the first 9 decimal points are the same, our estimate $x_4$ should be correct to 8 decimal places. |
Revision as of 15:15, 25 September 2014
Example problem statement
Estimate $\sqrt{15}$ to 8 decimal places using Newton's method.
Solution
In order to use Newton's method, I needed a polynomial that has a zero at $\sqrt{15}$. I used the function
- \(f(x)= x^2-15.\)
For Newton's method, I also needed the derivative of this function:
- \(f'(x)= 2x.\)
The last thing I needed before starting with Newton's method was an initial guess. The nearest perfect square to 15 is 16 so $x=4$ was a good candidate for an initial guess. Graphing $f(x)$, it was clear that $x=4$ is positioned well so that Newton's method should converge to $\sqrt{15}$.
I used a spreadsheet to calculate the iterates by entering "4" into cell A1, "=A1-(A1^2-15)/(2*A1)" into cell A2 and copying the formula in A2 to A3 through A10. Examining the decimal places, it was clear that by cell A4 the first 8 decimal places were no longer changing. The Newton's method iterates were
\( \begin{align} x_{1} &= 3.875\\ x_{2} &= 3.872983871\\ x_{3} &= 3.872983346\\ x_{4} &= 3.872983346 \end{align} \)
As the first 9 decimal points are the same, our estimate $x_4$ should be correct to 8 decimal places.