Solution: Draw the curves \(y=\tan x\) and \(y=4 x\). The roots of our equation are the \(x\)-coordinates of the places where these two curves meet.

A glance at the picture shows that (for \(x \geq 0\) ) the curves meet at \(x=0\), then at a point with \(x\) just shy of \(\pi / 2\), and then again at a point with \(x\) just shy of \(3 \pi / 2\) (the pattern continues).

We first find the root that is near \(\pi / 2\). Let \(f(x)=\tan x-4 x\). The \(f^{\prime}(x)=\sec ^{2} x-4\), and the Newton Method recurrence is

\[

x_{n+1}=x_{n}-\frac{\tan x_{n}-4 x_{n}}{\sec ^{2} x_{n}-4} .

\]

Some simplification is possible. For example, we can use the identity \(\sec ^{2} x=1+\tan ^{2} x\) to rewrite the recurrence as

\[

x_{n+1}=x_{n}-\frac{\tan x_{n}-4 x_{n}}{\tan ^{2} x_{n}-3} .

\]

This trick cuts down on the computational work. This was a particularly important consideration in the old days when computations were done by hand, with the aid of tables and slide rules.

For the first root, a bit of fooling around suggests taking \(x_{0}=1.4\). Then \(x_{1}=1.393536477, x_{2}=1.393249609\), and \(x_{3}=1.393249075\). This suggests that to 4 decimal places the root is \(1.3932\). We can verify this by the sign change criterion in the usual way.

For the second root, after some work we can for example arrive at the initial estimate \(x_{0}=4.66\). The computation is quite sensitive to the right choice of initial value. And then we get \(x_{1}=4.658806388\) and \(x_{2}=4.658778278\). To 4 decimal places the root is \(4.6588\). We can verify that we are close enough by the sign change criterion.

Note. We may be nervous about using a casual sketch to locate the first two positive roots. If we are, we can analyze the behaviour of \(f(x)\) by looking at its derivative \(f^{\prime}(x)\). Recall that \(f^{\prime}(x)=\sec ^{2} x-4\). The sec function increases steadily in the interval \((0, \pi / 2)\). It follows that \(f^{\prime}(x)\) is negative in this interval up to the point where \(f^{\prime}(x)=0\), which happens when \(\sec x=2\), that is, when \(\cos x=1 / 2\), at \(\pi / 3\). So \(f(x)\) decreases from \(x=0\) to \(x=\pi / 3\), then increases. Since \(f(0)=0\), we conclude that \(f\) is negative in the interval \((0, \pi / 3)\), then increases. It becomes very large positive near \(x=\pi / 2\). So \(f(x)=0\) in exactly one place in the interval \((0, \pi / 2)\). In a similar way, we can show that \(f(x)=0\) at exactly one place in the interval \((\pi / 2,3 \pi / 2)\).

Note. We attacked the problem in the 'natural' way, making the most obvious choice for \(f(x)\). It turns out that, particularly for the second positive root, and even more so say for the fifth positive root, we have to be very careful in our choice of \(x_{0}\). The problem is that near the roots the tan function is growing at a violent rate. A quite small change in \(x\) can have a dramatic effect on \(\tan x\).

We can rewrite the equation \(\tan x=4 x\) in ways that avoid most of the problems. For instance, rewrite it as \(g(x)=0\) where \(g(x)=\) \(\sin x-4 x \cos x\). The Newton-Raphson recurrence becomes

\[

x_{n+1}=x_{n}-\frac{\sin x_{n}-4 x_{n} \cos x_{n}}{4 x_{n} \sin x_{n}-3 \cos x_{n}} .

\]

Calculations with this recurrence are quite a bit more numerically stable than calculations with the 'natural' recurrence that we used earlier.