Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How solve() works?

Hi,

Let

$\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:

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:

$\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?

How Unexpected solve() works?result

Hi,

Let

$\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:

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:

$\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?