Ask Your Question
1

wrong answer from solve?

asked 2016-01-22 17:03:04 +0100

beeson gravatar image
var('t')
test3 = -4*cos(t)^4 + 4*cos(t)^2 - 1
sage: solve(test3==0,t)
[]

When actually the equation is equivalent to (cos(t))^2 = 1/2 and it does have solutions.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-01-22 19:36:37 +0100

kcrisman gravatar image
sage: solve(test3==0,t,to_poly_solve=True)
[t == 1/4*pi + 1/2*pi*z35]

You do have to read the documentation of solve? to see this option. It's not default because sometimes it will not return exact solutions.

edit flag offensive delete link more

Comments

So then, if solve returns [], that does not mean "there are no solutions". It means, "I didn't find any solutions". Similarly, if it does return a list of solutions, I guess that means "Here are the solutions I found", rather than, "Here are all the solutions." If this is the case, the documentation should say so up front. It says, "if there are no solutions it returns an empty list" but says nothing about the converse.

beeson gravatar imagebeeson ( 2016-01-22 20:54:33 +0100 )edit

I think it does say something along these lines when it talks about to_poly_solve, but we would welcome specific suggestions for how to improve the documentation, for sure!

kcrisman gravatar imagekcrisman ( 2016-01-26 18:21:28 +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-01-22 17:03:04 +0100

Seen: 666 times

Last updated: Jan 22 '16