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.

  • $\begingroup$ Maybe you should start with a point in $[4, 5]$, rather than in $[\pi/45, \pi/36]$? $\endgroup$ Sep 3 '14 at 5:49
  • $\begingroup$ Let $f(x)=\arctan x+\pi$. Try $x=f(x)$ with starting point say in the middle. $\endgroup$ Sep 3 '14 at 5:58

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.

  • $\begingroup$ Could you share the motivation for $+ \pi$ part? $\endgroup$ Oct 22 '20 at 5:53
X=tan X
1/X = 1/tan X ⇒ (1/x)-(1/tan X) =0
F(X)= 1/x- 1/tan X =0
From fixed point iteration
g(X) = 1/X - (1/tan X) -x
By 10-4precision
p1= g(4)=4.61369


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.