Continuing with the example of the last sub-section, suppose weโd like to find all orbits of period 2 for \(f(x) = \frac{1}{5}x^2 - 2x + 6\text{.}\) I guess we should let \(F(x)=f^2(x)\) and then find all fixed points of \(F\) or, equivalently, find all roots of \(F(x)-x\text{.}\) We can automate this procedure like so:
Each root is returned as a (value,multiplicity) pair. Note that the 1.38 and 3.618 agree with our prior computation; those form the orbit of period 2. The other points are fixed points. Of course, those should be the points of intersection with the line \(y=x\text{.}\) We can illustrate that with Sage too:
Sometimes we might be interested in a somewhat higher interval, in which case it might make sense to use the computer to do the iteration for us. For example, hereโs how to find the fourth iterate of \(f(x)=x^2-2\text{:}\)