Simplify basic expression

160 Views Asked by At

Please, does anyone know which tool can simplify expressions like:

$$a^4 - 4a^3b + 6a^2b^2 - 4ab^3 - a + b^4$$

into:

$$(a - b)^4 - a$$

I tried SymPy, Maxima and W|A without success.

PS: I'm interested in simplifying expressions consisting of addition and subtraction of terms, where each term is a product of some symbols. Another example would be:

$$abc + de + f - ghh + ia - abde + ggg + aabb$$

2

There are 2 best solutions below

1
On

Not an answer, but an attempt to undestand your question and Maxima. I had to trick it into thinking that it has a sum of expressions (whithout division by c, it doesn't seem to work!) and that it can factor each term of the sum one by one.

(%i68) expr: (b^4-4*a*b^3+6*a^2*b^2-4*a^3*b+a^4)/c-a/c;

(%o68) (b^4-4*a*b^3+6*a^2*b^2-4*a^3*b+a^4)/c-a/c

(%i69) factor(expr);

(%o69) (b^4-4*a*b^3+6*a^2*b^2-4*a^3*b+a^4-a)/c

(%i70) map(factor, expr);

(%o70) (b-a)^4/c-a/c

2
On

Unless you can say very explicitly what kind of "simplification" you want, I don't think this is feasible. Given a particular polynomial there are all kinds of ways to group particular sets of terms together, including doing things like inserting pairs of cancelling terms. The word problem in groups, which is somehow spiritually similar to what you're asking about, is known to be an undecidable problem.

For details: http://en.wikipedia.org/wiki/Word_problem_for_groups