Message Boards Message Boards

0
|
17202 Views
|
4 Replies
|
6 Total Likes
View groups...
Share
Share this post:

Mathematica does not simplify Sqrt[x^2] in expressions?

Posted 5 years ago

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?

POSTED BY: LV VS
4 Replies

Check the documentation for Simplify, third example under Basic Examples.

POSTED BY: Henrik Schachner

Check the documentation for Sqrt, second example under Possible Issues.

POSTED BY: Daniel Lichtblau
Posted 5 years ago

PowerExpand could be used:

In[2]:= Sqrt[x^2]//PowerExpand
Out[2]= x
POSTED BY: Hans Milton

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
POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract