# Solving equation for higher degree of composition

Given this function $$f(x) = x - 1/x$$, the equation $$f(f(x)) = x$$ has two solutions: $$\frac{1}{\sqrt{2}}$$, $$\frac{-1}{\sqrt{2}}$$. But how about solving this equation for a higher degree of composition, for example $$f(f(....(f(x)))) = x$$ (15 times), what is the mathematical tool needed in order to solve this equation and run it on a code efficiently without getting errors?

New contributor
meh98 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

## 1 Answer

To solve $$f_n(x)=x$$ (where $$f_n$$ is the $$n$$-fold composition of $$f$$), write $$f_n(x)-x$$ as a rational function, take the numerator (which is a polynomial, I think of degree $$2^n-2$$), and find its roots. Finding the roots of a polynomial (or approximations thereof) is a well-established problem, and computer algebra systems such as Maple have tools to do this. If using numerical methods, very high precision arithmetic is likely to be necessary to find the roots of a polynomial of high degree with some very large coefficients): in the case $$n=15$$, the largest coefficient is approximately $$1.42 \times 10^{6158}$$. Exact rational arithmetic might be tried, though that will also involve very large numbers. For example, using bisection I can confirm that in the case $$n=15$$ there is a root between $$329737/65536$$ and $$659475/131072$$.

• and what about python ? – meh98 22 hours ago