# If $f\left(x\right)=-\frac{x\left|x\right|}{1+x^{2}}$ then find $f^{-1}\left(x\right)$

Q:

If $$f\left(x\right)=-\frac{x\left|x\right|}{1+x^{2}}$$ then find $$f^{-1}\left(x\right)$$

My approach:

1. Dividing the cases when $$x\ge0$$ and when $$x\le0$$ to break free of modulus.
2. Re-arranging the terms to get the expression of x in terms of y.
3. Here's what I got:

When $$x\ge0$$: $$x=\sqrt{\frac{-y}{1+y}}$$ $$\to\ y\ ∈\ \left(-1,0\right] Now, y\to x$$ so, $$f^{-1}\left(x\right)=\sqrt{-\frac{x}{1+x}}$$ when $$x\le0$$

When $$x\le0$$: $$x=-\sqrt{\frac{y}{1-y}}$$ when $$y\ ∈\ \left[0.1\right)$$ Now replacing $$y\to x$$ We get, $$f^{-1}\left(x\right)=-\sqrt{\frac{x}{1-x}}\ ;\ x\ge0$$

But I have to show that the inverse function $$f^{-1}\left(x\right)$$=$$\operatorname{sgn}\left(-x\right)\sqrt{\frac{\left|x\right|}{1-\left|x\right|}}$$

This is where I'm getting stuck. I am unable to convert my answer into this form, mainly because I'm not able to convert the cases into this expression. Is there any step-by-step systematic way in which I can do the same? Any help or guide will be greatly appreciated.

Edit:

Since we got $$f^{-1}\left(x\right)$$ and the cases,:

$$f^{-1}\left(x\right)=-\sqrt{\frac{x}{1-x}}\ ;\ x\ge0$$ and $$f^{-1}\left(x\right)=\sqrt{-\frac{x}{1+x}}$$ when $$x\le0$$,

to write it in given form we need something that will give - sign when $$x>0$$ so we will use sgn(-x), and rest is just use of modulus so that we can make the general answer.

The sign function is given by

$$\operatorname{sgn}(x)=\begin{cases}-1, \space\text{if}\space x<0\\ 0, \space\space\text{if}\space x=0\\1, \space\text{if}\space x>0\end{cases}$$

and the modulus of $$x$$ is given by

$$|x|=\begin{cases}x, \space\text{if}\space x\geq0\\ -x, \space\text{if}\space x<0\\\end{cases}$$

Thus the inverse can be written as

$$f^{-1}\left(x\right)=\operatorname{sgn}\left(-x\right)\sqrt{\frac{\left|x\right|}{1-\left|x\right|}}=\begin{cases}-\sqrt{\frac{x}{1-x}}, \space\text{if} \space x\geq0 \\ \sqrt{\frac{-x}{1+x}}, \space\text{if} \space x<0 \end{cases}$$

• I edited my answer, is that method good now? it makes it easier to understand.
– Vega
Sep 11 at 6:19
• Yes, it's good now. Note that $y$ and $x$ are variables, so you can write $f^{-1}(x)=-\sqrt{\frac{x}{1-x}}$ for $x\geq0$ or $f^{-1}(y)=-\sqrt{\frac{y}{1-y}}$ for $y\geq0$ (which are both correct), but in most cases the former is used since we are working in $x$. For example if you want to plot both a function and it's inverse and use the same axes for both, then it's better to use $f(x)$ and $f^{-1}(x)$. Sep 11 at 6:23

What you have done is correct. All you have to do is switch $$x$$ and $$y$$. You writing $$f^{-1}(y)$$ in terms of $$y$$ so change $$y$$ to $$x$$ to get $$f^{-1}(x)$$. Note that $$f(x)$$ is positive precisely when $$x$$ is positive.

However you can also avoid considering the cases $$x \geq 0$$ and $$x,$$ by taking absolute values:

$$|f(x)|=\frac {x^{2}} {1+x^{2}}$$ which gives $$|x|=\frac 1{\sqrt {1-|f(x)|}}$$. Now calculate $$x$$ from $$f(x)=-\frac {x|x|} {1+x^{2}}$$.

• But how do I proceed with my method, if possible?
– Vega
Sep 11 at 5:55
• @Vega I have edited my answer. Sep 11 at 6:01
• >Note that f(x) is positive precisely when x is positive. This is where I was facing trouble. I tried again and I think I got it.
– Vega
Sep 11 at 6:06