lvignals
(LV VS)
1
Mathematica does not simplify Sqrt[x^2] in expressions. Even if attempting:
Simplify[Sqrt[x^2]]
or
FullSimplify[Sqrt[x^2]]
The result remains: Sqrt[x^2] instead of just x.
Am I missing something?
Do I need to specify a condition like x belongs to R for it to work?
sghuisman
(Sander Huisman)
2
Am I missing something? Do I need to specify a condition like x belongs to R for it to work?
Indeed. By default all variables are assumed Complex unless told otherwiseÂ…
FullSimplify[Sqrt[x^2], x \[Element] Reals]
This is how you specify that the variable is real. Note that the result gives back:
Abs[x]
rather than x, because the square root does not return negative values. Only if one assumed positive numbers then it returns x:
FullSimplify[Sqrt[x^2], x \[Element] Reals \[And] x > 0]
gives back:
x
hansmilton
(Hans Milton)
3
PowerExpand could be used:
In[2]:= Sqrt[x^2]//PowerExpand
Out[2]= x
danl
(Daniel Lichtblau)
4
Check the documentation for Sqrt, second example under Possible Issues.
Check the documentation for Simplify, third example under Basic Examples.