# Definite integral $\int_{0}^{\pi/2}\ 1/ (1+(\tan x)^{1/2})\ dx$

$$\int_{0}^{\pi/2}\ \frac{1}{ 1+(\tan x)^{1/2}}\ dx$$

I have no idea how to evaluate this. I have tried many substitutions, but they just didn’t result in the answer.

Update:

As a remainder, if one wants to integrate a similar question, $$\int_{0}^{\pi/2}\ 1/ (1+(tanx)^{\sqrt2})\ dx$$ , refer to this Evaluate $\int_0^\pi\frac{1}{1+(\tan x)^\sqrt2}\ dx$ .

Both of them were what I want to ask. I have tried many ways to find their anti-derivatives; however, in cases of this type (definite integral with a complicated integrand), their indefinite integral could not even be expressed in basic functions, let alone use Fundamental theorem of calculus II to evaluate them. Suitably using the brilliant method given below can directly lead to the answer.

Thank you very much.

• Where did you see this integral? Commented Mar 28, 2020 at 5:11
• Did you try $t=\tan x$? Commented Mar 28, 2020 at 5:14
• @AnginaSeng Yes. It leaded to a still very complicated integration seeming equally hard to evaluate. Commented Mar 28, 2020 at 6:26
• math.stackexchange.com/questions/605673/… Commented Apr 1, 2020 at 17:52

There is a trick you can use here.

Let $$I$$ be the integral you want. It turns out that $$\int_0^\frac{\pi}{2} \frac{\mathrm{d}x}{1 + \mathrm{cot}(x)^{0.5}}$$ is also equal to $$I$$. You can see this by substituting $$y = \frac{\pi}{2} - x$$ in the original equation, or by drawing graphs of the tangent and cotangent functions and seeing that they are symmetric in this domain - both methods are essentially the same.

So we can add the two.

$$2I = \int_0^\frac{\pi}{2} \left(\frac{1}{1 + \mathrm{tan}(x)^{0.5}} + \frac{1}{1 + \mathrm{cot}(x)^{0.5}} \right) \mathrm{d}x$$

Since $$\mathrm{tan}(x) = \mathrm{cot}(x)^{-1}$$, this simplifies to

$$2I = \int_0^\frac{\pi}{2} \left(\frac{1}{1 + \mathrm{tan}(x)^{0.5}} + \frac{\mathrm{tan}(x)^{0.5}}{\mathrm{tan}(x)^{0.5} +1} \right) \mathrm{d}x$$

Which works out (everything cancels!) to $$2I = \int_0^\frac{\pi}{2} \mathrm{d}x$$

So $$I = \frac{\pi}{4}$$. Funnily enough, this is true whatever be the power to which the tangent is raised.

• Such a brilliant trick! Commented Mar 28, 2020 at 5:34
• @Tienhu, I'd have to agree with you there - I was was quite impressed by it also. If you are happy with my solution, could you consider marking it as the answer? Commented Mar 30, 2020 at 11:48
• @arvenka Wow I just realised what you did is like a geometric version of kings rule. I have never thought of it this way. So intutive and clear,thanks! :) +1 from me Commented Apr 1, 2020 at 17:30

Let $$u = \tan x$$, then $$\mathrm{d}u = \sec^2 x~\mathrm{d}x$$ and $$\mathrm{d}x = \dfrac{\mathrm{d}u}{1+u^2}$$. So:

$$I=\int_{0}^{\pi/2}\frac{1}{1+\sqrt{\tan x}}\mathrm{d}x=\int_{0}^{\infty}\frac{1}{(1+\sqrt{u})(1+u^2)}\mathrm{d}u$$ then let $$t=\sqrt{u}$$ where $$\mathrm{d}t=\dfrac{1}{2\sqrt{u}}\mathrm{d}u$$ and the integral becomes

$$I=\int_0^{\infty}\frac{2t}{(1+t)(1+t^4)}\mathrm{d}t$$

which can then be solved by repeated partial fraction decomposition. Alternatively, a similar approach taken to the one in Hrishabh's answer seems to work out much better:

$$I=\int_{0}^{\pi/2}\frac{1}{1+\sqrt{\tan x}}\mathrm{d}x=\frac{1}{1+\sqrt{\frac{\sin x}{\cos x}}}\mathrm{d}x$$

multiply $$I$$ by $$\sqrt{\cos x}$$ to form

$$I=\int_{0}^{\pi/2}\frac{\sqrt{\cos x}}{\sqrt{\cos x}+\sqrt{\sin x}}\mathrm{d}x\tag{1}$$

then apply

$$\int_a^b f(x)\mathrm{d}x=\int_a^b f(a+b-x)\mathrm{d}x$$

to form

$$I=\int_{0}^{\pi/2}\frac{\sqrt{\cos \left(\frac{\pi}{2}-x\right)}}{\sqrt{\cos \left(\frac{\pi}{2}-x\right)}+\sqrt{\sin \left(\frac{\pi}{2}-x\right)}}\mathrm{d}x$$

where since $$\cos \left(\frac{\pi}{2}-x\right)=\sin x$$ and $$\sin\left(\frac{\pi}{2}-x\right)=\cos x$$ we get

$$I=\int_{0}^{\pi/2}\frac{\sqrt{\sin x}}{\sqrt{\sin x}+\sqrt{\cos x}}\mathrm{d}x\tag{2}$$ therefore adding $$(1)$$ and $$(2)$$ $$2I=\int_{0}^{\pi/2}\frac{\sqrt{\sin x}+\sqrt{\cos x}}{\sqrt{\sin x}+\sqrt{\cos x}}\mathrm{d}x=\int_{0}^{\pi/2}\mathrm{d}x$$ hence

$$I=\frac{\pi}{4}$$

which certainly appears to be a better approach than dealing with the partial fraction decomposition in the first method.

• Surely the second one is better. Actually, the king’s rule used in the second approach can be used to evaluate integral involving any exponential of tanx. Reference: youtu.be/9xaGYqiOkPM Commented Mar 28, 2020 at 6:51

Try to write $$\sqrt {tanx}$$ in terms of sin x and cos x i.e $$\sqrt {tanx} = {\sqrt {sinx} \over \sqrt {cosx}}$$

Then multiply numerator and denominator of integrand with $$\sqrt {cosx}$$

Then integral turns

$$\int_0^{\pi \over 2} {\sqrt {cosx} \over \sqrt {sinx}+\sqrt {cosx}} dx=I..(let)$$

Now use kings rule $$\int_{a}^{b}f(x)dx=\int_{a}^{b}f(a+b-x)dx$$

Then the integrand becomes$$\int_0^{\pi \over 2} {\sqrt {sinx} \over \sqrt {sinx}+\sqrt {cosx}}dx=I$$

Add these two forms of $$I$$

Now you have$$2I=\int_0^{\pi \over 2} 1 dx$$

Which is pretty easy to evaluate so you get$$I={\pi \over 4}$$

$$\int_{0}^{\pi/2}\ 1/ (1+(tanx)^{1/2})\ dx= {\pi \over 4}$$

You may notice that the exponent of tan x is irrelevant here as it does not affect any of the above calculation

• It seems this kings rule is important in evaluating complicated definite integrals. Commented Mar 28, 2020 at 6:02

\begin{align*} & \int_0^{\tfrac\pi2} \frac{dx}{1+\sqrt{\tan x}} \\ &= \int_0^\infty \frac{2y}{(1+y)\left(1+y^4\right)} \, dy \tag1 \\ &= \int_0^1 \frac{2y}{1+y^4} \, dy \tag2 \\ &= \int_0^1 \frac{dz}{1+z^2} \tag3 \end{align*}

• $$(1)$$ : substitute $$y=\sqrt{\tan x}$$
• $$(2)$$ : split the integral at $$y=1$$ and substitute $$y\mapsto\dfrac1y$$ in the integral over $$[1,\infty)$$, then recombine
• $$(3)$$ : substitute $$z=y^2$$

Furthermore, between steps $$(1)$$ and $$(2)$$, partial fraction expansion/recombination helps in finding an antiderivative w.r.t. $$y$$ in terms of $$\arctan$$ and $$\ln$$.

$$\frac{2y}{(1+y)\left(1+y^4\right)} = -\frac1{1+y} + \frac{1-(\sqrt2-1)y}{2(1-\sqrt2\,y+y^2)} + \frac{1+(\sqrt2+1)y}{2(1+\sqrt2\,y+y^2)}$$