3
$\begingroup$

I am trying to use Simplify to reduce the expression like $x_1^2+x_2^2\to x^2$. For example,

Simplify[x[1]^4 + 2 x[1]^2 x[2]^2 + x[2]^4, x[1]^2 + x[2]^2 == x^2]

I am expecting to get x^4 (simplicity count = 3), but I only obtain (x[1]^2 + x[2]^2)^2 (simplicity count = 11). Why doesn't Simplify further simplify the expression given the assumption? What is the right way to carry out the reduction in Mathematica?

$\endgroup$
1
  • 1
    $\begingroup$ A replacement rule works well here: Simplify[x[1]^4 + 2 x[1]^2 x[2]^2 + x[2]^4] /. x[1]^2 + x[2]^2 -> x^2 returns x^4. Still a good point about Simplify though. $\endgroup$
    – MarcoB
    Commented Nov 26, 2016 at 6:45

2 Answers 2

1
$\begingroup$

As noted under "Possible Issues" in the documentation for Simplify, "results of simplification may depend on the names of symbols":

Simplify[a^4 + 2 a^2 b^2 + b^4, a^2 + b^2 == c^2]
(* c^4 *)
$\endgroup$
-3
$\begingroup$

I think that you make a mistake on the way Simplify act. It can accept an assumption --- beeing real, integer, positive, not an equation --- the distinction is subtile.

Look at this

Simplify[Subscript[x, 1]^4 + 2 Subscript[x, 1]^2 Subscript[x, 2]^2 + Subscript[x, 2]^4 ] /. Subscript[x, 1]^2 + Subscript[x, 2]^2 -> x^2

It works

$\endgroup$
1
  • 4
    $\begingroup$ Try this: Simplify[x + y, x + y == z] $\endgroup$ Commented Nov 26, 2016 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.