Hello I am solving the following problem:
Use a fixed-point iteration method to determine a solution accurate to within $10^{-4}$ for x=tanx, for x in [4. 5].
using g(x)=tanx and $p_0=4$ yields $p_1 = g(p_0)=1.158$ is not in the interval [4,5] so we need a different fixed-point function. hence,
$\frac{1}{x}=\frac{1}{tanx}$
which gives you
$g(x)=x+\frac{1}{x}=\frac{1}{tanx}$
and then we iterate for the first four terms.
this all makes sense except for the last step which says,
$g(x)=x+\frac{1}{x}=\frac{1}{tanx}$.
how did they come up with this?