I need to simplify some lengthy $fog(x)$ where both $f(x)$ and $g(x)$ are known rational polynomial in one variable.
For e.g. $f(x) = (7x-9)/12$ and $g(x) = (2x-5)/7$. Then I would like to get a simplified rational expression of $f(f(g(f(g(g(f(x)))))))$.
I would like to do this in sympy
if possible. Looked through sympy
docs, but might have overlooked something related to such chained function simplification. If not possible in sympy
then any other free CAS is preferred. The function chain is quite lengthy, hence would like to use a CAS.
Thanks for the help.
In sagemath,
Does the job. It will be similar in mathematica.