Solving $ \int \sqrt{1 + \tan(x)}\:dx$

176 Views Asked by At

I know this is lazy, but I was really hoping that someone could read over my work on this integral and let me know whether I've made any errors.

Here I will address the integral: \begin{equation} I = \int \sqrt{1 + \tan(x)}\:dx \nonumber \end{equation} Here let $u = \tan(x)$: \begin{equation} I = \int \sqrt{u + 1} \cdot \frac{1}{u^2 + 1}\:du = \int \frac{\sqrt{u + 1}}{u^2 + 1}\:du \nonumber \end{equation} Let $t^2 = u + 1$: \begin{equation} I = \int \frac{\left|t\right|}{\left(t^2 - 1\right)^2 + 1} \cdot 2t \:dt = 2 \int \frac{t\left|t\right|}{t^4 - 2t^2 + 2}\:dt = 2 \int \frac{t\left|t\right|}{\left(t^2 + t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2} \right)\left(t^2 - t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2} \right)}\:dt \nonumber \end{equation} Now: \begin{equation} \tan(x) + 1 \geq 0 \rightarrow u + 1 \geq 0 \rightarrow t^2 \geq 0 \nonumber \end{equation} Which implies that $t$ can be both positive and negative. Thankfully the solution to one is merely the negative of the other. Here we proceed with the case $t > 0$: \begin{align} I &= 2 \int \frac{t^2}{\left(t^2 + t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2} \right)\left(t^2 - t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2} \right)}\:dt \nonumber \\ &= 2 \cdot \frac{1}{\sqrt{2}\sqrt{\sqrt{2} + 1}} \int \left[\frac{t}{t^2 - t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}} - \frac{1}{2} \cdot \frac{t}{t^2 + t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}}\right]\:dt \nonumber \\ &= 2 \cdot \frac{1}{\sqrt{2}\sqrt{\sqrt{2} + 1}} \int \left[\frac{1}{2}\cdot \frac{2t - \sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}\sqrt{\sqrt{2} + 1}}{t^2 - t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}} -\frac{1}{2}\cdot \frac{2t + \sqrt{2}\sqrt{\sqrt{2} + 1} - \sqrt{2}\sqrt{\sqrt{2} + 1}}{t^2 + t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}}\right]\:dt \nonumber \\ &=\frac{1}{\sqrt{2}\sqrt{\sqrt{2} + 1}} \bigg[ \int \frac{2t - \sqrt{2}\sqrt{\sqrt{2} + 1} }{t^2 - t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}}\:dt + \int \frac{ \sqrt{2}\sqrt{\sqrt{2} + 1}}{t^2 - t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}}\:dt \nonumber \\ &\quad-\int \frac{2t + \sqrt{2}\sqrt{\sqrt{2} + 1} }{t^2 + t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}}\:dt + \int \frac{ \sqrt{2}\sqrt{\sqrt{2} + 1}}{t^2 + t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}}\:dt \bigg] \nonumber \\ &=\frac{1}{\sqrt{2}\sqrt{\sqrt{2} + 1}} \bigg[ \int \frac{2t - \sqrt{2}\sqrt{\sqrt{2} + 1} }{t^2 - t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}}\:dt + \int \frac{ \sqrt{2}\sqrt{\sqrt{2} + 1}}{\left(t - \frac{1}{2}\sqrt{2}\sqrt{\sqrt{2} + 1}\right)^2 + \sqrt{2} - \frac{\sqrt{2} + 1}{2}}\:dt \nonumber \\ &\quad-\int \frac{2t + \sqrt{2}\sqrt{\sqrt{2} + 1} }{t^2 + t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}}\:dt + \int \frac{ \sqrt{2}\sqrt{\sqrt{2} + 1}}{ \left(t + \frac{1}{2}\sqrt{2}\sqrt{\sqrt{2} + 1}\right)^2 + \sqrt{2} - \frac{\sqrt{2} + 1}{2}}\:dt \bigg] \nonumber \\ &= \frac{1}{\sqrt{2}\sqrt{\sqrt{2} + 1}} \bigg[\ln\left|t^2 - t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}\right| + \sqrt{2}\sqrt{\sqrt{2} + 1} \frac{1}{\sqrt{\sqrt{2} - \frac{\sqrt{2} + 1}{2}}}\arctan\left( \frac{t - \frac{1}{2}\sqrt{2}\sqrt{\sqrt{2} + 1}}{\sqrt{\sqrt{2} - \frac{\sqrt{2} + 1}{2}}}\right) \nonumber \\ &\quad+ \sqrt{2}\sqrt{\sqrt{2} + 1} \frac{1}{\sqrt{\sqrt{2} - \frac{\sqrt{2} + 1}{2}}}\arctan\left( \frac{t + \frac{1}{2}\sqrt{2}\sqrt{\sqrt{2} + 1}}{\sqrt{\sqrt{2} - \frac{\sqrt{2} + 1}{2}}}\right)- \ln\left|t^2 + t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}\right| \bigg] + C \nonumber \\ &= \frac{1}{\sqrt{2}\sqrt{\sqrt{2} + 1}}\ln\left| \frac{t^2 - t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}}{t^2 + t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}} \right| \nonumber \\ &\qquad+ \frac{1}{\sqrt{\sqrt{2} - \frac{\sqrt{2} + 1}{2}}}\bigg[\arctan\left( \frac{t - \frac{1}{2}\sqrt{2}\sqrt{\sqrt{2} + 1}}{\sqrt{\sqrt{2} - \frac{\sqrt{2} + 1}{2}}}\right) + \arctan\left( \frac{t + \frac{1}{2}\sqrt{2}\sqrt{\sqrt{2} + 1}}{\sqrt{\sqrt{2} - \frac{\sqrt{2} + 1}{2}}}\right)\bigg] + C \nonumber \\ &= \frac{1}{\sqrt{2}\sqrt{\sqrt{2} + 1}}\ln\left| \frac{t^2 - t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}}{t^2 + t\sqrt{2}\sqrt{\sqrt{2} + 1} + \sqrt{2}} \right| \nonumber \\ &\qquad+ \sqrt{\frac{2}{\sqrt{2} - 1}}\bigg[\arctan\left( \frac{\sqrt{2}t - \sqrt{\sqrt{2} + 1}}{\sqrt{\sqrt{2} - 1}}\right) + \arctan\left( \frac{\sqrt{2}t + \sqrt{\sqrt{2} + 1}}{\sqrt{\sqrt{2} - 1}}\right)\bigg] + C \nonumber \end{align} Where $C$ is the constant of integration and $t^2 = \tan(x) + 1$

3

There are 3 best solutions below

4
On

I know why you don't want to go over that again. :)

Why don't you instead make the substitution $$1+\tan x=u^2,$$ to obtain $$2\int{\frac{u^2}{1+(u^2-1)^2}\mathrm d u},$$ which may be easily done by parts, as follows, for example, $$u\int{\frac{2u}{1+(u^2-1)^2}\mathrm d u}-\int\cdots,$$ where the integral in the first summand is easy to do by using the substitution $u^2-1=y.$ This reduces the problem to dealing only with the second summand.

1
On

Too long for a comment.

You could have done it faster using $$\sqrt{1 + \tan(x)}=t \implies x=-\tan ^{-1}\left(1-t^2\right)\implies dx=\frac{2 t}{1+\left(1-t^2\right)^2} \,dt$$ making $$I=\int \sqrt{1 + \tan(x)}\,dx=\int \frac{2 t^2}{1+\left(1-t^2\right)^2} \,dt$$ Using now $$1+\left(1-t^2\right)^2=(t^2-(1-i))(t^2-(1+i))$$ and using partial fraction decomposition $$\frac{2 t^2}{1+\left(1-t^2\right)^2}=\frac{1+i}{t^2-(1-i)}+\frac{1-i}{t^2-(1+i)}$$ and then $$I=2 \left(-\frac{\tan ^{-1}\left(\frac{t}{\sqrt{-1-i}}\right)}{(-1-i)^{3/2}}-\frac{\tan ^{-1}\left(\frac{t}{\sqrt{-1+i}}\right)}{(-1+i)^{3/2}}\right)$$ Using later $$\frac{1}{\sqrt{-1-i}}=\frac{\sin \left(\frac{\pi }{8}\right)}{\sqrt[4]{2}}+i\frac{ \cos \left(\frac{\pi}{8}\right)}{\sqrt[4]{2}} \implies \frac 1{(-1-i)^{3/2}}=\frac{1+i}8$$ $$\frac{1}{\sqrt{-1+i}}=\frac{\sin \left(\frac{\pi }{8}\right)}{\sqrt[4]{2}}-i\frac{ \cos \left(\frac{\pi}{8}\right)}{\sqrt[4]{2}} \implies \frac 1{(-1+i)^{3/2}}=\frac{1-i}8$$

1
On

Let $1+\tan x= \sqrt2 t^2 $ in $$I=\int\sqrt{1+\tan x}\;dx,\>\>\>\>\> J=\int\frac1{\sqrt{1+\tan x}}\;dx $$ and integrate \begin{align} I+\sqrt2 J = &\ 2^{3/4} \int \frac{t^2+1}{t^4-\sqrt2 t^2 +1 }dt =\frac{2^{3/4}}{\sqrt{2-\sqrt2}} \tan^{-1}\frac{t-\frac1t}{\sqrt{2-\sqrt2}}\\ I-\sqrt2 J = &\ 2^{3/4} \int \frac{t^2-1}{t^2-\sqrt2t^2+1}dt =-\frac{2^{3/4}}{\sqrt{2+\sqrt2}} \coth^{-1}\frac{t+\frac1t}{\sqrt{2+\sqrt2}} \end{align}