Message Boards Message Boards

1
|
1840 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

How to simplify Sqrt[z^2]

Posted 1 year ago

Hi, I need to simplify expressions of the type Sqrt[z^2] where z is a complex variable or expression. I do not understand why such expressions are left unsimplified in cases where some conditional expressions would be suitable. In particular:

FullSimplify[Sqrt[z^2]]

changes nothing, similar to

FullSimplify[Sqrt[z^2],Arg[z]>Pi/2]

which should return -z, in my understanding. On the other hand

FullSimplify[Sqrt[z^2],Re[z]>0]

gives z, and

FullSimplify[Sqrt[z^2],Re[z]<0]

gives -z, but unfortunately

FullSimplify[Sqrt[z^2],Re[z]==0]

again does not change anything. Concluding, what is the right way to enforce a correct simplification?

Leslaw

POSTED BY: Leslaw Bieniasz
Posted 1 year ago

For the second of your examples one can use PowerExpand, with the option Assumptions:

FullSimplify[Sqrt[z^2], Arg[z] > Pi/2]
PowerExpand[Sqrt[z^2], Assumptions -> Arg[z] > Pi/2]

Your last example simplifies if sign of the imaginary part is specified:

FullSimplify[Sqrt[z^2], Re[z] == 0]
FullSimplify[Sqrt[z^2], Re[z] == 0 && Positive@Im[z]]
FullSimplify[Sqrt[z^2], Re[z] == 0 && Negative@Im[z]]
POSTED BY: Hans Milton
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