# Is there an inverse for a quartic function? For a programming project, I'm trying to figure out the inverse of a quadratic function: f(x)=ax^4+bx^3+cx^2+dx+e.

Is there an inverse for a quartic function?
For a programming project, I'm trying to figure out the inverse of a quadratic function: $f\left(x\right)=a{x}^{4}+b{x}^{3}+c{x}^{2}+dx+e$. In my case, the numbers a, b, c, d and e are all known constants, but rather annoying non-integers going about five places past the decimal point.
I have a function that returns the result when x is processed through the equation, but what I now need is a function that will return the result back to the original input.
Is there an inverse to the function above, which I would be able to re-use the same constants? If I have to go about finding this solution myself, are there any resources that will explain the steps involved in simple language?
It's been twenty years since my last math class, and I don't recall ever getting into solving fourth degree equations. I've found all sorts of information about trying to solve and find the roots for quartic equations, although I don't quite understand what they're doing, but nothing on a plain old inverse of the function.
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

scranna0o
Step 1
The main problem you're going to have is a general forth degree polynomial will not be one-to-one, so you'll have to be careful to restrict the domain of your function. Take for example the most basic quartic:
$f\left(x\right)={x}^{4}$
If $f\left(x\right)=1$, what is x? Well (if you're only considering real numbers), x could be either 1 or -1. So which is it? If you restrict your domain to only positive numbers, then the inverse is 1.
Step 2
The problem becomes more complex, of course, when you consider the "general" case, since the function will look like a "W" in general (you might have 4 possible solutions!)
If you're okay with inexact answers (as this is for programming, I'm guessing this might be the case?), you can always solve the equation $y=f\left(x\right)$ for x by using a numerical method such as Newton's method. Of course, yet again, you'll have to worry about multiple solutions.
###### Did you like this example?
rochioblogmz
Step 1
The problem is that because of the even degree (degree 4), on the domain of all real numbers the inverse relation won't be a function (which means we say "the inverse doesn't exist").
For example, consider $f\left(x\right)={x}^{4}$ on all of the real numbers. Clearly $f\left(2\right)=f\left(-2\right)=16$. So when I ask you to give me x such that $f\left(x\right)=16$ what do you return? The inverse relation is multi-valued (meaning it isn't a function).
But on the other hand if I consider $f\left(x\right)={x}^{4}$ on all of the positive real numbers, now we do have an inverse and $f\left(x\right)=16⇒x=2$.
Easy way to check for invertibility, just plot the function on your domain. If it passes the horizontal line test (yes the horizontal line test...because we want the inverse to be a function) then the inverse does exist.
Another issue is, even if our function is invertible in whatever domain, to find the actual expression for ${f}^{-1}\left(x\right)$ may not be easy. In my example above, the inverse is ${f}^{-1}\left(x\right)={x}^{1/4}$. But if I want to invert $f\left(x\right)={x}^{4}-x-1$ on the domain [-1,0], it'll get a bit hairy. It probably won't be a polynomial and even if you find an expression using a CAS like Mathematica it might still not be worth it...well maybe if you can simplify it enough.
Step 2
So then you can fall back on the root finding problem. So for example if you want to find x such that
$f\left(x\right)={x}^{4}-x-1=\frac{1}{2}$
then you numerically solve
${x}^{4}-x-\frac{3}{2}=0$
using Newton's method or whatever. In this case there are four distinct solution, two are real and two are complex. But since we restrict ourselves to $x\in \left[-1,0\right]$ our answer is $x=-0.456553...$