Finding an inverse function (sum of non-integer powers)

353 Views Asked by At

I have a function:

$$f(x)=x^{2.2} + (1-x)^{2.2}$$

It is defined on the interval $[0,1]$. Minimum: $x=0.5, y=2*0.5^{2.2} = 2^{-1.2}$.

I want to find an inverse for it. Since the function has two "wings", inverse will be a family of two functions.

After some tinkering, I crafted something that looks like a very good approximation of an inverse function:

$$ g(x)=\frac{1}{2} \left( 1 \pm \left(\frac{x-2^{-1.2}}{1-2^{-1.2}}\right)^{0.504288} \right) $$

The number $0.504288 \approx 1 / 1.9829939 $ was found experimentally by substituting $g(x)$ into $f(x)$ and tweaking it to make it look as straight as possible:

$$ p(x) = f(g(x)) \approx x $$

Illustration: https://www.geogebra.org/graphing/zgzafsk4 (Might be a bit slow. Image substitute just in case.)

And now it bothers me if I'm just one step away from the exact solution.

So the question is: is it possible to express the exact power in $g(x)$ to get the equality $p(x) = x$ and what that value will be?

Update:

OK, people seem to focus on using usual numeric tools to get an arbitrarily close approximation. But this is not what the question was about. I have an approximation that is good enough for my purposes.

The question is about this particular special case. There is a power function added to reversed and shifted copy of itself.

Inverse function for a power function $y = x^{2.2}$ will be just the power reversed $x = y^{1/2.2}$. Since we adding an increasing and a decreasing function, the resulting curvature has changed. And it raises the suspicion that there might even be an exact power value, smaller than the original 2.2...

After writing this, I realized that the problem can be expressed in a different way. What I actually did is that I made an inverse function for an approximation of $f(x)$:

$$f_{approx}(x) = 2^{-1.2}+ (1-2^{-1.2}) (2x-1)^{1.983}$$

Now I made a different illustration: https://www.geogebra.org/graphing/msfzaqah (image).

There is also $h(x) = \frac{f_{approx}(x)}{f(x)}$ on the illustration. It clearly has some extremes, and changing the power just pushes them around. So the answer to the original question must be: this approximation doesn't fit the function exactly, so there is no exact number to put in there.

Now the question is: can the original function be expressed as something invertible? Same shape functions with an integer power are invertible. What stands in the way for a function with non-integer (fractional) power to be invertible too?

Note:

For powers 2 and 3, similar functions can be expressed in a clearly invertible form:

$$x^2+(1-x)^2 = \frac{1}{2} + \frac{1}{2}(2x - 1)^2$$

$$x^3+(1-x)^3 = \frac{1}{4} + \frac{3}{4}(2x - 1)^2$$

For the power of 4 and above WolframAlpha doesn't provide a form like this (single power), but still able to construct inverse functions, albeit more and more complicated.

Interesting that for powers of 2 and 3 the resulting function has the power of 2. And this fact seems to persist for higher powers - a sum of (2n+1) power functions will be a (2n) power function. But that's a digression.

Update 2:

I really appreciate the answers about Tailor series expansion. But I'm still concerned: is it the best we can do?

5

There are 5 best solutions below

0
On

There may not be an exact expression in terms of elementary functions for the inverse $f^{-1}$ of a function $f$. However, there are several ways you can systematically approximate the inverse. One might be this. Choose several data points $(x,f(x))$ for your function $f$ (where the inverse is defined). Then, the inverse satisfies $(x,f^{-1}(x)) = (f(x),x)$. Once you find these data points (basically by flipping $x$ and $f(x)$), you can fit an accurate regression curve which closely approximates your data $(x,f^{-1}(x))$. If your function is a polynomial, you might choose a polynomial basis (e.g. {1,x,x^2,x^3,...x^n}). Then, your approximate inverse will have the form $$f^{-1}(x) = a_0+a_1x+a_2x^2 + \cdots a_nx^n.$$

0
On

Using whole numbers, you want to approximate $x$ such that, for a given value of $y$ be satisfied the equation $$y=x^{11/5}+(1-x)^{11/5}\tag 1$$ You already noticed the symmetry.

One thing you could do is to expand $y$ as a Taylor series around $x=\frac 12$ and this would give $$y=\frac{1}{2 \sqrt[5]{2}}+\frac{33}{25} 2^{4/5} \left(x-\frac{1}{2}\right)^2-\frac{44}{625} 2^{4/5} \left(x-\frac{1}{2}\right)^4-\frac{3696\ 2^{4/5} \left(x-\frac{1}{2}\right)^6}{78125}+O\left(\left(x-\frac{1}{2}\right)^7\right)$$ Now, using series reversion, $$x=\frac{1}{2}+\frac{5 \sqrt{y-\frac{1}{2 \sqrt[5]{2}}}}{2^{2/5} \sqrt{33}}+\frac{5 \left(y-\frac{1}{2 \sqrt[5]{2}}\right)^{3/2}}{99 \sqrt[5]{2} \sqrt{33}}+\frac{287 \left(y-\frac{1}{2 \sqrt[5]{2}}\right)^{5/2}}{19602 \sqrt{33}}+O\left(\left(y-\frac{1}{2 \sqrt[5]{2}}\right)^3\right)\tag 2$$ To make it looking nicer, use instead $$x=\frac{1}{2}+t+\frac{2 }{75}t^3+\frac{574}{28125} t^5+O\left(t^7\right)\qquad \text{with} \qquad t=\frac{5 \sqrt{y-\frac{1}{2 \sqrt[5]{2}}}}{2^{2/5} \sqrt{33}}$$

To check how it works, let us give a value to $x$; using $(1)$, compute the corresponding $y$ and use $(2)$ to recompute $x$. This would give the following results $$\left( \begin{array}{ccc} x_{given} & y_{calc} & x_{calc} \\ 0.50 & 0.435275 & 0.500000 \\ 0.55 & 0.441020 & 0.550000 \\ 0.60 & 0.458245 & 0.600000 \\ 0.65 & 0.486923 & 0.650000 \\ 0.70 & 0.527004 & 0.700000 \\ 0.75 & 0.578415 & 0.749998 \\ 0.80 & 0.641057 & 0.799993 \\ 0.85 & 0.714789 & 0.849977 \\ 0.90 & 0.799420 & 0.899936 \\ 0.95 & 0.894662 & 0.949833 \\ 1.00 & 1.000000 & 0.999559 \end{array} \right)$$ This was for the right part of the curve. For its left part, just make $x\to 1-x$ and get $$\left( \begin{array}{ccc} x_{given} & y_{calc} & x_{calc} \\ 0.00 & 1.000000 & 0.000441 \\ 0.05 & 0.894662 & 0.050167 \\ 0.10 & 0.799420 & 0.100064 \\ 0.15 & 0.714789 & 0.150023 \\ 0.20 & 0.641057 & 0.200007 \\ 0.25 & 0.578415 & 0.250002 \\ 0.30 & 0.527004 & 0.300000 \\ 0.35 & 0.486923 & 0.350000 \\ 0.40 & 0.458245 & 0.400000 \\ 0.45 & 0.441020 & 0.450000 \\ 0.50 & 0.435275 & 0.500000 \end{array} \right)$$ For sure, we could make it more accurate using more terms and, in terms of $t$, obtain $$x=\frac{1}{2}+t+\frac{2 }{75}t^3+\frac{574}{28125} t^5+\frac{3932 }{140625}t^7+\frac{7988638 }{158203125}t^9+\frac{1274313196 }{11865234375}t^{11}+O\left(t^{13}\right)$$

Edit

Making the problem more general for $$y=x^{k}+(1-x)^{k}$$ and using the same approach, we should get $$x=\frac{1}{2}+t-\frac{(k-3) (k-2)}{6} t^3+\frac{(k-3) (k-2) (27 k^2-103k+50)}{360} t^5+O\left(t^7\right)$$ where $t=\sqrt{\frac{2^{k-2} y-\frac{1}{2}}{k(k-1) }}$.

Update

To get something similar to what you have done, for the more general case, building a Taylor expansion around $x=\frac 1 2$, we have $$y=2^{1-k}+2^{2-k} (k-1) k \left(x-\frac{1}{2}\right)^2+O\left(\left(x-\frac{1}{2}\right)^4\right)$$ and solving the quadratic $$x=\frac 12 \left(1\pm \sqrt{\frac{2^k y-2}{(k-1) k} } \right)$$ which is very close to what you proposed.

This could be improved using one more term in the expansion $$y=2^{1-k}+2^{2-k} (k-1) k \left(x-\frac{1}{2}\right)^2+\frac{1}{3} 2^{2-k} (k-3) (k-2) (k-1) k \left(x-\frac{1}{2}\right)^4+O\left(\left(x-\frac{1}{2}\right)^6\right)$$ which is a quadratic equation in $\left(x-\frac{1}{2}\right)^2$ (easy to solve).

0
On

Too long for a comment.

Concerning what you wrote in the note about the invertible forms $$x^2+(1-x)^2 = \frac{1}{2} + \frac{1}{2}(2x - 1)^2$$ $$x^3+(1-x)^3 = \frac{1}{4} + \frac{3}{4}(2x - 1)^2$$ consider $$y=x^k+(1-x)^k$$ and let $x=\frac {1+u}2$ that is to say $u=(2x-1)$. This makes $$y=2^{-k} \left((1+u)^k+(1-u)^k\right)\implies 2^k y=(1+u)^k+(1-u)^k$$

Now, expand as Taylor series around $u=0$ to get $$2^k y-2=(k-1) k u^2+\frac{(k-3) (k-2) (k-1) k}{12} u^4+O\left(u^6\right)$$Notice that, since $u \leq \frac 12$, the ratio of the second term to the first term is at most $\frac{(k-3) (k-2)}{48} $ which, for $2\leq k \leq 3$, is, in absolute value, less that $\frac 1{192}$. This justifies the trunction to $O\left(u^4\right)$ and the formula you propose before adjusting the power for a better fit (for the compensation of the neglected terms).

2
On

In addition to the pertinent answer from Claude Leibovici, this is an alternative way for series expansion, with a more general power ($a$ instead of $2.2$ ). $$f(x)=x^a+(1-x)^a \tag 1$$ Obviously the curve which represent $f(x)$ is symmetrical with respect to $x=\frac12$. The minimum of $f$ is $2^{1-a}$. This suggests the change of variables : $$\begin{cases} x=\frac12+X \\ f=2^{1-a}(1+Y^2)^a \end{cases} \quad\implies\quad \left(\frac12+X\right)^a+\left(\frac12-X\right)^a =2^{1-a}(1+Y^2)^a \tag 2$$ For the inverse function we look for a series expansion of the form : $$X=c_0+c_1Y+c_2Y^2+...+c_kY^k+...$$ In Eq.$(2)$ we replace $X$ by the series of powers of $Y$ and we identify the coefficients. The result is : $$c_0=c_2=c_4=c_6=0$$ $$c_1=\frac{1}{\sqrt{2(a-1)}}$$ $$c_3=\frac{\sqrt{2}}{24}\frac{(a+1)(2a-3)}{(a-1)^{5/2}}$$ $$c_5=\frac{\sqrt{2}}{2880}\frac{(a+1)(12a^3-40a^2+47a-45}{(a-1)^{5/2}}$$ The calculus was done only up to $c_5$ which is sufficient for a very good accuracy.

The inverse function is : $$\boxed{x\simeq \frac12+c_1Y+c_3Y^3+c_5Y^5 \quad\text{with}\quad Y=\pm\sqrt{(2^{a-1}f)^{1/a}-1}}$$

RESULT in case of $a=2.2$ : $$a_1=0.645497224368$$ $$a_3=0.200821358692$$ $$a_5=-0.007395326225$$

In the tables below $f_k$ are the given values. $x_k$ are the computed values.

On can compare the given $f_k$ with the computed $f_k\simeq (x_k)^{2.2}+(1-x_k)^{2.2}$.

Branch $+$ of the square root :

enter image description here

Branch $-$ of the square root :

enter image description here

0
On

This is not a useful answer, but I wanted to try it anyway.

Let's try to perform an inversion operation in a domain where it is trivial - in polar coordinates.

$$y = x^{2.2}+(1-x)^{2.2}\tag{1}$$ $$r\sin{\theta} = (r\cos{\theta})^{2.2}+(1-r\cos{\theta})^{2.2}\tag{2}$$

Inversion is a rotation around a line $\theta = \pi/4$. We get the rotated equation by replacing $\theta$ with $(\frac{\pi}{2} - \theta)$. We can also notice that

$$\sin{(\frac{\pi}{2} - \theta)} = \cos{\theta}$$ $$\cos{(\frac{\pi}{2} - \theta)} = \sin{\theta}$$

And the rotated equation in polar coordinates looks like this:

$$r\cos{\theta} = (r\sin{\theta})^{2.2}+(1-r\sin{\theta})^{2.2}\tag{3}$$

Very neat, isn't it?

Now let's try to get back to Cartesian coordinates. (Note: we only concerned about the first quadrant of polar plane.)

$$r = \sqrt{x^2 + y^2}$$ $$\theta = \tan^{-1}{(y/x)}$$ $$\cos{(\tan^{-1}{(y/x)})} = \frac{1}{\sqrt{(y/x)^2+1}}$$ $$\sin{(\tan^{-1}{(y/x)})} = \frac{y/x}{\sqrt{(y/x)^2+1}}$$

$$\frac{\sqrt{x^2 + y^2}}{\sqrt{(y/x)^2 + 1}} = \left(\frac{y}{x}\frac{\sqrt{x^2 + y^2}}{\sqrt{(y/x)^2 + 1}}\right)^{2.2} + \left(1 - \frac{y}{x}\frac{\sqrt{x^2 + y^2}}{\sqrt{(y/x)^2 + 1}}\right)^{2.2}\tag{4}$$

We can then simplify this equation to the following:

$$x = y^{2.2}+(1-y)^{2.2}\tag{5}$$

Which is both silly and obvious. (Like Captain Obvious level of obvious...) And we are back to where we started.