Ask Your Question

strange way to simplify square roots

asked 2012-11-14 13:48:49 +0200

mathematicboy gravatar image

updated 2023-01-10 00:01:08 +0200

tmonteil gravatar image


Let us consider the number


which is zero. If we simplify


we obtain

-2.73205080756888 - 8.36449319149292e-17*I,

which of course is false. I guess it is a problem handling complex roots of degree four, but still, it don't seems to me a reasonable computation. ┬┐Anybody knows how to fix it?

edit retag flag offensive close merge delete

2 Answers

Sort by ┬╗ oldest newest most voted

answered 2012-11-14 14:16:51 +0200

kcrisman gravatar image
sage: a.simplify_full()
-(sqrt(sqrt(3) - 2)*sqrt(2) + I*sqrt(3) - I)/(sqrt(sqrt(3) - 2)*(sqrt(2)*sqrt(3) - sqrt(2)))

See Trac 12737 for what the problem likely is for this. In my view, this is buyer beware of simplification (!) but at any rate to be fair I will link this question there as well. For now:

sage: a.simplify_trig()
-(sqrt(-2*sqrt(3) + 4) - sqrt(3) + 1)/(sqrt(-2*sqrt(3) + 4)*(sqrt(3) - 1))
sage: a.simplify_trig().n()
edit flag offensive delete link more

answered 2013-11-06 10:48:08 +0200

kcrisman gravatar image

Update: Trac 12737 has been merged in Sage.

sage: a=1/sqrt(4-2*sqrt(3))-1/(sqrt(3)-1)
sage: a.simplify_full().n()
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-11-14 13:48:49 +0200

Seen: 714 times

Last updated: Nov 06 '13