<s>[INST] Simplifying the sum of terms that are "polynomial fractions" I need to simplify:
$$\left(\frac{z^2-2}{1+2z}\right)^2 \;+ \;\left(\frac{z^2-2}{1+2z}\right)$$
I get $2z^4-8z^2+8$ in the numerator when I know it should be $((z^2-2) (z^2+2 z-1))$.
 [/INST] $$\left(\frac{z^2-2}{1+2z}\right)^2-\left(\frac{z^2-2}{1+2z}\right)=\frac{(z^2-2)^2+(z^2-2)(1+2z)}{(1+2z)^2}$$
$$=\frac{(z^2-2)(z^2-2+1+2z)}{(1+2z)^2}$$ (taking $z^2-2$ common in the numerator)
So,$$\left(\frac{z^2-2}{1+2z}\right)^2-\left(\frac{z^2-2}{1+2z}\right)=\frac{(z^2-2)(z^2+2z-1)}{(1+2z)^2}$$
More generally, $\frac{a^2}{b^2}-\frac ab=\frac{a^2-ab}{b^2}=\frac{a(a-b)}{b^2}$
</s>