Ask Your Question
1

Checking that symbolic expression is zero

asked 2019-03-05 21:13:50 +0100

Marcel gravatar image

How do I show that a simple algebraic expression like e.g.

(-1/16*sqrt(6)*sqrt(3)*sqrt(2) + 1/16*I*sqrt(6)*sqrt(2) - 1/8*I*sqrt(3) + 3/8).full_simplify

is zero?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2019-03-06 00:59:49 +0100

Juanjo gravatar image

Try this:

bool(-1/16*sqrt(6)*sqrt(3)*sqrt(2) + 1/16*I*sqrt(6)*sqrt(2) - 1/8*I*sqrt(3) + 3/8==0)

The answer is True.

edit flag offensive delete link more
1

answered 2019-03-06 16:07:23 +0100

slelievre gravatar image

To complement @Juanjo's answer, another option is to work in the field of algebraic numbers.

sage: a = QQbar(-1/16*sqrt(6)*sqrt(3)*sqrt(2) + 1/16*I*sqrt(6)*sqrt(2) - 1/8*I*sqrt(3) + 3/8)
sage: a
0.?e-18 + 0.?e-19*I

Initially the numerical approximation for this algebraic number is only given to a certain precision.

However algebraic numbers have an exactify method, which can turn them into a simpler form.

sage: a.exactify()
sage: a
0

Here we know that a is exactly zero.

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

1 follower

Stats

Asked: 2019-03-05 21:13:50 +0100

Seen: 627 times

Last updated: Mar 06 '19