Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Getting all (complex) solutions of a non polynomial equation

Hi !

I was used to solve the following equation with Mathematica. \begin{equation} \alpha_1 + \alpha_2x + \alpha_3x^2 + x^4 + \frac{\alpha_4}{x^2-\alpha_0} - \frac{\alpha_5}{x^2-\alpha_0}=0 \end{equation} where $\alpha_i$ are constants.

The Mathematica function "Solve" gives me all the numerical roots of this non polynomial equation very easily. These roots can be real or complex.

I'm a very beginner at Sage. I have tried several methods to solve this equation automatically but it seems that all methods I've used work only for polynomial equations.

Do you have any idea of a method to get the approximated roots of the equation ?

Thanks in advance

Getting all (complex) solutions of a non polynomial equation

Hi !

I was used to solve the following equation with Mathematica. \begin{equation} \alpha_1 + \alpha_2x + \alpha_3x^2 + x^4 + \frac{\alpha_4}{x^2-\alpha_0} - \frac{\alpha_5}{x^2-\alpha_0}=0 + \frac{\alpha_5 x^2}{x^2-\alpha_0}=0 \end{equation} where $\alpha_i$ are constants.

The Mathematica function "Solve" gives me all the numerical roots of this non polynomial equation very easily. These roots can be real or complex.

I'm a very beginner at Sage. I have tried several methods to solve this equation automatically but it seems that all methods I've used work only for polynomial equations.

Do you have any idea of a method to get the approximated roots of the equation ?

Thanks in advance

EDIT : error correction in the equation

Getting all (complex) solutions of a non polynomial equation

Hi !

I was used to solve the following equation with Mathematica. \begin{equation} \alpha_1 + \alpha_2x + \alpha_3x^2 + x^4 + \frac{\alpha_4}{x^2-\alpha_0} + \frac{\alpha_5 x^2}{x^2-\alpha_0}=0 \end{equation} where $\alpha_i$ are constants.

The Mathematica function "Solve" gives me all the numerical roots of this non polynomial equation very easily. These roots can be real or complex.

I'm a very beginner at Sage. I have tried several methods to solve this equation automatically but it seems that all methods I've used work only for polynomial equations.

equations. Here they are :

alpha0 = 0.25
alpha1 = -2.5
alpha2 = 6.9282
alpha3 = -5.5
alpha4 = 0.5
alpha5 = -0.5
x = var('x')
eq = alpha1 + alpha2*x + alpha3*x**2 + x**4 + alpha4/(x**2 - alpha0) + alpha5*x**2/(x**2 - alpha0) == 0.

# test 1
# solve(eq, x, ring=CC)
# ==> [0 == 20000*x^6 - 115000*x^4 + 138564*x^3 - 32500*x^2 - 34641*x + 22500]

# test 2
# solve(eq, x, ring=CC, solution_dict=True)
# ==> [{0: 20000*x^6 - 115000*x^4 + 138564*x^3 - 32500*x^2 - 34641*x + 22500}]

# test 3
# eq.roots(x, ring=CC,multiplicities=False)
# ==> TypeError: fraction must have unit denominator

Do you have any idea of a method to get the approximated roots of the equation ?

Thanks in advance

EDIT : correction of an error correction in the equationequation ; add few tests