Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 14 years ago

trk gravatar image

How solve() works?

Hi,

Let

f(x)=12x+x2+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:

f(x)=(x^2+25)^(1/2)+(1/2)*(8-x)
ans=f(x).diff(x)==0
print ans.solve(x)

But that gives the answer:

x=12x2+25

I had to change the last line to:

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

To give the correct answer:

x=533,x=533

Why do I have to do that?

click to hide/show revision 2
No.2 Revision

How Unexpected solve() works?result

Hi,

Let

f(x)=12x+x2+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:

f(x)=(x^2+25)^(1/2)+(1/2)*(8-x)
ans=f(x).diff(x)==0
print ans.solve(x)

But that gives the answer:

x=12x2+25

I had to change the last line to:

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

To give the correct answer:

x=533,x=533

Why do I have to do that?