# How to make squaring method of finding an inverse function to be invertible?

I've been trying to find an inverse of this function

$$f(x) = e^{-\left(\displaystyle \frac{x}{\sqrt{1-x^2}}\right) \displaystyle \pi }$$

These are the approaches

First approach using squaring method

\begin{align} y & = e^{-\left(\displaystyle \frac{x}{\sqrt{1-x^2}}\right) \displaystyle \pi }\\ \displaystyle \ln(y) & = \left(\displaystyle -\frac{x\pi}{\sqrt{1-x^2}}\right) \\ \displaystyle \left(\ln(y)\right)^2 & = \left(\displaystyle -\frac{x\pi}{\sqrt{1-x^2}}\right)^2 \\ \displaystyle \ln^2(y) & = \displaystyle \frac{x^2\pi^2}{1-x^2} \\ \displaystyle \ln^2(y) - \ln^2(y) x^2 & = x^2\pi^2 \\ \displaystyle \ln^2(y) & = x^2\left[\pi^2 + \ln^2(y)\right] \\ \displaystyle x^2 & = \frac{ \ln^2(y)} {\pi^2 + \ln^2(y)} \\ \displaystyle x & = \pm \sqrt{ \frac{\ln^2(y)} {\pi^2 + \ln^2(y)} }\\ \displaystyle \therefore\qquad f^{-1}(y)&={\pm\sqrt{\frac{\ln^2(y)}{\pi^2+\ln^2(y)}}}\\ \end{align}

Second approach using function composition method

The function $$f$$ is obviously defined for $$-1. It is the composition $$f=h\circ g$$ of the functions $$g:\quad x\mapsto u={x\over\sqrt{1-x^2}}\qquad{\rm and}\qquad h:\quad u\mapsto y:=e^{-\pi u}\ .\tag{1}$$

The function $$g$$ can be viewed as $$g=\tan\circ\arcsin$$, hence is strictly increasing, and maps $$\>]{-1},1[\>$$ bijectively to $${\mathbb R}$$. The function $$h$$ is strictly decreasing, and maps $${\mathbb R}$$ bijectively to $${\mathbb R}_{>0}$$. It follows that $$f=h\circ g:\ ]{-1},1[\>\to{\mathbb R}_{>0}$$ is a decreasing bijective map, and has a well defined inverse $$f^{-1}\!:\ {\mathbb R}_{>0}\to\>]{-1},1[\>$$. No multivaluedness whatsoever will arise.

From $$u^2(1-x^2)=x^2$$ we obtain $$x^2={u^2\over1+u^2}$$, hence $$x=\pm{u\over\sqrt{1+u^2}}\ .$$ At this point we can definitively resolve the $$\pm$$-ambiguity by inspection of $$(1)$$: The variables $$x$$ and $$u$$ have the same signs at all times, since $$\sqrt{1-x^2}$$ is $$\geq0$$ by definition. It follows that $$x={u\over\sqrt{1+u^2}}\ .\tag{2}$$ On the other hand, from $$y=e^{-\pi u}$$ we immediately obtain $$u=-{1\over\pi}\log y\ .\tag{3}$$ Coupling $$(2)$$ and $$(3)$$ together we get $$x=f^{-1}(y)={-{1\over\pi}\log y\over\sqrt{1+({1\over\pi}\log y)^2}}={-\log y\over\sqrt{\pi^2+(\log y)^2}}\qquad(y>0)\ ,$$ without any cases and ambiguities.

Third approach by using Symbolab in here

Fourth apporach by using WolframAlpha in here

Using squaring method the inverse is multivalued and has two value, therefore not invertible

Symbolab is also multivalued inverse, it's weird that it has four value, also not invertible

WolframAlpha is also multivalued inverse, but it only plot the negative value of it, it's weird, why even bother put $$\pm$$ sign in the first place?

This is related to my question before. In that answer, the approach of using function decomposition method seems to be the only ones that truly give the solution that is invertible. However, it is tedious and not straightforward as squaring method.

So my question, is there any way to make the squaring method approach above invertible? Is there any mistake that I made that make it not invertible?

## Edit

After seen the Somos answer and Lee David Chung Lin comments, i think it may be better to put their answer in this question itself

$$\begin{array}{rl} \displaystyle f(x) = \;\; y&= e^{-\left(\displaystyle \frac{x}{\sqrt{1-x^2}}\right) \displaystyle \pi }\\\\ \displaystyle \ln(y) & = \left(\displaystyle -\frac{x\pi}{\sqrt{1-x^2}}\right) \qquad\qquad (*) \\\\ \displaystyle \left(\ln(y)\right)^2 & = \left(\displaystyle -\frac{x\pi}{\sqrt{1-x^2}}\right)^2 \\\\ \displaystyle \ln^2(y) & = \displaystyle \frac{x^2\pi^2}{1-x^2} \\\\ \displaystyle \ln^2(y) - \ln^2(y) x^2 & = x^2\pi^2 \\\\ \displaystyle \ln^2(y) & = x^2\left[\pi^2 + \ln^2(y)\right] \\\\ \displaystyle x^2 & = \displaystyle \frac{ \ln^2(y)} {\pi^2 + \ln^2(y)} \\\\ \displaystyle x & = \displaystyle \pm \sqrt{ \frac{\ln^2(y)} {\pi^2 + \ln^2(y)} }\\\\ \displaystyle x & = \displaystyle \frac{ \pm\sqrt{\ln^2(y)}} {\sqrt{\pi^2 + \ln^2(y)} }\\\\\\ \end{array}$$

$$\text{Denumerator } \quad \rightarrow \sqrt{\pi^2 + \ln^2(y)} \;\; \text{ is always positive}\\ \text{Numerator } \qquad \rightarrow \pm\sqrt{\ln^2(y)} \qquad\,\text{ is related to } (*)$$ $$\begin{array}{c} \qquad\qquad\qquad\qquad\qquad\quad\;\displaystyle \text{ if } x \text{ is positive, then } \ln(y) = \ln(f(x)) \text{is negative}\\ \qquad\qquad\qquad\qquad\qquad\quad\;\displaystyle \text{and}\\ \qquad\qquad\qquad\qquad\qquad\quad\;\,\displaystyle \text{ if } x \text{ is negative, then } \ln(y) = \ln(f(x)) \text{is positive }\\\\\\ \end{array}$$

$$\displaystyle \therefore\qquad f^{-1}(y) = x = \frac{- \ln(y)}{\sqrt{\pi^2 + \ln^2(y)}}$$

The equality must be persistent, such that $$+ = +$$ and $$- = -$$

• The original $y = f(x) > 0$ by definition so you can just take the plus solution and discard the negative. Is there any reason that you unhappy with this? Oct 15, 2018 at 17:46
• @LeeDavidChungLin taking the plus solution and discard the negative will make not invertible inverse function as proved by the second approach. The function decompotition method is tedious, i would like to have a straightforward approach such as the squaring method Oct 15, 2018 at 17:57
• If you keep track of the signs, after discarding the negative solution, you should notice that $0 < y < 1$ so that $\log y$ is negative and $\sqrt{(\log y)^2}$ should carry a negative sign (or an absolute value $|\log y|$). This is standard procedure when taking square roots. Oct 15, 2018 at 18:15
• Simply because $y < 1$ such that $\log y < 0$. For example, when you know $u < 0$, then $\sqrt{u^2} = |u| = -u$. Here take $u = \log y$. How do we know $y = f(x) < 1$? In the beginning we see that $y = e^{ -\text{blah} }$ where the blah is positive by definition. Oct 15, 2018 at 23:52
• Namely, your direct-squaring-method yields exactly the same result as the function-composition analysis. Sometimes people actually keep the $\sqrt{ (\log y)^2 }$ for various reasons, e.g. having the entire fraction inside the square root such that $x = \sqrt{1 - 1/R(y)}$ where $R(y) = 1 + \left( \frac{\log y }{ \pi} \right)^2$. Oct 15, 2018 at 23:58

Given the definition of $$\,f(x),\,$$ then let us define $$h(x) := \ln(y) = \ln(f(x)) = -\Bigg(\frac{x}{\sqrt{1-x^2}}\Bigg)\pi. \tag1$$ Notice that if $$\, x > 0\,$$ then $$\, h(x) < 0.\,$$ In your last step you have, $$x = f^{-1}(y) ={\pm\sqrt{\frac{\ln^2(y)}{\pi^2+\ln^2(y)}}} = \frac{\pm\sqrt{\ln^2(y)}}{\sqrt{\pi^2+\ln^2(y)}}. \tag2$$ The numerator is either $$\,+\ln(y)\,$$ or $$\,-\ln(y),\,$$ but it must be $$\, -\ln(y).\,$$ Reason is the denominator is positive and if $$\,x = f^{-1}(y) >0\,$$ then the numerator must be positive also since $$\, h(x) = \ln(y) < 0 \,$$ for $$x>0.$$
• $\pm \sqrt{\ln^2(y)} = \pm \ln(y) = \pm -\Bigg(\frac{x}{\sqrt{1-x^2}}\Bigg)\pi = - \ln(y)$ Alright, the numerator sign is diminishing each other in order to be consistently same sign with $x$ if we substitute $\ln(y)$. I got it, thank you very much for your help and patience Oct 16, 2018 at 0:32