Is there a general method for solving a degree 3 polynomial that includes a fractional power?

Lately I’ve tried to learn the programming language Python. I’m a Chem Engineer major, so my pet projects include material from this field. A code I’m writing requires me to solve a regular cubic equation, which I was able to do just fine using a series of conditions.

However, to accommodate a variety of input permutations for several different variables, I’ve found that one portion of my code will require me to compute an equation of the form AZ^3 + BZ^2 + CZ + DZ^(1/2) + Q*Z = 0, where A, B, C, D and Q are taken as constants. I have no experience with solving such an equation, especially as it contains a fractional exponent of the variable of interest.

For this particular code I’m only interested in calculating values of Z ranging from 0 - 2, and only interested in the largest and smallest solutions available. Complex solutions will also be discarded.

If anyone knows of a method of solution, hopefully one that may be implemented by a novice Python programmer, I’d appreciate it.

I may also think that some sort of iteration method may be the easiest to program. I suppose I just input values into the equation by the accuracy that I’m interested in until a solution is found. I suppose the only issue would be making the iteration as efficient as possible.

You can probably just give up on an analytic solution: That’s effectively a sixth-order polynomial (sixth order in the square root of Z), and while there are a handful of sixth-order polynomials with analytic solutions, depending on the values of the coefficients, they’re very rare.

For a numerical solution, your best bet for a combination of simplicity and efficiency is probably some variant of the Newton-Raphson method.

It’s actually fundamentally just a fifth order polynomial, since you can divide out by Z^1/2. I.e., setting x = Z^1/2, it’s Ax^6 + Bx^4 + (C + Q)x^2 + Dx = 0. [Don’t know why the OP kept C and Q distinct, but ok]. x = 0 is obviously a solution, and dividing it out we’re left with Ax^5 + Bx^3 + (C + Q)x + D = 0.

Now, of course, fifth degree polynomials can’t generally be solved in radicals any more than sixth degree polynomials can. Still, it’s, uh, something.

(I suppose there is the possibility that the OP meant to write just “Q” instead of “Q * Z”.)

I don’t know, but I worked through this yesterday:

If f(x) = a + bx = cx^2; and g(x) = .7(f(x)), and h(x) = .3(f(x))

then you can express g(x) as .7a + b(.7x) + (c/.7)(.7x)^2; and

h(x) as .3a + b(.7x) + (c/.3)(.3x)^2.

At any x:
f’(x) = g’(x) = h’(x);
f(x)/x = g(x)/.7x = h(x)/.3x; and
f(x) = g(x) + h(x)

go math

eta: it was for something practical as well :slight_smile:

:confused: His expressions are analytic everywhere, no? I think the word you seek is (some variant of) algebraic solution. :smiley:

Yeah, this sounds like your best bet. Since you’re only interested in the largest & smallest roots of the function, you can just use 0 & 2 as your starting points for the iteration. (If you end up writing it as a polynomial in √Z, then 0 & 4 would be the starting points instead.) If you rewrite it as a sixth-order polynomial, you might also consider implementing a check using Sturm functions to ensure that roots actually exist in the region you’re looking at, or even just doing a quick check using Descartes’ Sign Rule for the existence of positive real roots.

It’s possible that there’s a difference in the technical terminology between physicists and mathematicians. To a physicist, a numerical solution to a problem is a solution (usually carried out on a computer) which produces an approximation (generally of any specified quality) using a floating-point expression. An analytic solution, then, is one that is not numerical. These aren’t precise definitions, mind you, but then, physicists don’t care as much about precise definitions as mathematicians do.

“Symbolic solution” is another alternative phrase. I hear “symbolic” more often than “algebraic.”

E.g. Mathematica is more well known for it’s symbolic manipulation even though its numerical are decent. Matlab is better known for its numeric toolbox even though it also has symbolic capabilities.

That’s actually a big help. There is an explicit formula for the roots of the general quintic, so now it’s just a problem of numerical evaluation.

Yes, but as a mathematician I do use analytic as well, so it’s probably not a difference in terminology.

I appreciate all the responses. I must note that I made a mistake in characterizing the equation I was working with. The equation includes a constant term not attaches to the variable Z, such that AZ^3 + BZ^2 + CZ + DZ^(1/2) + **Q ** = 0, where A, B, C, D and Q are taken as constants. This changes things a bit, and unfortunately I don’t think I’d be able to use the explicit formula for a 5 degree polnomial, as the equation remains 6 order.

Still I think many of the links provided will prove very useful (at work right now…).

I was under the understanding that there was no closed form for the general solution of a quintic and tha this had been proved a couple of centuries ago. I will admit to not having the stomach (or head) to wade through the link you provided on Bing radicals – suffice to say that it kinda flew over my head on first reading and it would take me some time to slog through it with my level of math.
You want to provide a bit of an explanation?
J.

There’s no such thing as “no closed form” except relative to what kind of operations you allow in a closed form. What was proven is that there’s no solution to certain quintics expressible in terms of addition/subtraction, multiplication/division, and nth roots of integers. However, those quintics still have solutions, and one way one could express those solutions is by reference to Bring radicals (accordingly, Bring radicals are not expressible in terms of addition, multiplication, and nth roots, but that’s alright; unless you had some particular reason to restrict yourself to things expressible in that particular way, it hardly matters).

Basically, what it means is that no solution is possible using the standard set of mathematical tools most people used, so someone went and created a new mathematical tool specifically for solving that problem. When you get right down to it, that’s the origin of most functions used in math.