logoalt Hacker News

contubernioyesterday at 9:14 AM2 repliesview on HN

It's not a simplification, it's wrong. Sqrt(square(x)) equals abs(x).


Replies

MForsteryesterday at 10:09 AM

It also equals x with appropriate assumptions (x > 0).

show 2 replies
oh_my_goodnessyesterday at 5:29 PM

Not in general. As people have pointed out elsewhere, it's true if x is real. That isn't always a helpful assumption. (When x is real you can plug that assumption into Mathematica. Then Mathematica should agree with you.)

But consider sqrt(i) = sqrt(exp(i\pi/2)). That's exp(i\pi/4). Your rule would give 1 as the answer. It's not helpful for a serious math system to give that answer to this problem.

When I square 1 I don't get i.