A Mathematical Allegory

We have defined function y = \arcsin(x) as a set:

\{(x, y) | \sin(y) =x, \frac{-\pi}{2} \le y \le \frac{\pi}{2}\}.

By definition,

\arcsin(-1) = \frac{-\pi}{2}, \arcsin(0)=0, \arcsin(1) = \frac{\pi}{2}

and

\frac{d}{dx} \arcsin(x) = \frac{1}{\sqrt{1-x^2}}.

It means that \arcsin(x) is the unique solution of

\frac{dy}{dx} = \frac{1}{\sqrt{1-x^2}}\quad\quad\quad(\star)

where y(-1)=-\frac{\pi}{2}, y(0)=0 and y(1)=\frac{\pi}{2}.

To compute \arcsin(x), we solve (\star) for y(x) as follows:

Integrate \frac{dy}{dx} = \frac{1}{\sqrt{1-x^2}} from -1 to x gives

\displaystyle\int\limits_{-1}^{x}\frac{dy}{dx} \,dx=\displaystyle\int\limits_{-1}^{x}\frac{1}{\sqrt{1-\xi^2}}\; d\xi\overset{\textbf{FTC}}{\implies}y(x) - y(-1) = \displaystyle\int\limits_{-1}^{x} \frac{1}{\sqrt{1-\xi^2}}\, d\xi.

Therefore,

y(x) = \displaystyle\int\limits_{-1}^{x}\frac{1}{\sqrt(1-\xi^2}\,d\xi + y(-1) \overset{y(-1)=\frac{-\pi}{2}}{=} \displaystyle\int\limits_{-1}^{x}\frac{1}{\sqrt{1-\xi^2}}\,d\xi - \frac{\pi}{2}.

That is,

\arcsin(x) = \displaystyle\int\limits_{-1}^{x} \frac{1}{\sqrt{1-\xi^2}}\;d\xi - \frac{\pi}{2}.

To obtain \arcsin(x), -1 < x < 1, we numerically evaluate \int\limits_{-1}^{x}\frac{1}{\sqrt{1-\xi^2}}\,d\xi, using function ‘quad_qags’.

Fig. 1

The result is visually validated in Fig. 2.

Fig. 2

Note: ‘romberg’, another function that computes the numerical integration by Romberg’s method will not work since it evaluates \frac{1}{\sqrt{1-x^2}} at x=-1.

Fig. 3

An alternate approach is to solve \frac{dy}{dx} = \frac{1}{\sqrt{1-x^2}}, y(0)=0 as an initial-value problem of ODE using ‘rk’ , the function that implements the classic Runge-Kutta algorithm.

Fig. 4 for 0 < x < 1

Fig. 5 -1<x<0

Putting the results together, we have

Fig. 6 -1<x<1

However, we cannot solve \frac{dy}{dx} = \frac{1}{\sqrt{1-x^2}}, y(-1)=\frac{-\pi}{2} using ‘rk’:

Fig. 7


Exercise-1 Compute \arccos(x) for x \in (-1, 1).

Exercise-2 Explain why ‘rk’ cannot solve \frac{dy}{dx} = \frac{1}{\sqrt{1-x^2}}, y(-1)=\frac{-\pi}{2}.

Finding Derivative the “Hard” Way

In “Instrumental Flying“, we defined \cosh^{-1}(x), \sinh^{-1}(x) as the inverse of \cosh(x) and \sinh(x) repectively.

To find the derivative of \cosh^{-1}(x), let

y = \cosh^{-1}(x).

We have

x = \cosh(y).

Differentiate it,

\frac{d}{dx} x = \frac{d}{dx} \cosh(y) \implies 1=\frac{d}{dy} \cosh(y)\cdot \frac{dy}{dx},

i.e.,

1 = \sinh(y) \frac{dy}{dx}\implies \frac{dy}{dx} = \frac{1}{\sinh(y)}.

By \cosh(y)^2-\sinh(y)^2=1 (see Exercise-1) and \cosh(y) \ge 1 (see Exrecise-2),

\sinh(y)^2 = \cosh(y)^2-1 \implies |\sinh(y)| = \sqrt{x^2-1} \overset{ (\star) }{\implies} \sinh(y) = \sqrt{x^2-1}.

And so,

\frac{dy}{dx} = \frac{1}{\sqrt{x^2-1}} \implies \boxed{\frac{d}{dx}\cosh^{-1}(x) = \frac{1}{\sqrt{x^2-1}}}.


Similarly, to find \frac{d}{dx}\sinh^{-1}(x), let

y = \sinh^{-1}(x)\implies x=\sinh(y).

Differentiate it,

\frac{d}{dx} x = \frac{d}{dx}\sinh(y) = \frac{d}{dy}\sinh(y)\frac{dy}{dx}\implies 1 = \cosh(y)\cdot\frac{dy}{dx}.

By \cosh(x)^2-\sinh(x)^2=1, \cosh(y) \ge 1 and \cosh(y) \ge 1,

\cosh(y) = \textbf{+}\sqrt{\sinh(y)^2+1} = \sqrt{x^2+1}.

Therefore,

1 = \sqrt{x^2+1}\frac{dy}{dx} \implies \boxed{\frac{d}{dx}\sinh^{-1}(x) = \frac{1}{\sqrt{x^2+1}}}.


Prove:

\forall x \ge 0, \sinh(x) \ge 0.\quad\quad\quad(\star)

By definition,

\sinh(x) = \frac{e^x-e^{-x}}{2} = \frac{e^{2x}-1}{2 e^{x}} \ge 0, since \forall x>0, e^{x},e^{2x} \ge 1 (see Exercise-3).


Exercise-1 Show that \forall x \in R, \cosh(x)^2 - \sinh(x)^2 =1.

Exercise-2 Show that \forall x \in R, \cosh(x) \ge 1.

Exercise-3 Show that \forall x \ge 0, e^{x} \ge 1.

Exercise-4 Differentiate \cos^{-1}(x), \sinh^{-1}(x) directly (hint: see”Deriving Two Inverse Functions“).