# Evaluating $\int \frac{dx}{\sin x \sqrt{k^2+\sin^2 x}}$

Let $$k$$ and $$x$$ be real numbers. Let:

$$I= \int \frac{dx}{\sin x \sqrt{k^2+\sin^2 x}}$$

Let $$u=\sin x$$, then $$du=\sqrt{1-u^2}dx$$. Then

$$I= \int \frac{du}{u\sqrt{k^2+u^2}\sqrt{1-u^2}}$$

To go further any recommendations? Not sure if $$u=k\tan y$$ may help.

A mysterious solution. We apply the substitution

$$t = \frac{k\cos x}{\sqrt{k^2+\sin^2 x}}.$$

This substitution has the property that

$$\color{blue}{1 - t^2 = \frac{(k^2+1)\sin^2 x}{k^2+\sin^2 x}} \qquad\text{and}\qquad \color{red}{\mathrm{d}t = -\frac{k (k^2+1) \sin x}{(k^2+\sin^2 x)^{3/2}} \, \mathrm{d}x}.$$

Hence it follows that

\begin{align*} I &= \int \frac{\mathrm{d}x}{\sin x \sqrt{k^2 + \sin^2 x}} \\ &= \int \frac{1}{\sin x \sqrt{k^2 + \sin^2 x}} \color{red}{\biggl( -\frac{(k^2+\sin^2 x)^{3/2}}{k (k^2+1) \sin x} \, \mathrm{d}t \biggr)} \\ &= - \int \frac{\color{blue}{k^2+\sin^2 x}}{k \color{blue}{(k^2+1) \sin^2 x}} \, \mathrm{d}t \\ &= -\frac{1}{k} \int \frac{\mathrm{d}t}{1 - t^2}. \end{align*}

The last integral can be easily computed, yielding

$$I = -\frac{1}{k} \operatorname{artanh}(t) + \mathsf{C} = \bbox[padding:8px;border:1px navy dotted; color:navy;]{ - \frac{1}{k} \operatorname{artanh}\biggl(\frac{k \cos x}{\sqrt{k^2 + \sin^2 x}}\biggr) + \mathsf{C} }.$$

A less mysterious solution. Let $$p = \sqrt{k^2 + 1}$$ for simplicity. Then

\begin{align*} I &= \int \frac{\sin x}{(1-\cos^2 x)\sqrt{p^2-\cos^2 x}} \, \mathrm{d}x \\ &= - \int \frac{1}{(1-u^2)\sqrt{p^2-u^2}} \, \mathrm{d}u \tag{u=\cos x} \\ &= - \int \frac{\cosh\phi}{1 - k^2\sinh^2 \phi} \, \mathrm{d}\phi \tag{u=p\tanh\phi} \\ &= - \frac{1}{k} \operatorname{artanh}(k \sinh\phi) + \mathsf{C} \\ &= - \frac{1}{k} \operatorname{artanh}\biggl(\frac{k u}{\sqrt{p^2 - u^2}}\biggr) + \mathsf{C} \\ &= - \frac{1}{k} \operatorname{artanh}\biggl(\frac{k \cos x}{\sqrt{k^2 + \sin^2 x}}\biggr) + \mathsf{C}. \end{align*}

• Hi Sangchul! How are you my friend? I hope all is going well for you. Just curious ... where did you find the "mysterious solution?" Commented Dec 15, 2023 at 19:39
• Thank you. Can we go forward to express the result into logarithmic functions that are easier?
– Aria
Commented Dec 15, 2023 at 20:39
• "A mysterious solution" reminded me of Cleo!
– User
Commented Dec 15, 2023 at 22:03
• @MarkViola, Hi Mark, everything is going well, and hope you are too! The "mysterious solution" is in fact a "simplification" (or a "compression") of the second solution, combining the chain of substitutions $$u=\cos x, \qquad u = \sqrt{k^2+1}\tanh\phi, \qquad t=k\sinh\phi,$$ into one. Commented Dec 16, 2023 at 3:23
• @Aria, It is true that $\operatorname{artanh}x$ can be expanded into a logarithm function, but I am not sure whether the resulting answer will be neater. Commented Dec 16, 2023 at 3:25

Hint Rewrite the integral as $$\int \frac{\sin x}{(1 - \cos^2 x) \sqrt{k^2 + 1 - \cos^2 x}} \,dx,$$ which suggests the substitution $$\cos x = \sqrt{k^2 + 1} \sin \theta, \qquad - \sin x \,dx = \sqrt{k^2 + 1} \cos \theta \,d\theta ,$$ which in turn yields an integrand rational in $$\sin \theta, \cos \theta$$: $$\int \frac{d\theta}{k^2 - (1 + k^2) \cos^2 \theta} .$$ Now, the substitution $$t = \tan \theta$$ rationalizes the integral: $$\int \frac{dt}{k^2 t^2 - 1} .$$

$$- \frac1k \operatorname{artanh} k t + C = \boxed{-\frac1k \operatorname{artanh} \frac{k \cos \theta}{k^2 + \sin^2 \theta} + C}$$

• Thanks can we express the results in terms of natural logarithms?
– Aria
Commented Dec 15, 2023 at 21:58
• Yes, via $\operatorname{artanh} u = \log \frac{1 + u}{1 - u}$. Commented Dec 16, 2023 at 5:49

Multiplying the numerator and denominator by $$\sec^2x$$ and letting $$t=\tan x$$ yields $$I=\int \frac{\sec ^2 x d x}{\tan x \sqrt{k^2 \sec ^2 x+\tan ^2 x}}= \int \frac{d t}{t \sqrt{k^2+\left(k^2+1\right) t^2}}= \int \frac{td t}{t^2 \sqrt{k^2+\left(k^2+1\right) t^2}}$$ $$\text { Let } \quad y=\sqrt{k^2+\left(k^2+1\right) t^2}$$, then \begin{aligned} I & =\int \frac{d y}{y^2-k^2} \\ & =\frac{1}{2 k} \ln \left|\frac{y-k}{y+k}\right|+C \\ & =\frac{1}{2 k} \ln \left|\frac{\sqrt{k^2+\left(k^2+1\right) t^2}-k}{\sqrt{k^2+\left(k^2+1\right) t^2}+k}\right|+C\\ & =\frac{1}{2 k} \ln \left|\frac{\sqrt{k^2 \sec ^2 x+\tan ^2 x}-k}{\sqrt{k^2 \sec ^2 x+\tan ^2 x+k}}\right|+C \\ & =\frac{1}{2 k} \ln \left|\frac{\sqrt{k^2+\sin ^2 x}-k\cos x}{\sqrt{k^2+\sin ^2 x}+k \cos x}\right|+C \end{aligned} Wish it helps.

I might be incorrect and it's been a while since I did u-substitution. But you should combine the square roots: $$I=\int\dfrac{du}{u\sqrt{k^2-k^2u^2+u^2-u^4}}$$Then you can replace $$u$$ with $$k\tan(y)$$ and further simplify it.

• What you can do instead is differentiate both sides of this answer that WA gets and work backward by integrating each step of the process. Commented Dec 16, 2023 at 0:39