0
$\begingroup$

I want to apply square root operation to an equation.

In[1]:= Equation := x^2 == 2 y;

In[2]:= Sqrt[Equation]

Here is the output:

[1]: https://i.stack.imgur.com/Tz97V

My goal is to simplify this expression, so as it would take Root of the left and right parts separately

How can I do that?

$\endgroup$
  • $\begingroup$ Please copy the code not the image. Have you tried something? $\endgroup$ – L.K. Apr 24 '17 at 16:20
  • $\begingroup$ The image represents the output, not the code itself. Yes. I tried using Simplify function, but with no result. $\endgroup$ – Elias Apr 24 '17 at 16:27
  • $\begingroup$ We need code to simplify the expression. You have to provide the code, so that we can work on that. $\endgroup$ – L.K. Apr 24 '17 at 16:31
  • $\begingroup$ I've updated the question. $\endgroup$ – Elias Apr 24 '17 at 16:40
  • $\begingroup$ You'd eventually be trying to take the square root of True or False, no? $\endgroup$ – MikeY Apr 24 '17 at 16:57
2
$\begingroup$

It's generally not a good idea to start your symbol names with an uppercase letter and you should look at the difference between SetDelayed, i.e. := and Set, i.e. =.

That said, one answer to your question is to use Map (/@ below) to apply Sqrt to both sides of your equation and add an assumption to Simplify to allow it to simplify Sqrt[x^2] to x which is what I assume you want.

eqn = x^2 == 2 y;
Simplify[Sqrt /@ eqn, x > 0]

x == Sqrt[2] Sqrt[y]

If you don't want this then Solve[eqn, x], gives an alternative form as stated by others.

| improve this answer | |
$\endgroup$
2
$\begingroup$

Thread[] is one of the classical ways to do this operation:

Thread[Sqrt[x^2 == 2 y], Equal]
   Sqrt[x^2] == Sqrt[2] Sqrt[y]
| improve this answer | |
$\endgroup$
1
$\begingroup$
Solve[x^2 == 2 y, {x}]
{{x -> -Sqrt[2] Sqrt[y]}, {x -> Sqrt[2] Sqrt[y]}}
| improve this answer | |
$\endgroup$
  • $\begingroup$ I must have been a time traveler. ;) I answered it 33 minutes ago and Mike answered it 22 minutes ago. $\endgroup$ – UnchartedWorks Apr 24 '17 at 17:33
  • $\begingroup$ Right, accept my apologies. :) $\endgroup$ – Kuba Apr 24 '17 at 17:35

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