Calculus3Analyzing Functions6 of 6
Analyzing Functions · 6

Newton's Method

1

Finding 2\sqrt2 with tangent lines

Some equations, like cos⁡x=x\cos x = x, can't be solved with algebra, so we approximate the solution instead. Newton's method finds where a function equals 00 by following tangent lines to the x-axis. Let's start with 2\sqrt2. Since 12=11^2 = 1 and 22=42^2 = 4, it's between 11 and 22, and we can check any guess just by squaring it.

Finding 2\sqrt2 means finding the positive solution to x2−2=0\fn{x^2 - 2} = 0, which is the x-intercept of the curve y=x2−2\fn{y = x^2 - 2}. Finding where a curve crosses the x-axis can be hard, but to find where a line crosses, we only have to solve one linear equation. Near a guess x0\gss{x_0}, the curve is close to its tangent line, so we find where the tangent line crosses the x-axis and take that as our next guess.

At x0=2\gss{x_0 = 2}, the tangent line, the vertical segment down to the x-axis, and the x-axis form a right triangle. Since slope is rise over run, the run along the bottom is the height divided by the slope.

xx
y=x2−2\htmlClass{lc-violet}{y=x^2-2}
(2, 2)(2,\,2)
y=2+4(x−2)y=\htmlClass{lc-pink}{2}+\htmlClass{lc-blue}{4}(x-\htmlClass{lc-orange}{2})
x0=2\htmlClass{lc-orange}{x_0=2}
2\htmlClass{lc-pink}{2}
4\htmlClass{lc-blue}{4}
12\htmlClass{lc-green}{\dfrac12}
x1=1.5\htmlClass{lc-orange}{x_1=1.5}
Approximate 2\sqrt2 with Newton's method
11
22
xx
y=x2−2\htmlClass{lc-violet}{y=x^2-2}
2= ?\sqrt2=\,?
Text solution
From x0=2\gss{x_0 = 2}The height is f(2)=2\hgt{f(2) = 2} and the slope is f′(2)=4\slp{f'(2) = 4}, so the run is 12\run{\frac12}. Squaring the new guess gives 1.52=2.251.5^2 = 2.25, off by 0.250.25 instead of 22.
x1\displaystyle \gss{x_1} =2−24\displaystyle = \gss{2} - \run{\frac{\hgt{2}}{\slp{4}}} =1.5\displaystyle = 1.5
The same triangle from x1=1.5\gss{x_1 = 1.5}Now the height is f(1.5)=0.25\hgt{f(1.5) = 0.25} and the slope is f′(1.5)=3\slp{f'(1.5) = 3}.
x2\displaystyle \gss{x_2} =1.5−0.253\displaystyle = \gss{1.5} - \run{\frac{\hgt{0.25}}{\slp{3}}} =1712≈1.4167\displaystyle = \frac{17}{12} \approx 1.4167
(1712)2≈2.0069\displaystyle \Big(\frac{17}{12}\Big)^2 \approx 2.0069

One more step gives x3≈1.414216\gss{x_3} \approx 1.414216, whose square is about 2.0000062.000006. Nothing in these steps depended on x2−2x^2 - 2. For any function f\fn{f}, as long as the slope f′(x0)\slp{f'(x_0)} isn't 00, the run is f(x0)f′(x0)\run{\frac{\hgt{f(x_0)}}{\slp{f'(x_0)}}}, and subtracting it from x0\gss{x_0} gives x1\gss{x_1}. Repeating this from each guess xn\gss{x_n} gives the next guess, xn+1\gss{x_{n+1}}.

x1\displaystyle \gss{x_1} =x0−f(x0)f′(x0)\displaystyle = \gss{x_0} - \run{\frac{\hgt{f(x_0)}}{\slp{f'(x_0)}}}
x2\displaystyle \gss{x_2} =x1−f(x1)f′(x1)\displaystyle = \gss{x_1} - \run{\frac{\hgt{f(x_1)}}{\slp{f'(x_1)}}}
Newton's methodxn+1=xn−f(xn)f′(xn)\displaystyle \gss{x_{n+1}} = \gss{x_n} - \run{\frac{\hgt{f(x_n)}}{\slp{f'(x_n)}}}

For f(x)=x2−2\fn{f(x) = x^2 - 2}, the derivative is f′(x)=2x\slp{f'(x) = 2x}, so we can write the formula in terms of xn\gss{x_n} before plugging in any numbers.

xn+1\displaystyle \gss{x_{n+1}} =xn−xn2−22xn\displaystyle = \gss{x_n} - \run{\frac{\hgt{x_n^2 - 2}}{\slp{2x_n}}}

How much does another tangent step improve the guess?

2

Solving equations with Newton's method

When we found 2\sqrt2, we had the function f(x)=x2−2\fn{f(x) = x^2 - 2} and a starting guess x0=2\gss{x_0 = 2}. To find 103\sqrt[3]{10}, or to solve cos⁡x=x\cos x = x, we have to set up both ourselves. Newton's method finds where a function equals 00, so first we move every term to one side.

2:x2=2  →  x2−2=0\displaystyle \sqrt2: \quad {x^2 = 2} \;\to\; {\fn{x^2 - 2} = 0}
103:x3=10  →  x3−10=0\displaystyle \sqrt[3]{10}: \quad {x^3 = 10} \;\to\; {\fn{x^3 - 10} = 0}
cos⁡x=x  →  cos⁡x−x=0\displaystyle {\cos x = x} \;\to\; {\fn{\cos x - x} = 0}

The two curves y=cos⁡xy = \cos x and y=xy = x intersect at the exact same x-value where y=cos⁡x−x\fn{y = \cos x - x} crosses the x-axis.

0.50.5
11
1.51.5
xx
11
yy
y=cos⁡xy=\cos x
y=xy=x
x≈0.74x\approx 0.74
xx
−1-1
y=cos⁡x−x\htmlClass{lc-violet}{y=\cos x-x}
(0, 1)\htmlClass{lc-pink}{(0,\,1)}
(1, −0.46)\htmlClass{lc-pink}{(1,\,-0.46)}

From here it's the same formula. What's new is choosing where to start, and knowing when the digits we've found are right.

Solve cos⁡x=x\cos x = x to six decimal places
00
11
xx
y=cos⁡xy=\cos x
y=xy=x
x= ?x=\,?
Text solution
Start where f\fn{f} changes signf\fn{f} is positive at 00 and negative at 11 (in radians, cos⁡1≈0.5403\cos 1 \approx 0.5403), so by the Intermediate Value Theorem there's a zero between them. We start at x0=1\gss{x_0 = 1}.
f(0)=1>0\displaystyle \hgt{f(0) = 1} > 0
f(1)≈−0.46<0\displaystyle \hgt{f(1) \approx -0.46} < 0
Write the formula, then step from 1\gss{1}With f′(x)=−sin⁡x−1\slp{f'(x) = -\sin x - 1}, both f(1)\hgt{f(1)} and f′(1)\slp{f'(1)} are negative, so their quotient is positive and x1\gss{x_1} lands left of 1\gss{1}. The signs set the direction for us.
xn+1\displaystyle \gss{x_{n+1}} =xn−cos⁡xn−xn−sin⁡xn−1\displaystyle = \gss{x_n} - \run{\frac{\hgt{\cos x_n - x_n}}{\slp{-\sin x_n - 1}}}
x1≈1−−0.4597−1.8415≈0.750364\displaystyle \gss{x_1} \approx \gss{1} - \run{\frac{\hgt{-0.4597}}{\slp{-1.8415}}} \approx 0.750364
Stop when two guesses agreex2\gss{x_2} differs from x1\gss{x_1} in the second decimal place, so we keep going. x3\gss{x_3} and x4\gss{x_4} agree to all six, so x≈0.739085x \approx 0.739085.
x2≈0.739113\displaystyle \gss{x_2} \approx 0.739113
x3≈0.739085\displaystyle \gss{x_3} \approx 0.739085
x4≈0.739085\displaystyle \gss{x_4} \approx 0.739085
3

When Newton's method fails

We take the tangent line's x-intercept as our next guess because near our guess, the curve is close to its tangent line. But does every starting guess work? If the slope at x0\gss{x_0} is 00 or close to 00, or if x0\gss{x_0} is far from the root, the x-intercept can land far from the root, or not exist at all.

For example, take f(x)=x2−2\fn{f(x) = x^2 - 2} and start at x0=0\gss{x_0 = 0}, where the slope is 0\slp{0}. The tangent line is horizontal, y=−2\slp{y = -2}, and it never crosses the x-axis.

−2-\sqrt2
2\sqrt2
xx
yy
y=x2−2\htmlClass{lc-violet}{y=x^2-2}
x0=0\htmlClass{lc-orange}{x_0=0}
−2\htmlClass{lc-pink}{-2}
y=−2\htmlClass{lc-blue}{y=-2}

A slope that's only close to 00 causes trouble too, and the guesses can even go round in a loop.

Why Newton's method can fail to find a root
xx
y=x2−2\htmlClass{lc-violet}{y=x^2-2}
2\sqrt2
x0\htmlClass{lc-orange}{x_0}
x1\htmlClass{lc-orange}{x_1}
Text solution
A slope of 0\slp{0}: no next guessFor x2−2\fn{x^2 - 2} at x0=0\gss{x_0 = 0}, the formula divides by zero, so x1\gss{x_1} is undefined.
x1\displaystyle \gss{x_1} =0−−20\displaystyle = \gss{0} - \run{\frac{\hgt{-2}}{\slp{0}}}
A slope near 0\slp{0}: a long runf(x)=x3−x\fn{f(x) = x^3 - x} has zeros −1-1, 00 and 11. From x0=0.5\gss{x_0 = 0.5}, halfway between 00 and 11, the slope is only −0.25\slp{-0.25}, and the run of 1.5\run{1.5} lands on the third root.
x1\displaystyle \gss{x_1} =0.5−−0.375−0.25\displaystyle = \gss{0.5} - \run{\frac{\hgt{-0.375}}{\slp{-0.25}}} =0.5−1.5\displaystyle = \gss{0.5} - \run{1.5} =−1\displaystyle = -1
Guesses in a loopFor f(x)=x3−2x+2\fn{f(x) = x^3 - 2x + 2}, with f′(x)=3x2−2\slp{f'(x) = 3x^2 - 2}, the tangent at 0\gss{0} lands on 1\gss{1}, and the tangent at 1\gss{1} lands back on 0\gss{0}. The guesses never reach the root near −1.77-1.77.
x1\displaystyle \gss{x_1} =0−2−2\displaystyle = \gss{0} - \run{\frac{\hgt{2}}{\slp{-2}}} =1\displaystyle = \gss{1}
x2\displaystyle \gss{x_2} =1−11\displaystyle = \gss{1} - \run{\frac{\hgt{1}}{\slp{1}}} =0\displaystyle = \gss{0}

Summary

The formula from a tangent line
xx
y=f(x)\htmlClass{lc-violet}{y=f(x)}
xn\htmlClass{lc-orange}{x_n}
f(xn)\htmlClass{lc-pink}{f(x_n)}
f′(xn)\htmlClass{lc-blue}{f'(x_n)}
f(xn)f′(xn)\htmlClass{lc-green}{\dfrac{\htmlClass{lc-pink}{f(x_n)}}{\htmlClass{lc-blue}{f'(x_n)}}}
xn+1\htmlClass{lc-orange}{x_{n+1}}
Newton's method
xn+1\displaystyle \gss{x_{n+1}} =xn−f(xn)f′(xn)\displaystyle = \gss{x_n} - \run{\frac{\hgt{f(x_n)}}{\slp{f'(x_n)}}}

Each new guess is the x-intercept of the tangent line at the current guess. The height of the triangle is f(xn)\hgt{f(x_n)} and the slope is f′(xn)\slp{f'(x_n)}. Because slope is rise over run, the run along the x-axis is height divided by slope, f(xn)f′(xn)\run{\frac{\hgt{f(x_n)}}{\slp{f'(x_n)}}}. Subtracting that run from xn\gss{x_n} gives xn+1\gss{x_{n+1}}, and the signs of f(xn)\hgt{f(x_n)} and f′(xn)\slp{f'(x_n)} handle the direction automatically.

Setting up f(x)=0f(x) = 0
A square root
2:x2−2=0\displaystyle \sqrt2: \quad {\fn{x^2 - 2} = 0}
A cube root
103:x3−10=0\displaystyle \sqrt[3]{10}: \quad {\fn{x^3 - 10} = 0}
An equation
cos⁡x=x:cos⁡x−x=0\displaystyle {\cos x = x}: \quad {\fn{\cos x - x} = 0}

Newton's method finds where a function equals 00. Move every term to one side first so the equation has the form f(x)=0\fn{f(x)} = 0, then find f′(x)\slp{f'(x)} and write the formula before plugging in numbers.

Picking x0x_0 and stopping
Where the sign changes
f(0)=1>0,f(1)≈−0.46<0→  x0=1\displaystyle \begin{aligned} &\hgt{f(0) = 1} > 0, \\[5pt] &\hgt{f(1) \approx -0.46} < 0 \\[5pt] &\to\; \gss{x_0 = 1} \end{aligned}
Stopping rule
x3≈0.739085,x4≈0.739085→  x≈0.739085\displaystyle \begin{aligned} &\gss{x_3} \approx 0.739085, \\[5pt] &\gss{x_4} \approx 0.739085 \\[5pt] &\to\; x \approx 0.739085 \end{aligned}

To find a starting guess x0\gss{x_0}, evaluate f(x)\fn{f(x)} at simple numbers to look for a sign change. If f\fn{f} is continuous, a sign change means there is a root between those values. You can also use a sketch to see roughly where the root is. To get an answer correct to nn decimal places, keep computing guesses until two guesses in a row agree to nn decimal places. If a problem asks for a specific guess like x2\gss{x_2}, stop there.

When Newton's method fails

Newton's method can fail if the tangent line is used too far from the root. If f′(x0)=0\slp{f'(x_0) = 0}, the tangent line is horizontal, and the formula divides by 00. If the slope is close to 00, dividing by that small slope can give a long run that sends the next guess far from the root or toward a different root. The guesses can also alternate in a loop, like 0,1,0,1,…\gss{0, 1, 0, 1, \dots}, and never approach the root. In all three cases, pick a new starting guess closer to the root, where the derivative isn't near 00.

4

Practice

Round decimal answers to four decimal places unless the problem asks for an exact value.

1
Use Newton's method with x0=2x_0 = 2 to approximate a zero of f(x)=x3−2x−5f(x) = x^3 - 2x - 5. Find x2x_2, rounded to four decimal places.

To find the next guess, we need the height and the slope at 22. What are f(2)f(2) and f′(2)f'(2)?

If you got 1.68021.6802 Check the sign in the formula. Subtracting f(2)f′(2)\frac{f(2)}{f'(2)} adds 0.10.1, so x1x_1 should be greater than 22.

If you got 2.12.1 That's x1x_1. The problem asks for x2x_2, so take one more step.

First find the derivative of f(x)=x3−2x−5\fn{f(x) = x^3 - 2x - 5}.
f′(x)=3x2−2\displaystyle \slp{f'(x) = 3x^2 - 2}
Plug x0=2\gss{x_0 = 2} into f\fn{f} and f′\slp{f'} to find x1\gss{x_1}.
f(2)=−1,f′(2)=10,x1\displaystyle \hgt{f(2) = -1}, \quad \slp{f'(2) = 10}, \qquad \gss{x_1} =2−−110\displaystyle = \gss{2} - \run{\frac{\hgt{-1}}{\slp{10}}} =2.1\displaystyle = 2.1
Now plug 2.1\gss{2.1} into f\fn{f} and f′\slp{f'} to find x2\gss{x_2}.
f(2.1)=0.061,f′(2.1)=11.23,x2\displaystyle \hgt{f(2.1) = 0.061}, \quad \slp{f'(2.1) = 11.23}, \qquad \gss{x_2} =2.1−0.06111.23≈2.0946\displaystyle = \gss{2.1} - \run{\frac{\hgt{0.061}}{\slp{11.23}}} \approx 2.0946
2
The line y=5−2(x−1)y = 5 - 2(x - 1) is tangent to the graph of y=f(x)y = f(x) at x=1x = 1. Use Newton's method to approximate a zero of ff, starting with x0=1x_0 = 1. Find x1x_1.

The tangent line at x=1x = 1 is y=f(1)+f′(1)(x−1)y = f(1) + f'(1)(x - 1). What are f(1)f(1) and f′(1)f'(1)?

If you got −1.5-1.5 Check the slope of the tangent line. In 5−2(x−1)5 - 2(x - 1), the minus sign belongs to the 22, so f′(1)=−2f'(1) = -2.

Match the given line with the tangent line formula y=f(1)+f′(1)(x−1)y = \hgt{f(1)} + \slp{f'(1)}(x - \gss{1}) to find f(1)\hgt{f(1)} and f′(1)\slp{f'(1)}.
y\displaystyle y =f(1)+f′(1)(x−1)\displaystyle = \hgt{f(1)} + \slp{f'(1)}(x - \gss{1}) =5−2(x−1)  →  f(1)=5,f′(1)=−2\displaystyle = \hgt{5} - \slp{2}(x - \gss{1}) \;\to\; \hgt{f(1) = 5}, \quad \slp{f'(1) = -2}
Plug f(1)=5\hgt{f(1) = 5} and f′(1)=−2\slp{f'(1) = -2} into the Newton step.
x1\displaystyle \gss{x_1} =1−5−2\displaystyle = \gss{1} - \run{\frac{\hgt{5}}{\slp{-2}}} =1+2.5\displaystyle = \gss{1} + \run{2.5} =3.5\displaystyle = 3.5
Or just set y=0y = 0 in the tangent line equation, because x1\gss{x_1} is its x-intercept.
5−2(x−1)\displaystyle \hgt{5} - \slp{2}(x - \gss{1}) =0  →  x\displaystyle = 0 \;\to\; x =3.5\displaystyle = 3.5
3
Use Newton's method to find the positive xx-value where the curves y=x2y = x^2 and y=cos⁡xy = \cos x intersect, correct to four decimal places.

The curves intersect where x2=cos⁡xx^2 = \cos x. Move everything to one side to get f(x)=0f(x) = 0.

Check the sign of f(x)f(x) at 00 and 11 to find a starting guess x0x_0.

If you got 0.82420.8242 Keep going until two successive guesses agree to four decimal places. Check x3x_3.

If you got 0.99990.9999 Make sure your calculator is in radians, not degrees.

Set up the functionWhere the curves intersect, x2=cos⁡xx^2 = \cos x, so we move everything to one side to get f(x)=0\fn{f(x)} = 0.
x2=cos⁡x  →  f(x)=x2−cos⁡x,f′(x)=2x+sin⁡x\displaystyle {x^2 = \cos x} \;\to\; \fn{f(x) = x^2 - \cos x}, \qquad \slp{f'(x) = 2x + \sin x}
Choose the starting guessf(0)\hgt{f(0)} is negative and f(1)\hgt{f(1)} is positive, so the curves intersect between 00 and 11. Let's start at x0=1\gss{x_0 = 1}.
f(0)=−1<0,f(1)=1−cos⁡1≈0.46>0,x0=1\displaystyle \hgt{f(0) = -1} < 0, \qquad \hgt{f(1) = 1 - \cos 1 \approx 0.46} > 0, \qquad \gss{x_0 = 1}
Apply the Newton step until two guesses in a row agree to four decimal places.
xn+1\displaystyle \gss{x_{n+1}} =xn−xn2−cos⁡xn2xn+sin⁡xn\displaystyle = \gss{x_n} - \run{\frac{\hgt{x_n^2 - \cos x_n}}{\slp{2x_n + \sin x_n}}}
x1≈0.838218,x2≈0.824242,x3≈0.824132,x4≈0.824132\displaystyle \gss{x_1} \approx 0.838218, \quad \gss{x_2} \approx 0.824242, \quad \gss{x_3} \approx 0.824132, \quad \gss{x_4} \approx 0.824132
Apply the stopping rulex2\gss{x_2} and x3\gss{x_3} differ in the fourth decimal place, but x3\gss{x_3} and x4\gss{x_4} both round to 0.82410.8241.
x2≈0.8242,x3≈0.8241,x4≈0.8241  →  x≈0.8241\displaystyle \gss{x_2} \approx 0.8242, \quad \gss{x_3} \approx 0.8241, \quad \gss{x_4} \approx 0.8241 \;\to\; x \approx 0.8241
4
The equation x3−3x+1=0x^3 - 3x + 1 = 0 has a solution between 11 and 22. (a) Explain why Newton's method can't start at x0=1x_0 = 1. (b) Starting at x0=1.5x_0 = 1.5, find x1x_1, rounded to four decimal places.
(a) why the step fails\text{(a) why the step fails}

What is the slope of the tangent line at x=1x = 1? Find f′(1)f'(1).

If you got 1.46671.4667 Check the sign of f(1.5)f(1.5). Subtracting a negative fraction makes the next guess larger than 1.51.5.

Why x0=1x_0 = 1 failsAt x=1x = \gss{1}, the derivative is 0\slp{0}, so the tangent line is horizontal and never crosses the x-axis. The formula would divide by zero.
f′(x)=3x2−3,f′(1)=0,x1\displaystyle \slp{f'(x) = 3x^2 - 3}, \qquad \slp{f'(1) = 0}, \qquad \gss{x_1} =1−f(1)0\displaystyle = \gss{1} - \run{\frac{\hgt{f(1)}}{\slp{0}}}
Find x1x_1 from x0=1.5x_0 = 1.5At x0=1.5\gss{x_0 = 1.5}, the derivative isn't zero, so we can take the step.
f(1.5)=−0.125,f′(1.5)=3.75,x1\displaystyle \hgt{f(1.5) = -0.125}, \quad \slp{f'(1.5) = 3.75}, \qquad \gss{x_1} =1.5−−0.1253.75\displaystyle = \gss{1.5} - \run{\frac{\hgt{-0.125}}{\slp{3.75}}} =2315≈1.5333\displaystyle = \frac{23}{15} \approx 1.5333
5
Let f(x)=x3f(x) = \sqrt[3]{x} and x0=1x_0 = 1. Find x1x_1, x2x_2 and x3x_3 from Newton's method, and explain why the guesses never reach the zero at x=0x = 0 for any starting value x0≠0x_0 \neq 0.

Simplify the fraction f(x)f′(x)\frac{f(x)}{f'(x)} before plugging in any numbers.

If you got x1=23x_1 = \tfrac23 In Newton's method we divide by f′(xn)f'(x_n), rather than multiplying by it.

Simplify the fractionDifferentiate f(x)=x1/3\fn{f(x) = x^{1/3}} and simplify f(x)f′(x)\run{\frac{\hgt{f(x)}}{\slp{f'(x)}}} before computing the guesses.
f′(x)=13x−23,f(x)f′(x)\displaystyle \slp{f'(x) = \frac13 x^{-\frac23}}, \qquad \run{\frac{\hgt{f(x)}}{\slp{f'(x)}}} =x1313x−23\displaystyle = \run{\frac{\hgt{x^{\frac13}}}{\slp{\frac13 x^{-\frac23}}}} =3x\displaystyle = \run{3x}
Each step multiplies the previous guess by −2-2.
xn+1\displaystyle \gss{x_{n+1}} =xn−3xn\displaystyle = \gss{x_n} - \run{3x_n} =−2xn\displaystyle = -2\gss{x_n}
x1\displaystyle \gss{x_1} =−2,x2\displaystyle = -2, \qquad \gss{x_2} =4,x3\displaystyle = 4, \qquad \gss{x_3} =−8\displaystyle = -8
Why the guesses never reach 00Each step doubles the distance from 00 and changes sign, so starting from any x0≠0\gss{x_0} \neq 0, the guesses move further away from 00 and never reach it.
∣xn+1∣\displaystyle |\gss{x_{n+1}}| =2∣xn∣\displaystyle = 2|\gss{x_n}|
6
Find the absolute maximum value of f(x)=xcos⁡xf(x) = x\cos x on [0,π][0, \pi], correct to four decimal places. (Challenge)

The absolute maximum occurs at an endpoint or where f′(x)=0f'(x) = 0. Which function do we apply Newton's method to?

Newton's method on f′(x)=0f'(x) = 0 uses f′′(x)f''(x) in the denominator. What is f′′(x)f''(x)?

If you got 0.86030.8603 0.86030.8603 is the x-value where the maximum occurs. Plug it back into f(x)f(x) to find the maximum value.

If you got 1.57081.5708 That's where xcos⁡x=0x\cos x = 0, not where the function has its maximum. Apply Newton's method to f′f', not ff.

Find the critical pointsThe maximum occurs at an endpoint or where the derivative is zero, so use the product rule to find f′(x)\fn{f'(x)}.
f′(x)=cos⁡x−xsin⁡x,f′(x)\displaystyle \fn{f'(x) = \cos x - x\sin x}, \qquad \fn{f'(x)} =0  ?\displaystyle = 0 \;?
Set up Newton's method on f′f'We can't solve f′(x)=0\fn{f'(x)} = 0 with algebra, so we apply Newton's method to f′\fn{f'}, using its derivative f′′\slp{f''}.
f′′(x)=−2sin⁡x−xcos⁡x,xn+1\displaystyle \slp{f''(x) = -2\sin x - x\cos x}, \qquad \gss{x_{n+1}} =xn−cos⁡xn−xnsin⁡xn−2sin⁡xn−xncos⁡xn\displaystyle = \gss{x_n} - \run{\frac{\hgt{\cos x_n - x_n\sin x_n}}{\slp{-2\sin x_n - x_n\cos x_n}}}
f′\fn{f'} changes sign between 00 and 11, so start at x0=1\gss{x_0 = 1} and repeat the step until two guesses in a row agree to four decimal places.
f′(0)=1>0,f′(1)≈−0.30<0,x0=1\displaystyle \hgt{f'(0) = 1} > 0, \qquad \hgt{f'(1) \approx -0.30} < 0, \qquad \gss{x_0 = 1}
x1≈0.864536,x2≈0.860339,x3≈0.860334,x4≈0.860334  →  x≈0.8603\displaystyle \gss{x_1} \approx 0.864536, \quad \gss{x_2} \approx 0.860339, \quad \gss{x_3} \approx 0.860334, \quad \gss{x_4} \approx 0.860334 \;\to\; x \approx 0.8603
Compare the valuesPlug the critical point and the endpoints into f(x)f(x) to find the largest value.
f(0.8603)≈0.5611,f(0)\displaystyle f(0.8603) \approx 0.5611, \qquad f(0) =0,f(π)\displaystyle = 0, \qquad f(\pi) =−π  →  maximum≈0.5611\displaystyle = -\pi \;\to\; \text{maximum} \approx 0.5611