Ask Your Question

simplifying an expression

asked 2017-05-02 23:07:50 +0200

sage_user47 gravatar image


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.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-03 01:38:37 +0200

ndomes gravatar image

Knowing the outcome you can do:

var('b f k')
expr = 2*b*f^2 + f^2*k - 2*b*f- f^2 - 2*f*k + b+2*f+k - 1
(expr - b*f^2).factor() + b*f^2
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-05-02 23:07:50 +0200

Seen: 582 times

Last updated: May 03 '17