# How to simplify Euclidean norm (like $x_1^2+x_2^2\to x^2$) in an expression given the assumption?

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?

• 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. Commented Nov 26, 2016 at 6:45

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 *)


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

• Try this: Simplify[x + y, x + y == z] Commented Nov 26, 2016 at 10:28