Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

problem with solve function

Solve function in SageMath produces some strange output while finding roots of a derivative of function (exp(x)*(1-x))^n/x^m. Entering the code below

var('x, m, n'); hh=(exp(x)*(1-x))^n/x^m solve(hh.diff(x)==0,x)

produces output

(x, m, n) [x^2 == (m*x^2 - m)/n]

What does [x^2 == (m*x^2 - m)/n] is supposed to mean? By contrast Sympy quickly produces a correct easy to understand answer \left[ \frac{m - \sqrt{m \left(m - 4 n\right)}}{2 n}, \frac{m + \sqrt{m \left(m - 4 n\right)}}{2 n}\right]

problem with solve function

Solve function in SageMath produces some strange output while finding roots of a derivative of function (exp(x)*(1-x))^n/x^m. Entering the code below

var('x, m, n');
n');`
hh=(exp(x)*(1-x))^n/x^m
solve(hh.diff(x)==0,x)

solve(hh.diff(x)==0,x)

produces output

(x, m, n)
[x^2 == (m*x^2 - m)/n]

m)/n]

What does [x^2 `[x^2 == (m*x^2 - m)/n] is supposed to mean? By contrast Sympy quickly produces a correct easy to understand answer \left[ answer :

$$\left[ \frac{m - \sqrt{m \left(m - 4 n\right)}}{2 n}, \frac{m + \sqrt{m \left(m - 4 n\right)}}{2 n}\right]n}\right]$$

problem with solve function

Solve function in SageMath produces some strange output while finding roots of a derivative of function (exp(x)*(1-x))^n/x^m. Entering the code below

var('x, m, n');`
n')
hh=(exp(x)*(1-x))^n/x^m
solve(hh.diff(x)==0,x)

produces output

(x, m, n)
[x^2 == (m*x^2 - m)/n]

What does `[x^2 == (m*x^2 - m)/n] is supposed to mean? By contrast Sympy quickly produces a correct easy to understand answer :

$$\left[ \frac{m - \sqrt{m \left(m - 4 n\right)}}{2 n}, \frac{m + \sqrt{m \left(m - 4 n\right)}}{2 n}\right]$$