Ask Your Question

Unexpected solve() result

asked 2011-02-20 02:35:47 -0500

trk gravatar image

updated 2011-02-20 02:36:48 -0500



$\hspace{1in} f(x) = -\frac{1}{2} x + \sqrt{x^{2} + 25} + 4 $

I would like to find the first derivative of f(x) and then the value of x when $f'(x)=0 $.

This is what I did:

print ans.solve(x)

But that gives the answer:

$\hspace{1in} x = \frac{1}{2} \sqrt{x^{2} + 25} $

I had to change the last line to:

print ((ans.solve(x)[0]*2)^2).solve(x)

To give the correct answer:

$ \hspace{1in} x = -\frac{5}{3}\sqrt{3}, x = \frac{5}{3}\sqrt{3} $

Why do I have to do that?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2011-02-21 04:24:45 -0500

kcrisman gravatar image


sage: ans.solve(x,to_poly_solve=True)
[x == 5/3*sqrt(3)]

Another reminder to make sure that the global solve? has the same information about this option as the local x.solve?. Though in this case,

sage: ans.solve?

would give you information about this option.

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: 2011-02-20 02:35:47 -0500

Seen: 158 times

Last updated: Feb 21 '11