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.

Marlene Brooks

Marlene Brooks

Answered question

2022-10-22

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 ) = a x 4 + b x 3 + c x 2 + d x + 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.

Answer & Explanation

scranna0o

scranna0o

Beginner2022-10-23Added 16 answers

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 ( x ) = x 4
If f ( x ) = 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 ( x ) for x by using a numerical method such as Newton's method. Of course, yet again, you'll have to worry about multiple solutions.
rochioblogmz

rochioblogmz

Beginner2022-10-24Added 1 answers

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 ( x ) = x 4 on all of the real numbers. Clearly f ( 2 ) = f ( 2 ) = 16. So when I ask you to give me x such that f ( x ) = 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 ( x ) = x 4 on all of the positive real numbers, now we do have an inverse and f ( x ) = 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 ( x ) may not be easy. In my example above, the inverse is f 1 ( x ) = x 1 / 4 . But if I want to invert f ( x ) = 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 ( x ) = x 4 x 1 = 1 2
then you numerically solve
x 4 x 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 [ 1 , 0 ] our answer is x = 0.456553...

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?