Calculus

Applications of the Derivative

Applications of Derivative Logo

Newton’s Method

  • Newton’s method (or Newton-Raphson method) is an iterative procedure used to find the roots of a function.

    Newton's method
    Figure 1.

    Suppose we need to solve the equation \(f\left( x \right) = 0\) and \(x=c\) is the actual root of \(f\left( x \right).\) We assume that the function \(f\left( x \right)\) is differentiable in an open interval that contains \(c.\)

    To find an approximate value for \(c:\)

    1. Start with an initial approximation \({x_0}\) close to \(c.\)
    2. Determine the next approximation by the formula \[{x_1} = {x_0} – \frac{{f\left( {{x_0}} \right)}}{{f^\prime\left( {{x_0}} \right)}}.\]
    3. Continue the iterative process using the formula \[\cssId{element2}{{x_{n + 1}} = {x_n} – \frac{{f\left( {{x_n}} \right)}}{{f^\prime\left( {{x_n}} \right)}}}\] until the root is found to the desired accuracy.

    Let’s apply Newton’s method to approximate \(\sqrt 3.\) Suppose that we need to solve the equation

    \[{f\left( x \right) = {x^2} – 3 = 0,}\]

    where the root \(c \gt 0.\)

    Take the derivative of the function:

    \[{f^\prime\left( x \right) = \left( {{x^2} – 3} \right)^\prime = 2x.}\]

    Let \({x_0} = 2.\) Calculate the next approximation \({x_1}:\)

    \[{{{x_1} = {x_0} – \frac{{f\left( {{x_0}} \right)}}{{f^\prime\left( {{x_0}} \right)}} }={ 2 – \frac{{{2^2} – 3}}{{2 \cdot 2}} }={ 2 – \frac{1}{4} }={ 1.75}}\]

    In the next step, we get

    \[{{{x_2} = {x_1} – \frac{{f\left( {{x_1}} \right)}}{{f^\prime\left( {{x_1}} \right)}} }={ 1.75 – \frac{{{{1.75}^2} – 3}}{{2 \cdot 1.75}} }={ 1.732143}}\]

    Similarly, we find the approximate value \({x_3}:\)

    \[{{{x_3} = {x_2} – \frac{{f\left( {{x_2}} \right)}}{{f^\prime\left( {{x_2}} \right)}} }={ 1.732143 – \frac{{{{1.732143}^2} – 3}}{{2 \cdot 1.732143}} }={ 1.73205081}}\]

    In this iteration, the approximation accuracy is \(8\) decimal places like in a smartphone calculator.

    The square root of 3.
    Figure 2.

    So, we were able to compute the square root of \(3\) with the accuracy to \(8\) decimal places just for \(3\) steps!


  • Solved Problems

    Click a problem to see the solution.

    Example 1

    Approximate \(\sqrt[3]{2}\) to 6 decimal places.

    Example 2

    Determine how many iterations does it take to compute \(\sqrt 5\) to 8 decimal places using Newton’s method with the initial value \({x_0} = 2?\)

    Example 3

    Approximate the solution of the equation \({x^2} + x – 3 = 0\) to 7 decimal places with the initial guess \({x_0} = 2.\)

    Example 4

    Approximate \(\ln 2\) to 5 decimal places.

    Example 5

    Let \(f\left( x \right) = {x^3} – 7.\) Using Newton’s method, compute 3 iterations for this function with the initial guess \({x_0} = 2.\)

    Example 6

    Approximate the solution of the equation \(x\ln x = 1\) with an accuracy of 4 decimal places. Use the initial guess \({x_0} = 2.\)

    Example 7

    Using Newton’s method, find the solution of the equation \(x + {e^x} = 0\) with an accuracy of 3 decimal places.

    Example 8

    Find an approximate solution, accurate to 5 decimal places, to the equation \(\cos x = {x^2}\) that lies in the interval \(\left[ {0,\large{\frac{\pi }{2}}\normalsize} \right].\)

    Example 9

    Find an approximate solution, accurate to 4 decimal places, to the equation \(\sin \left( {{e^x}} \right) = 1\) on the interval \(\left[ {0,\pi } \right].\)

    Example 10

    Given the equation \({x^4} – x – 1 = 0.\) It is known that this equation has a root in the interval \(\left( {1,2} \right).\) Find an approximate value of the root with an accuracy of 4 decimal places.

    Example 1.

    Approximate \(\sqrt[3]{2}\) to 6 decimal places.

    Solution.

    We apply Newton’s method to the function \(f\left( x \right) = {x^3} – 2\) assuming \(x \ge 0\) and perform several successive iterations using the formula

    \[{x_{n + 1}} = {x_n} – \frac{{f\left( {{x_n}} \right)}}{{f^\prime\left( {{x_n}} \right)}}.\]

    Let \({x_0} = 1.\) This yields the following results:

    \[{{x_1} = {x_0} – \frac{{f\left( {{x_0}} \right)}}{{f^\prime\left( {{x_0}} \right)}} }={ 1 – \frac{{{1^3} – 2}}{{3 \cdot {1^2}}} }={ 1.3333333}\]

    \[{{x_2} = {x_1} – \frac{{f\left( {{x_1}} \right)}}{{f^\prime\left( {{x_1}} \right)}} }={ 1.3333333 – \frac{{{{1.3333333}^3} – 2}}{{3 \cdot {{1.3333333}^2}}} }={ 1.2638889}\]

    Similarly, we get

    \[{x_3} = 1.2599335\]

    \[{x_4} = 1.2599211\]

    \[{x_5} = 1.2599211\]

    We see that the \(4\)th iteration gives the approximation to \(6\) decimal places, so the answer is \({x_4} = 1.259921\)

    Example 2.

    Determine how many iterations does it take to compute \(\sqrt 5\) to 8 decimal places using Newton’s method with the initial value \({x_0} = 2?\)

    Solution.

    We apply Newton’s method to the function

    \[f\left( x \right) = {x^2} – 5.\]

    The iterations are given by the formula

    \[{x_{n + 1}} = {x_n} – \frac{{f\left( {{x_n}} \right)}}{{f^\prime\left( {{x_n}} \right)}}.\]

    The first approximation is equal to

    \[{{x_1} = {x_0} – \frac{{f\left( {{x_0}} \right)}}{{f^\prime\left( {{x_0}} \right)}}} = {2 – \frac{{{2^2} – 5}}{{2 \cdot 2}} }={ 2.25}\]

    Continue the process to get the following approximations:

    \[{x_2} = 2.236111111\]

    \[{x_3} = 2.236067978\]

    \[{x_4} = 2.236067977\]

    Hence, it takes \(3\) iterations to get the approximate value of \(\sqrt 5\) to \(8\) decimal places (not too bad!)

    Example 3.

    Approximate the solution of the equation \({x^2} + x – 3 = 0\) to 7 decimal places with the initial guess \({x_0} = 2.\)

    Solution.

    We apply the recurrent formula given by Newton’s method:

    \[{x_{n + 1}} = {x_n} – \frac{{f\left( {{x_n}} \right)}}{{f^\prime\left( {{x_n}} \right)}}.\]

    In the first step we get

    \[{{x_1} = {x_0} – \frac{{f\left( {{x_0}} \right)}}{{f^\prime\left( {{x_0}} \right)}}} ={ 2 – \frac{{{2^2} + 2 – 3}}{{2 \cdot 2 + 1}} }={ 1.4}\]

    The next approximations are given by

    \[{x_2} = 1.30526316\]

    \[{x_3} = 1.30277735\]

    \[{x_4} = 1.30277564\]

    \[{x_5} = 1.30277564\]

    Thus, we were able to get the approximate solution with an accuracy of \(7\) decimal places after \(4\) iterations. It is equal to

    \[{x_4} = 1.30277564\]

    Example 4.

    Approximate \(\ln 2\) to 5 decimal places.

    Solution.

    To find an approximate value of \(\ln 2,\) we use the recurrent formula

    \[{x_{n + 1}} = {x_n} – \frac{{f\left( {{x_n}} \right)}}{{f^\prime\left( {{x_n}} \right)}}.\]

    Starting from \({x_0} = 1,\) we obtain the following successive approximate values for \(\ln 2:\)

    \[{{x_1} = {x_0} – \frac{{f\left( {{x_0}} \right)}}{{f^\prime\left( {{x_0}} \right)}}} ={ 1 – \frac{{{e^1} – 2}}{{{e^1}}} }={ 0.735759}\]

    \[{{x_2} = {x_1} – \frac{{f\left( {{x_1}} \right)}}{{f^\prime\left( {{x_1}} \right)}}} ={ 0.735759 – \frac{{{e^{0.735759}} – 2}}{{{e^{0.735759}}}} }={ 0.694042}\]

    The next calculations produce

    \[{x_3} = 0.693148\]

    \[{x_4} = 0.693147\]

    One can see that we’ve got the approximation to \(5\) decimal places on the \(3\)rd step. So the answer is

    \[\ln 2 \approx 0.69315\]

    Example 5.

    Let \(f\left( x \right) = {x^3} – 7.\) Using Newton’s method, compute 3 iterations for this function with the initial guess \({x_0} = 2.\)

    Solution.

    The iterative formula for Newton’s method is given as

    \[{x_{n + 1}} = {x_n} – \frac{{f\left( {{x_n}} \right)}}{{f^\prime\left( {{x_n}} \right)}}.\]

    Find out the derivative:

    \[{f^\prime\left( x \right) = \left( {{x^3} – 7} \right)^\prime }={ 3{x^2}.}\]

    The first iteration is equal to

    \[{{x_1} = {x_0} – \frac{{f\left( {{x_0}} \right)}}{{f^\prime\left( {{x_0}} \right)}}} ={ 2 – \frac{{{2^3} – 7}}{{3 \cdot {2^2}}} }={ 1.916667}\]

    Next, we perform two more iterations:

    \[{{x_2} = {x_1} – \frac{{f\left( {{x_1}} \right)}}{{f^\prime\left( {{x_1}} \right)}}} ={ 1.916667 – \frac{{{{1.916667}^3} – 7}}{{3 \cdot {{1.916667}^2}}} }={ 1.912938}\]

    \[{{x_3} = {x_2} – \frac{{f\left( {{x_2}} \right)}}{{f^\prime\left( {{x_2}} \right)}}} ={ 1.912938 – \frac{{{{1.912938}^3} – 7}}{{3 \cdot {{1.912938}^2}}} }={ 1.912933}\]

    After \(3\) iterations we’ve got the approximate solution with an accuracy of \(5\) decimal places.

    Answer: \({x_3} = 1.91293\)

    Example 6.

    Approximate the solution of the equation \(x\ln x = 1\) with an accuracy of 4 decimal places. Use the initial guess \({x_0} = 2.\)

    Solution.

    Consider the function

    \[f\left( x \right) = x\ln x – 1\]

    and apply Newton’s method to find zero of the function.

    Find the derivative by the product rule:

    \[{f^\prime\left( x \right) = \left( {x\ln x – 1} \right)^\prime }={ 1 \cdot \ln x + x \cdot \frac{1}{x} }={ \ln x + 1.}\]

    Calculate the first approximation:

    \[{{x_1} = {x_0} – \frac{{f\left( {{x_0}} \right)}}{{f^\prime\left( {{x_0}} \right)}}} ={ 2 – \frac{{2\ln 2 – 1}}{{\ln 2 + 1}} }={ 1.77184}\]

    Continue the iterative process until we reach an accuracy of \(4\) decimal places.

    \[{{x_2} = {x_1} – \frac{{f\left( {{x_1}} \right)}}{{f^\prime\left( {{x_1}} \right)}}} ={ 1.77184 – \frac{{1.77184 \cdot \ln \left( {1.77184} \right) – 1}}{{\ln \left( {1.77184} \right) + 1}} }={ 1.76323}\]

    \[{{x_3} = {x_2} – \frac{{f\left( {{x_2}} \right)}}{{f^\prime\left( {{x_2}} \right)}}} ={ 1.76323 – \frac{{1.76323 \cdot \ln \left( {1.76323} \right) – 1}}{{\ln \left( {1.76323} \right) + 1}} }={ 1.76322}\]

    As you can see, we have obtained the required accuracy after only \(2\) steps.

    Answer: \({x_2} = 1.7632\)

    Example 7.

    Using Newton’s method, find the solution of the equation \(x + {e^x} = 0\) with an accuracy of 3 decimal places.

    Solution.

    We choose \({x_0} = – 1\) and compute the first approximation:

    \[{{x_1} = {x_0} – \frac{{f\left( {{x_0}} \right)}}{{f^\prime\left( {{x_0}} \right)}}} ={ – 1 – \frac{{ – 1 + {e^{ – 1}}}}{{1 + {e^{ – 1}}}} }={ – 0.5379}\]

    Continue the process until we get the result with the required accuracy.

    \[{{x_2} = {x_1} – \frac{{f\left( {{x_1}} \right)}}{{f^\prime\left( {{x_1}} \right)}} }={ – 0.5379 – \frac{{ – 0.5379 + {e^{ – 0.5379}}}}{{1 + {e^{ – 0.5379}}}} }={ – 0.5670}\]

    \[{{x_3} = {x_2} – \frac{{f\left( {{x_2}} \right)}}{{f^\prime\left( {{x_2}} \right)}} }={ – 0.5670 – \frac{{ – 0.5670 + {e^{ – 0.5670}}}}{{1 + {e^{ – 0.5670}}}} }={ – 0.5671}\]

    We see that we’ve already got a stable result to \(3\) decimal places, so the approximate solution is \(x \approx – 0.567\)

    Example 8.

    Find an approximate solution, accurate to 5 decimal places, to the equation \(\cos x = {x^2}\) that lies in the interval \(\left[ {0,\large{\frac{\pi }{2}}\normalsize} \right].\)

    Solution.

    Solution of the equation cos(x)=x^2
    Figure 3.

    First we rewrite this equation in the form

    \[\cos x – {x^2} = 0.\]

    Suppose that the initial value of the root is \({x_0} = 1.\) Let’s get the first approximation using Newton’s method:

    \[{{x_1} = {x_0} – \frac{{f\left( {{x_0}} \right)}}{{f^\prime\left( {{x_0}} \right)}}} ={ {x_0} – \frac{{\cos {x_0} – x_0^2}}{{ – \sin {x_0} – 2{x_0}}} }={ 1 – \frac{{\cos 1 – {1^2}}}{{ – \sin 1 – 2 \cdot 1}} }={ 0.838218}\]

    Here and further we write approximate values with 6 decimal places to track the convergence of the result.

    In the next step, we have

    \[{{x_2} = {x_1} – \frac{{\cos {x_1} – x_1^2}}{{ – \sin {x_1} – 2{x_1}}} }={ 0.838218 }-{ \frac{{\cos \left( {0.838218} \right) – {{0.838218}^2}}}{{ – \sin \left( {0.838218} \right) – 2 \cdot 0.838218}} }={ 0.824242}\]

    The third approximation gives the following value of the root:

    \[{{x_3} = {x_2} – \frac{{\cos {x_2} – x_2^2}}{{ – \sin {x_2} – 2{x_2}}} }={ 0.824242 }-{ \frac{{\cos \left( {0.824242} \right) – {{0.824242}^2}}}{{ – \sin \left( {0.824242} \right) – 2 \cdot 0.824242}} }={ 0.824132}\]

    Continue computations:

    \[{{x_4} = {x_3} – \frac{{\cos {x_3} – x_3^2}}{{ – \sin {x_3} – 2{x_3}}} }={ 0.824132 }-{ \frac{{\cos \left( {0.824132} \right) – {{0.824132}^2}}}{{ – \sin \left( {0.824132} \right) – 2 \cdot 0.824132}} }={ 0.824132}\]

    The \(4\)th iteration preserves the first \(6\) decimal places. This means that the required accuracy of \(5\) decimal places was reached at the \(3\)rd step, so the answer is

    \[{x_3} = 0.82413\]

    Example 9.

    Find an approximate solution, accurate to 4 decimal places, to the equation \(\sin \left( {{e^x}} \right) = 1\) on the interval \(\left[ {0,\pi } \right].\)

    Solution.

    We apply Newton’s method with the initial guess \({x_0} = 0.5\)

    Consider the function

    \[f\left( x \right) = \sin \left( {{e^x}} \right) – 1.\]

    The derivative is written as

    \[f^\prime\left( x \right) = {e^x}\cos \left( {{e^x}} \right).\]

    Then the first approximation is given by

    \[{{x_1} = {x_0} – \frac{{f\left( {{x_0}} \right)}}{{f^\prime\left( {{x_0}} \right)}}} ={ 0.5 – \frac{{\sin \left( {{e^{0.5}}} \right) – 1}}{{{e^{0.5}}\cos \left( {{e^{0.5}}} \right)}} }={ 0.4764}\]

    Continue the iteration process until we get an accuracy of \(3\) decimal places.

    \[{{x_2} = {x_1} – \frac{{f\left( {{x_1}} \right)}}{{f^\prime\left( {{x_1}} \right)}}} ={ 0.4764 – \frac{{\sin \left( {{e^{0.4764}}} \right) – 1}}{{{e^{0.4764}}\cos \left( {{e^{0.4764}}} \right)}} }={ 0.4641}\]

    \[{x_3} = 0.4579\]

    \[{x_4} = 0.4548\]

    \[{x_5} = 0.4532\]

    \[{x_6} = 0.4524\]

    \[{x_7} = 0.4520\]

    \[{x_8} = 0.4518\]

    \[{x_9} = 0.4517\]

    \[{x_{10}} = 0.4516\]

    \[{x_{11}} = 0.4516\]

    As you can see, the process converges slowly enough, so it took \(10\) steps to obtain a stable result to \(4\) decimal places.

    The answer is \(x \approx 0.4516\)

    Example 10.

    Given the equation \({x^4} – x – 1 = 0.\) It is known that this equation has a root in the interval \(\left( {1,2} \right).\) Find an approximate value of the root with an accuracy of 4 decimal places.

    Solution.

    Take the derivative:

    \[{f^\prime\left( x \right) = \left( {{x^4} – x – 1} \right)^\prime }={ 4{x^3} – 1.}\]

    Notice that \(f\left( 1 \right) = – 1,\) \(f\left( 2 \right) = 13,\) so we choose \({x_0} = 1\) as the initial guess.

    Using the recurrent relation

    \[{x_{n + 1}} = {x_n} – \frac{{f\left( {{x_n}} \right)}}{{f^\prime\left( {{x_n}} \right)}},\]

    we compute several successive approximations:

    \[{{x_1} = {x_0} – \frac{{f\left( {{x_0}} \right)}}{{f^\prime\left( {{x_0}} \right)}} }={ 1 – \frac{{{1^4} – 1 – 1}}{{4 \cdot {1^3} – 1}} }={ 1.3333}\]

    \[{{x_2} = {x_1} – \frac{{f\left( {{x_1}} \right)}}{{f^\prime\left( {{x_1}} \right)}} }={ 1.3333 – \frac{{{{1.3333}^4} – 1.3333 – 1}}{{4 \cdot {{1.3333}^3} – 1}} }={ 1.2358}\]

    \[{{x_3} = {x_2} – \frac{{f\left( {{x_2}} \right)}}{{f^\prime\left( {{x_2}} \right)}} }={ 1.2358 – \frac{{{{1.2358}^4} – 1.2358 – 1}}{{4 \cdot {{1.2358}^3} – 1}} }={ 1.2211}\]

    \[{{x_4} = {x_3} – \frac{{f\left( {{x_3}} \right)}}{{f^\prime\left( {{x_3}} \right)}} }={ 1.2211 – \frac{{{{1.2211}^4} – 1.2211 – 1}}{{4 \cdot {{1.2211}^3} – 1}} }={ 1.2207}\]

    \[{{x_5} = {x_4} – \frac{{f\left( {{x_4}} \right)}}{{f^\prime\left( {{x_4}} \right)}} }={ 1.2207 – \frac{{{{1.2207}^4} – 1.2207 – 1}}{{4 \cdot {{1.2207}^3} – 1}} }={ 1.2207}\]

    You can see that we’ve got the solution accurate up to \(4\) decimal places in the \(4\)th step. Therefore, we can write the answer as \({x_4} = 1.2207\)