# Solving the equation $f^{-1}(x)=f(x)$

I attempted to solve the equation given in the title for the function;

$$f: \mathbb R_{++} \to\mathbb R_{++}; \quad f(x)=x^2(x+2)$$

I understand that the problem is equivalent to solving $f(f(x))=x$ but since this seemed like too much work, I had a look at the solution and it stated that;

$$f^{-1}(x)=f(x) \Longrightarrow f(x)=x$$

I don't understand why this is the case. Can someone please explain this?

Thanks

• It is not true in general; although $f(x)=x$ implies $f(f(x))=x$ the reverse is not always true. Consider $f(x)=-x$ – Mario Carneiro May 28 '15 at 14:51
• Your particular function isn't invertible for negative $x$, so $f^{-1}$ doesn't even make sense in the first place without giving the domain and codomain of $f$. – AlexR May 28 '15 at 14:54
• Were you given an interval to restrict $f$ to? – Clarinetist May 28 '15 at 14:54
• Thanks.That makes sense. So does that mean I must solve the equation $f(f(x))=x$ ? – J.Gudal May 28 '15 at 14:54
• @AlexR,Clarinetist, I'm sorry, I forgot to mention that. Its domain is $x>0$. – J.Gudal May 28 '15 at 14:55

Although $f(f(x))=x\implies f(x)=x$ is not always true, it is true if $f$ is an increasing function (even if only weakly increasing).

Suppose that $f(x)=y$ and $f(y)=x$. If $x\le y$, then $f(x)=y\le f(y)=x$, and vice-versa.
So either way, both $x\le y$ and $y\le x$ are true, and thus $x=y$ and $f(x)=x$.

So your book is not off the rails; this is a valid approach to the problem.

• Thanks that was really helpful. Yes I think it should have mentioned that. – J.Gudal May 28 '15 at 15:09
• I've added a few line breaks for readability, took me a moment to verify the proof, but it's nice ;) (+1) – AlexR May 28 '15 at 15:11
• Your answer is really useful. May I know what is meant by "weakly increasing function". Do you mean monotonic functions? – M. Guru Vishnu Sep 14 at 8:28
• @Intellex Yes. In calculus "monotonic" often means "weakly increasing or weakly decreasing" so I avoid that terminology here. $x\le y\to f(x)\le f(y)$ – Mario Carneiro Sep 15 at 11:38

Since $f: \mathbb R_{++} \to \mathbb R_{++}$ is settled in the comments, your idea is good. Write $f(x) = x^3 + 2x^2$ to reduce the complexity of $f(f(x))$ and then solve $$f(f(x)) = (x^3+2x^2)^3 + 2(x^3 + 2x^2)^2 \stackrel!= x \qquad x>0$$ We can expand this to $$x^9 + 6x^8 + 12x^7 + 8x^6 + 2x^6 + 8x^5 + 8x^4 - x = 0$$ Then divide by $x$ since $x\ne 0$ for $$x^8 + 6x^7 + 12x^6 + 8x^5 + 2x^5 + 8x^4 + 8x^3 - 1 = 0$$ WolframAlpha tells us there is only one positive root at $$x = \sqrt 2 - 1$$

• I got to that stage but thought it was too hideous, and so must be wrong. I think the solution had an error. Thanks anyway. – J.Gudal May 28 '15 at 15:01
• @AlexR The implication is not false in this case - see my answer. – Mario Carneiro May 28 '15 at 15:03
• @MarioCarneiro Yes, I saw it, but the solution should have mentioned why it wasn't false ;) – AlexR May 28 '15 at 15:05
• The solution assumed that $f(x)=x$ and so concluded that $x= \sqrt{2}-1$ – J.Gudal May 28 '15 at 15:06
• @J.Gudal I had a mistake in my original post. Fixed it not to come up with the same solution. – AlexR May 28 '15 at 15:10

If the problem were to find a solution of $f^{-1}(x)=f(x)$ with $x\gt0$, then the hint would be useful if the implication were reversed, i.e.,

$$f(x)=x\implies f^{-1}(x)=f(x)$$

Setting $x^2(x+2)=x$ leads to the equation

$$x^2+2x-1=0$$

which has positive solution $x=\sqrt2-1$.

But we can say more. Borrowing the degree-$8$ polynomial from AlexR's answer, we know that $x^2+2x-1$ must be a factor of it. And indeed it is:

$$x^8+6x^7+12x^6+10x^5+8x^4+8x^3-1=(x^2+2x-1)(x^6+4x^5+5x^4+4x^3+5x^2+2x+1)$$

and since the coefficients of $x^6+4x^5+5x^4+4x^3+5x^2+2x+1$ are all positive, the degree-$8$ polynomial has no other solutions with $x\gt0$. So $x=\sqrt2-1$ is not only a solution, it's the only solution.

f(x) = x^2(x+2)

Thus f(x) = a(x)b(x) where a(x) = x^2 and b(x) = x+2

The product rule tells us that:

f'(x) = 3x^2 + 4x

Thus solve for f(x) = f(x)':

x^2(x+2) = 3x^2 + 4x

x(x^2 -x - 4) = 0

Therefore x = 0; x = (1±sqrt[17])/2

• I think you may have misunderstood the question. – J.Gudal May 28 '15 at 15:17
• $f^{-1}$ and $f'$ are two completely different things... – AlexR May 28 '15 at 15:19
• My bad I thought you said f' – Benjamin Gunn May 28 '15 at 15:20