cubic polynomial with variables
40 views (last 30 days)
This is probably a fairly easy question to answer.
I am trying to solve a 3rd degree polynomial with 4 variables, a b c d, each functions of k1, k2, Tr, Tf (or some of those).
Is it possible to obtain the roots of the polynomial in terms of k1, k2, Tf, Tr?
Thanks for your help,
Walter Roberson on 4 Jul 2012
syms x k1 k2 Tr Tf
a = SomeFunction(k1,k2,Tr,Tf);
b = SomeOtherFunction(k1,k2,Tr,Tf);
c = AThirdFunction(k1,k2,Tr,Tf);
d = FourthFunction(k1,k2,Tr,Tf);
CubeRoots = solve( a*x^3 + b*x^2 + c*x + d, x);
You might also want to simplify() each of the roots.
I will caution you that the results you get out are likely to be messy to read: the generalized solution for a cubic is not fun to make mental sense of. (Quadratic can be a lot worse though!)