wxMaxima-developers / wxmaxima

A gui for the computer algebra system Maxima built with wxWidgets
https://wxMaxima-developers.github.io/wxmaxima/
Other
471 stars 98 forks source link

solve does not provide an answer #1854

Closed o1957823 closed 9 months ago

o1957823 commented 9 months ago

solve((4x^3-15x^2+3)/(2x^2+1)-(4x(x^4-5x^3+3x+6))/(2x^2+1)^2=0); gives no result: (%o18) [0=4x^5-10x^4+4x^3-21x^2-24*x+3]

I expected the x for which the function is 0 but it did not

daute commented 9 months ago

Note: That's not an issue with "wxMaxima", but Maxima, which does the mathematics in the background.

If one does a plot of the function (4*x^3-15*x^2+3)/(2*x^2+1)-(4*x*(x^4-5*x^3+3*x+6))/(2*x^2+1)^2 one can assume, that there is probably no explicit solution. You can solve it numerically, e.g using the newton method:

From the plot one can see, that one solution is probably near 2, so choose 2 as starting point x_0 - and a small epsilon:

(%i1) load("newton1")$

(%i2) newton((4*x^3-15*x^2+3)/(2*x^2+1)-(4*x*(x^4-5*x^3+3*x+6))/(2*x^2+1)^2, x, 2, 0.0001);
(%o2)                          2.975220880089169

gives you the first (numerical) solution. Choose other starting values to get the other solutions, e.g. 0 and -1:

(%i3) newton((4*x^3-15*x^2+3)/(2*x^2+1)-(4*x*(x^4-5*x^3+3*x+6))/(2*x^2+1)^2, x, -1, 0.0001);
(%o3)                         - 0.82696207376374
(%i4) newton((4*x^3-15*x^2+3)/(2*x^2+1)-(4*x*(x^4-5*x^3+3*x+6))/(2*x^2+1)^2, x, 0, 0.0001);
(%o4)                         0.1138395737615769

The command ? newton shows more information. And there are other methods so solve an equation numerically, of course.

Closing this ticket, as it is not a wxMaxima issue.