Ask Your Question

Revision history [back]

It sometimes helps to expand and factor:

sage: s
1/4*(2*D*Nb*Pmean - (D*H*alpha + D*H)*c)/((alpha + 1)*c)
sage: s.expand()
-1/4*D*H*alpha/(alpha + 1) - 1/4*D*H/(alpha + 1) + 1/2*D*Nb*Pmean/((alpha + 1)*c)
sage: _.factor()
-1/4*(H*alpha*c - 2*Nb*Pmean + H*c)*D/((alpha + 1)*c)
sage: _.partial_fraction()
1/4*(2*Nb*Pmean - (H*alpha + H)*c)*D/((alpha + 1)*c)