# inverse of function

• Sep 20th 2012, 11:00 PM
reza11617
inverse of function
Hi every one
I'm Reza civil engineering student

I faced a problem I need to inverse this function

y = a*x + b*x^n

in the domain of [0,inf)

and i tried matlab and there was no answer

• Sep 20th 2012, 11:43 PM
johnsomeone
Re: inverse of function
For arbitrary n, that won't have an inverse funtion that you can right down, even when such an inverse function exists.

I'll ignore all the special cases (a = 0, b = 0, solvability if n=2, what it means if n=1 or n = 0, etc.):

For there to even be an inverse, the function must be one to one on that domain, so you function must be strickly increasing or decreasing on $(0, \infty)$.

Checking that, $\frac{dy}{dx} = a + bnx^{n-1}$. Just by inspection, if a and b are both positive, or negative, then $\frac{dy}{dx}$ will be always positive or negative on $(0, \infty)$.

If a and b have opposite sign, then find the real solutions for $\frac{dy}{dx} = 0$. Get $x_0 = \left( \frac{-a}{bn} \right)^{\frac{1}{n}}$.

Will have that $x_0 >0$, and $\frac{d^2y}{dx^2}(x_0) = bn(n-1)x_{0}^{n-2} \ne 0$, so it's either a local maxima or local minima - either way, y isn't one-to-one near $x_0$.

Thus, when both a and b are non-zero, and n>2, yone to one on the domain of positive reals if and only if a and b have the same sign.

Note that the reason you can't write down the inverse, even when it has one, is that the practical procedure is to switch x & y, then solve for y, your inverse function.

Here that means: Solve for y: $x = ay + by^n$, or rewritten: $by^n + ay - x = 0$. There's no general formula for that for all n.
• Sep 21st 2012, 12:43 AM
reza11617
Re: inverse of function

a and b in my function is positive so this function is increasing over the domain.

and i m asking if n is a real number between 3.5 and 5, is there any inverse function for this function?(i mean for a specific n)
• Sep 21st 2012, 01:45 AM
johnsomeone
Re: inverse of function
"i m asking if n is a real number between 3.5 and 5, is there any inverse function for this function?(i mean for a specific n)"
Usually n stands for an integer, but looking over it, everything from before still holds in your case when n is a real number between 3.5 and 5, a and b are positive, and x >=0.
Unfortunately, that includes that there won't be a pretty formula for the inverse function. It exists, but it won't have a nice pretty formula.

There are techniques to numerically estimate the inverse, if you intended to use it in a computer program.
You could also produce a power series near a point that would converge to the inverse function in some neighborhood of that point.

If you have a practical need to know the inverse, then you'll be ok using a computer program. If you've a theoretical need for the inverse function, then just knowing that it exists tells you a great deal (for theoretical purposes, the functions observed usually don't have a pretty formula describing them).
• Sep 21st 2012, 02:31 AM
reza11617
Re: inverse of function
"There are techniques to numerically estimate the inverse, if you intended to use it in a computer program.
You could also produce a power series near a point that would converge to the inverse function in some neighborhood of that point"

I actually need it for coding.
in my coding i get the y value form input and i should calculate x by this formula and output the result
can you explain more or suggest some article to me which i can read and find out what to do?

best regards
• Sep 21st 2012, 03:53 AM
johnsomeone
Re: inverse of function
I don't know where to look in the computer science literature - I'd begin googling from scratch. The types of data you're expecting will dictate the algorithm you'll want to use.

$[0, \infty)$ is a pretty big range. I'll relate some ideas:

Method 1:
If you'll have random huge numbers, maybe you'll approximate $x = ay + by^n$ as $y_0 = (\frac{x}{b})^{1/n}$, and then use Newton's method to get close to the solution:

Use Newton's Method, starting with $y_0$ to find $\tilde{y}$ s.t. $g(\tilde{y}) = 0$, where $g(y) = by^n +ay -x$, and $x$ is a constant.

Method #2:
If you'll be using it in succession with several numbers that are close to each other (29.021, 29.022, 29.023, etc), then a Taylor polynomial (implicit differentiation to get the derivatives of the inverse function) would seem natural. One problem with this is that you'll want to bound the error, which requires bounding the derivatives of the inverse function over a range. That would take some thought.

Method #3
There's always the brute method of testing the original function and seeing if it's too high or two low, kinda like a binary search. This nicely exploits the fact that your function is always increasing.

Ex: 2 < sqrt(7) < 3. Try 2.5. 2.5^2 = 6.255 = too low. Thus 2.5 < sqrt(7) < 3. Try 2.7. 2.7^2 = 7.29 = too high. Thus 2.5 < sqrt(7) < 2.7. Etc.

I'm sure there are lots of other ways, and combinations of these ways, but this isn't something I know about - I'm just talking off the top of my head here. Also, it depends on your expectations of the data, and your accuracy demands, and your speed requirements. I'm sure there's, somewhere, some good computer science literature about this. Google time!
• Sep 21st 2012, 05:41 AM
reza11617
Re: inverse of function
thank you very very much it was so helpful

Best regards