Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

When I try and simplify this expression:

In[1]:= FullSimplify[Sqrt[ x^2 + 2 y^2 + 2 y Sqrt[x^2 + y^2] ], (x | y) \[Element] Reals]
Out[1]= Sqrt[x^2 + 2 y (y + Sqrt[x^2 + y^2])]

it does not simplify properly.
However, Mathematica knows it equals a simpler expression:

In[2]:= FullSimplify[ Sqrt[x^2 + 2 y^2 + 2 y Sqrt[x^2 + y^2] ] == Sqrt[x^2 + y^2] + y, (x | y) \[Element] Reals]
Out[2]= True

Why doesn't Mathematica simplify this expression, and how can I make it do it anyway, even if the expression is part of a larger expression?

share|improve this question

4 Answers 4

up vote 2 down vote accepted

Possibly because the second simplification request is much easier than the first. Consider:

enter image description here

Also, the second FullSimplify can be done by Simplify. Not surprising since all MMA has to do is square both sides.

edit: Perhaps this will suggest an approach:

enter image description here

share|improve this answer
    
This is true, but why is the first simplification so hard that Mathematica doesn't find it? And is there a way to make it find it? –  Joe Oct 25 '12 at 6:55
    
@Joe Why is it so important to you that FullSimplify be able to carry out this simplification? Why can't you just apply your knowledge of the equality of the two expressions directly to whatever work you are doing? –  m_goldberg Oct 25 '12 at 13:06
1  
Since I am trying to simplify a very long expression that contains multiple versions of the expression I'm asking about, and I don't want to go through my long expression manually. –  Joe Oct 25 '12 at 16:17
    
Great idea! It can be a bit simplified by using just one replacement rule: x_^2 + 2 y_^2 + 2 y_ Sqrt[x_^2 + y_^2] -> (Sqrt[x^2 + y^2] + y)^2. –  Joe Oct 31 '12 at 18:48
x^2 + 2 y^2 + 2 y Sqrt[x^2 + y^2] == Expand[(Sqrt[a] + Sqrt[b])^2]
(*x^2 + 2 y^2 + 2 y Sqrt[x^2 + y^2] == a + 2 Sqrt[a] Sqrt[b] + b*)

Solve[{a + b == x^2 + 2 y^2, 2 Sqrt[a b] == 2 y Sqrt[x^2 + y^2]}, {a, b}, Reals]
Simplify[Sqrt[a] + Sqrt[b] /. %, Element[{x, y}, Reals]] // Union // Normal

(*
{{a -> ConditionalExpression[y^2, y > 0],  b -> ConditionalExpression[x^2 + y^2, y > 0]}, 
{a -> ConditionalExpression[x^2 + y^2, y > 0],  b -> ConditionalExpression[y^2, y > 0]}}

{y + Sqrt[x^2 + y^2]}
*)
share|improve this answer

You might do this:

Simplify[Sqrt[x^2 + 2 y^2 + 2 y Sqrt[x^2 + y^2]] /. x^2 -> u^2 - y^2, {u > 0, y > 0}] /. u -> Sqrt[x^2 + y^2]

The result is here: y + Sqrt[x^2 + y^2]

I required that bot u and y are positive. If the are not:

Simplify[Sqrt[x^2 + 2 y^2 + 2 y Sqrt[x^2 + y^2]] /.x^2 -> u^2 - y^2, {u < 0, y < 0}] /. u -> Sqrt[x^2 + y^2]

You get another result:

Abs[-y + Sqrt[x^2 + y^2]]

share|improve this answer

Change to polar coordinates, {x -> r Cos[t], y -> r Sin[t]}:

FullSimplify[ Sqrt[2 y Sqrt[x^2 + y^2] + x^2 + 2y^2] /. 
 {x -> r Cos[t], y -> r Sin[t]}, r > 0 && 0 < t< 2Pi]

r (Sin[t] + 1)

This should simplify your long expression ...

share|improve this answer
    
Nice! Then I just add /.{r -> Sqrt[x^2 + y^2], t -> ArcTan[x, y]} and simplify again and I have the simplified expression in my original variables. On the other hand, I have this expression appearing multiple times with different variables instead of x and y, and I'm not sure if your approach can be generalized to such a case. –  Joe Oct 31 '12 at 18:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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