# Calculation of $\int \sqrt{\tan x+2}dx$

Calculation of $\displaystyle \int\sqrt{\tan x+2}\;dx$

$\bf{My\; solution::}$ Let $\displaystyle \tan x+2 = t^2$, Then

$$\displaystyle \sec^2 (x)dx = 2tdt\Rightarrow dx = \frac{2t}{1+\tan^2 x}dt = \frac{2t}{1+(t^2-2)^2}dt$$

So Integral convert into $$\displaystyle \int \frac{2t^2}{(t^2-2)^2+1^2}dt$$

Let $\displaystyle (t^2-2) = u\Rightarrow t^2=u+2\;,$ Then $\displaystyle tdt=\frac{1}{2}du$

Now How can i solve after that

Thanks

• When you got $\int \frac{1}{1+(t-2)^2}dt$, couldn't you just substitute $t-2$ by $u$, getting $\int \frac{1}{1+u^2}du$, that is equal to $\arctan(u)+c$? – JPLF Jan 4 '14 at 13:57
• Thanks JPLF you are saying Right.... – juantheron Jan 4 '14 at 14:02

Using your substitution \begin{equation*} t=\sqrt{\tan x+2} \end{equation*} we need to integrate \begin{equation*} \frac{I}{2}=\frac{1}{2}\int \sqrt{\tan x+2}\,dx=\int \frac{t^{2}}{\left( t^{2}-2\right) ^{2}+1}\,dt+C, \end{equation*} as you show in your edited question. We can reduce it to a table integral if we factorize the denominator \begin{equation*} t^{4}-4t^{2}+5=\left( t^{2}+\sqrt{4+\sqrt{20}}t+\sqrt{5}\right) \left( t^{2}- \sqrt{4+\sqrt{20}}t+\sqrt{5}\right) \end{equation*} and expand the integrand into partial fractions \begin{equation*} \frac{t^{2}}{t^{4}-4t^{2}+5}=\frac{At}{t^{2}+\sqrt{4+\sqrt{20}}t+\sqrt{5}}- \frac{At}{t^{2}-\sqrt{4+\sqrt{20}}t+\sqrt{5}}, \end{equation*} where \begin{equation*} A=-B=-\frac{1}{4}\sqrt{4+\sqrt{20}}\left( -2+\sqrt{5}\right) . \end{equation*} The standard integral we need is the following one \begin{equation*} \int \frac{t}{t^{2}+bt+c}\,dt=\frac{1}{2}\ln \left\vert t^{2}+bt+c\right\vert -\frac{b}{\sqrt{4c-b^{2}}}\arctan \frac{2t+b}{\sqrt{ 4c-b^{2}}}+C,\qquad 4c-b^{2}>0. \end{equation*} In the case at hand $4c-b^{2}=4\sqrt{5}-\left( 4+\sqrt{20}\right) =2\sqrt{5} -4>0$. So

\begin{eqnarray*} \int \frac{t}{t^{2}+\sqrt{4+\sqrt{20}}t+\sqrt{5}}dt &=&\frac{1}{2}\ln \left\vert t^{2}+\sqrt{4+\sqrt{20}}t+\sqrt{5}\right\vert \\ &&-\frac{\sqrt{4+\sqrt{20}}}{\sqrt{2\sqrt{5}-4}}\arctan \frac{2t+\sqrt{4+ \sqrt{20}}}{\sqrt{2\sqrt{5}-4}}+C, \end{eqnarray*} and \begin{eqnarray*} \int \frac{t}{t^{2}-\sqrt{4+\sqrt{20}}t+\sqrt{5}}dt &=&\frac{1}{2}\ln \left\vert t^{2}-\sqrt{4+\sqrt{20}}t+\sqrt{5}\right\vert \\ &&+\frac{\sqrt{4+\sqrt{20}}}{\sqrt{2\sqrt{5}-4}}\arctan \frac{2t-\sqrt{4+ \sqrt{20}}}{\sqrt{2\sqrt{5}-4}}+C. \end{eqnarray*} We thus get \begin{eqnarray*} \frac{I}{2} &=&A\left( \frac{1}{2}\ln \left\vert t^{2}+\sqrt{4+\sqrt{20}}t+ \sqrt{5}\right\vert -\frac{\sqrt{4+\sqrt{20}}}{\sqrt{2\sqrt{5}-4}}\arctan \frac{2t+\sqrt{4+\sqrt{20}}}{\sqrt{2\sqrt{5}-4}}\right) \\ &&-A\left( \frac{1}{2}\ln \left\vert t^{2}-\sqrt{4+\sqrt{20}}t+\sqrt{5}% \right\vert +\frac{\sqrt{4+\sqrt{20}}}{\sqrt{2\sqrt{5}-4}}\arctan \frac{2t- \sqrt{4+\sqrt{20}}}{\sqrt{2\sqrt{5}-4}}\right) +C. \end{eqnarray*} Substituting back $t=\sqrt{\tan x+2}$ we get the given integral $I=\frac{2I}{ 2}=\int \sqrt{\tan x+2}\,dx$.

$$u=\sqrt{\tan x+2}$$ Then $$x=\tan^{-1}(u^2-2)$$ finding dx is easy, then substitute directly.