Ask Your Question
4

Simplify an expression of square roots

asked 2016-10-23 20:31:31 +0100

user101214 gravatar image

Sage's .simplify() command is unable to simplify the expression $\sqrt{2} \cdot \sqrt{3} \cdot \sqrt{6}$: the output of both

(sqrt(6) * sqrt(3) * sqrt(2)).simplify()

and

(sqrt(6) * sqrt(3) * sqrt(2)).simplify_full()

is just sqrt(6)sqrt(3)sqrt(2) again.

Notably, (sqrt(6)sqrt(3)sqrt(2)).is_integer() also returns false.

Is there a more powerful version of the simplify command that won't get overwhelmed by an expression like this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-10-23 21:08:02 +0100

tmonteil gravatar image

updated 2016-10-23 21:10:19 +0100

You can do:

sage: a = sqrt(6) * sqrt(3) * sqrt(2)
sage: a.canonicalize_radical()
6

canonicalize_radical is not parrt of the full_simplify method, IIRC because of some monodromy issues (winding around singularities in the complex plane does not commute with chosing a single branch of a multi-valued function), canonicalize_radical is not parrt of the full_simplify method anymore.

Here, since everything is assumed to be real, there is no real issue.

edit flag offensive delete link more

Comments

That's exactly what I need, thanks!

user101214 gravatar imageuser101214 ( 2016-10-23 22:16:21 +0100 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-10-23 20:31:31 +0100

Seen: 2,314 times

Last updated: Oct 23 '16