How I can Solve an Advanced Cubic Equation

8 visualizzazioni (ultimi 30 giorni)
Jean-Hubert Olivier
Jean-Hubert Olivier il 23 Gen 2020
Risposto: Walter Roberson il 24 Gen 2020
I am aiming to solve the following cubic equation for x.
x^3*a^2(r-1)+x^2*a*(a-2*(r-1)) - x*(2a+1)+1 = 0
Essentially, I would like to express x as a function of the variable r and a. Any pointer as of how I shouldt ackle this problem. Thanks
  2 Commenti
Walter Roberson
Walter Roberson il 23 Gen 2020
Symbolic Toolbox solve() with 'MaxDegree', 3 option and simplify() afterwards.
Complete answers exist, but it is normal for the output to be what appears to be a moderately long string of nonsense.
J. Alex Lee
J. Alex Lee il 24 Gen 2020
Why not just start with Wikipedia or textbooks on solution of cubics? It's usually easier to do that than to decipher/simplify the results of symbolic solvers (at least my experience with Mathematica; I've never use TMW's symbolic toolbox)

Accedi per commentare.

Risposte (1)

Walter Roberson
Walter Roberson il 24 Gen 2020
syms x a r
eqn = x^3*a^2*(r-1)+x^2*a*(a-2*(r-1)) - x*(2*a+1)+1;
sol = simplify(solve(eqn, x, 'maxdegree', 3));
The second and third solution are over 1000 characters each. I don't think the solution will have any meaning to you.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by