Hello,
I am trying to simplify a polynomial into smaller subexpressions. The expanded polynomial is:
\begin{align} \ 2bf^{2}+f^{2}k-2bf-f^{2}-2fk+b+2f+k-1 \end{align}
This expression can be reduced to the following expression [by hand]:
\begin{align} \ bf^{2}+(f - 1)^{2}(k-1+b) \end{align}
How to do I do it in Sage using some combination of collect and factor or by using some other strategy.
Thanks!