Calculus – Fixed-Point Iteration for x=tan(x)

calculusnumerical methods

I've been trying to find an accurate $g(x)$ in order to find a solution for $x=\tan(x)$ in the interval $[4,5]$. However, no matter what, all of them end up converging to zero which is not the answer. So far, I've tried:

$$g(x)=\tan(x)$$
$$g(x)=\tan^{-1}(x)$$
$$g(x)=\sin^{-1}(x\cos(x))$$
$$g(x)=\sqrt{x\tan(x)}$$

I thought maybe I was having trouble with the interval since I was working with angles, but even if I just use $[\pi/45,\pi/36]$, the functions still converge to 0. Can anybody help me out? I need to solve this problem using fixed-point iteration.

Best Answer

The $\arctan$ function is more nicely behaved than $\tan$. Let $$g(x)=\arctan x+\pi.$$ Be sure your calculator is in radian mode, and start with $x_0$ not too far from $4.5$. Use the iteration $x_{n+1}=g(x_n)$. Convergence should be acceptably quick.

Added: The reason we get nice behaviour with our choice of $g(x)$ is that near the root, the derivative of $\arctan x$ has rather small absolute value. By way of contrast, the derivative of $\tan x$ near the root is much larger than $1$. That means that with the choice $g(x)=\tan x$, the root is a repelling fixed point.

Related Question