# Magdy's Exchanger

## Theorem

Magdy's Exchanger is a simple method to get a semi-algebraic formula for inverse trigonometric functions using the help of inverse hyperbolic functions that has a real logarthmic formula hence we will have an example to get the inverse sine function.

First:

$\displaystyle \arcsin x = \int \frac 1 {\sqrt{1 - x^2}} \, \mathrm d x$

Using Integration by Parts:

$\displaystyle \int \frac 1 {\sqrt{1-x^2}} \,\mathrm d x = -\frac {\sqrt {1-x^2}} x - \int \frac{\sqrt{1-x^2}} {x^2} \, \mathrm d x$

The problem is that the integration on the right hand side will inverse itself if we solve it by parts.

Then the result will be:

$0 = 0$

Magdy's method will come into effect now.

As we know the inverse hyperbolic function that is most similar to the inverse sine function is the inverse sinh function.

The idea is to get the last integration in the right hand side from the inverse sinh function.

So we use parts again on the derivative of inverse sinh as follows:

$\displaystyle \operatorname{arcsinh} x = \int \frac 1 {\sqrt{1 + x^2}} \, \mathrm d x$

 $\displaystyle \operatorname{arcsinh} x$ $=$ $\displaystyle \int \frac 1 {\sqrt{1 + x^2} } \, \mathrm d x$ Primitive of $\dfrac 1 {\sqrt {x^2 + a^2} }$ $\displaystyle$ $=$ $\displaystyle \frac {\sqrt {1 + x^2} } x + \int \frac {\sqrt {1 + x^2} } {x^2} \,\mathrm d x$ Integration by Parts $\displaystyle$ $=$ $\displaystyle \ln \left({x + \sqrt{x^2 + 1} }\right)$ Definition of Inverse Sinh Function
$\displaystyle \int \frac {\sqrt {1 + x^2} } {x^2} \, \mathrm d x = \ln \left({x + \sqrt{x^2 + 1} }\right) - \frac {\sqrt {1 + x^2} } x$

Taking the derivativeof both sides:

$\displaystyle \frac{\sqrt{1 + x^2} } {x^2} = \frac {1 + x^2 + x \sqrt{x^2 + 1} } {x^3 + x^2 \sqrt {x^2 + 1} } = A$

Squaring both sides:

$\dfrac {1 + x^2} {x^4} = A^2$

Now the most important step.

As we want to have $1 - x^2$ in the numerator we will have the fraction on the left hand side} as:

$\dfrac {1 - x^2 + 2 x^2} {x^4}$

which does not affect the value of the fraction.

Now the left hand side is:

$\dfrac {1 - x^2} {x^4} + \dfrac 2 {x^2}$

then the wanted fraction will be alone on the left hand side:

$\dfrac {1 - x^2} {x^4} = A^2 - \dfrac 2 {x^2}$

Taking the root of both sides:

$\dfrac {\sqrt{1 - x^2} } {x^2} = \sqrt {A^2 - \dfrac 2 {x^2} }$

then integrating both sides:

$\displaystyle \int \frac {\sqrt{1 - x^2} } {x^2} \, \mathrm d x = \int \sqrt{A^2 - \frac 2 {x^2}} \, \mathrm d x$

Now the right hand side is complicated but evaluates as follows:

$\displaystyle \int \sqrt{A^2 - \frac 2 {x^2} } \, \mathrm d x = \frac {x^2 \sqrt {\frac 1 {x^4} - \frac 1 {x^2} } \ln \left({2 \sqrt {x^2 - 1} + 2 x}\right)} {\sqrt {x^2 - 1} } - x \sqrt {\frac 1 {x^4} - \frac 1 {x^2} } + C$

Substituting the last result in the first equation of the inverse sine we get:

$\displaystyle \arcsin x = - \frac {\sqrt {1 - x^2} } x - \frac {x^2 \sqrt {\frac 1 {x^4} - \frac 1 {x^2} } \ln \left({2 \sqrt {x^2 - 1} + 2 x}\right)} {\sqrt {x^2 - 1}} + x \sqrt {\frac 1 {x^4} - \frac 1 {x^2} } + C$

Hence we get a semi-algebraic formula for the inverse sine function.

$\blacksquare$