[Math] Find X given Y in a cubic function.

algebraic-curves

Having asked this question on the math overflow boards one of the contributors suggested this may be a more appropriate forum.

I have a cubic function in the form:

$$y = ax^3 + bx^2 + cx + d$$

…(where a, b, c and d are all known constants e.g -0.3, 3.5, 3.83 and 0 respectively) that produces a curve and allows me to calculate a point on that curve given it's x co-ordinate.

What I'd really appreciate help with is: How could I rewrite this equation to calculate the value of x if I knew the value of y?

I understand that cubic curves of this nature can have multiple (upto 3) values for x for any given y though I do not know how to calculate them, and my specific interest is only in the 'rightmost' x (i.e that with highest positive value).

Through research to date I gather my question relates some what to finding the roots of the cubic equation (where the given Y is specifically 0, so the values of x are where the curve crosses the horizontal axis) but I can't expand my admittedly hazy comprehension to calculating for different y values.

The only additional hint I've been able to glean is that because in my circumstances d is always 0 that I may not be dealing with a 'true' cubic function at all and instead might want to "factor out an 'x' and a quadratic".

I have noted there are similar questions posted here but these deal specifically with cubic bezier curves, where the form of the equation deals with t (time) based coefficients and the answers refer to expression of the curve in terms of control points rather then the a, b, c, d form.

Give me anything but mathematics to Google and I'm usually able to work something out for myself but in the sea of coefficients and polynomials I'm afraid I'm lost.

Thank you in adavnce for any pointers, John.

Best Answer

No John, modifying these formulas for y other than zero is pretty easy. You only change the value of $d$. If you want to solve $$−0.3x^3+0.5x^2+3.83x=0$$ you plug in $a=-0.3,b=0.5,c=3.83,d=0$. And then if you want to solve $$−0.3x^3+0.5x^2+3.83x=10$$ this is equivalent to $$−0.3x^3+0.5x^2+3.83x-10=0$$ so you plug in $a=-0.3,b=0.5,c=3.83,d=-10$ and get the $x$'s. So the general rule is if $$ax^3+bx^2+cx+d=f$$ then just substitute $a,b,c,d-f$ for $a,b,c,d$ in the formulas.

As for the complexity of the inverses, that is just the nature of polynomials. As the degree increases, the inverses get uglier and uglier. For degree five and above the general formulas don't even exist. Usually for the chicken in the oven type problem you are talking about, one can restrict the domain and hence the range (like the temperature can't be negative for example and the temperature will be monotonic in time, going up always) and then the inverse can become simpler.