# How to find $\int_0 ^ \frac{\pi}{2} \frac{\cot x}{\cot x + \csc x}\,dx \,$?

How to find $$\int_0 ^ \frac{\pi}{2} \frac{\cot x}{\cot x + \csc x}\,dx \,\,?$$

The integrand $$\frac{\cot x}{\cot x + \csc x}$$ is not defined at $$x =0$$. But the function is bounded on $$(0 , \frac{\pi}{2}]$$. $$\lim _{x \to 0} \frac{\cot x}{\cot x + \csc x} = 0$$ So this is not an improper integral.

My Attempt : $$\int_0 ^ \frac{\pi}{2} \frac{\cot x}{\cot x + \csc x} = \lim_{t \to 0} \int_t ^ \frac{\pi}{2} \frac{\cot x}{\cot x + \csc x} = \lim_{t \to 0} \left[(\frac{\pi}{2} - 1)+ (\tan{\frac{t}{2} - t})\right] = \left(\frac{\pi}{2} - 1\right)$$.

I know how to find the anti-derivative of the integrand. I first found out the anti-derivative of the integrand in $$[t , \frac{\pi}{2}]$$ , where $$0 < t < \frac{\pi}{2}$$. Let's say it is $$\phi(t)$$. Then I find $$\lim_{t \to 0} \phi(t)$$. I am not sure if this is a right way. Can anyone please check it?

• Your attempt looks correct to me. – NoName Jul 15 '20 at 6:31
• Since the integral is proper you don't need to take limits. Rather try to find a function $F$ which is continuous on $[0,\pi/2]$ and the derivative $F'$ equals the integrand on $(0,\pi/2)$. The Fundamental Theorem of Calculus then says that the integral is $F(\pi/2)-F(0)$. – Paramanand Singh Jul 15 '20 at 11:37
• See math.stackexchange.com/a/3754943/72031 for the statement of FTC. – Paramanand Singh Jul 15 '20 at 11:38
• Can you please give me the proof of this link's theorem? I am quite curious to see how it is being possible..@ParamanandSingh – sani Jul 20 '20 at 11:26

$$\int_0 ^ \frac{\pi}{2} \frac{\cot x}{\cot x + cosec x} dx=\int_{0}^{\pi/2} \frac{\cos x}{1+\cos x} dx=\pi/2-\int_{0}^{\pi/2} \frac{dx}{1+\cos x} dx$$ $$=\pi/2-\frac{1}{2}\int_{0}^{\pi/2} \sec^2(x/2)~dx=\pi/2-\tan x |_{0}^{\pi/2}=\pi/2-1.$$

• I know how to solve it. I was asking about the point $0$ where the integrand is not defined. This is also not an improper integral. Is my attempt fine? 2Dr Zafar – sani Jul 15 '20 at 7:20
• But the function in the first place is not defined at $x = 0$. – sani Jul 15 '20 at 7:30
• I do not think You can change the function for your convenience in this way. – sani Jul 15 '20 at 7:31
• @sam for the integral to exist either $f(0)$ or $\lim_{x \to 0} f(x)$ should be finite. So in your case $f(x)=\frac{\cot x}{\cot x+\csc x}$, $f(0)=\frac{\infty}{\infty}$ (undefined), but $\lim_{x \to 0} f(x)=1$, by L-Hospital's rule, or just by simplifying $f(x)$. – Z Ahmed Jul 15 '20 at 7:38
• @sani: it does not matter if the integrand is not defined at a finite number of points. At those points you can define the function in any manner. However what is more important that the function remains bounded and the interval of integration is also bounded. Otherwise we need to use the idea of improper integrals. – Paramanand Singh Jul 15 '20 at 11:34

my solution $$\int_0 ^ \frac{\pi}{2} \frac{\cot x}{\cot x + \csc x}\mathrm{d}x$$ $$=\int_0 ^ \frac{\pi}{2} \frac{\cot x(\csc x-\cot x)}{\csc^2 x-\cot^2x}\mathrm{d}x$$ $$=\int_0 ^ \frac{\pi}{2} \csc x\cot x-\cot^2 x)\mathrm{d}x$$

$$=\int_0 ^ \frac{\pi}{2} \csc x\cot x-\csc^2 x+1)\mathrm{d}x$$

$$=(-\csc x+\cot x+x)_0^{\pi/2}$$ $$=\frac{\pi}{2}-1$$

• I know how to solve it. I was asking about the point $0$ where the integrand is not defined. This is also not an improper integral. Is my attempt fine? @Jyee Fischer – sani Jul 15 '20 at 7:19


• I know how to solve it. I was asking about the point $0$ where the integrand is not defined. This is also not an improper integral. Is my attempt fine? @Felix Marin – sani Jul 15 '20 at 7:20

HINT: Take , $$\cot x- \csc x=t$$

then, $$\cot x+ \csc x=\frac{1}{t}$$

and $$\cot x=\frac{1}{2}\left[t+\frac{1}{t}\right]$$

I think you can proceed from here.

• I know how to solve it. I was asking about the point $0$ where the integrand is not defined. This is also not an improper integral. Is my attempt fine? – sani Jul 15 '20 at 7:20
• @sam That is why I reshuffled (simplified) the integrand which is finite everywhere in $[0,\pi/2]$. For example $frac{x}{x+x^2}=\frac{1}{1+x}$ is finite at $x=0$. – Z Ahmed Jul 15 '20 at 7:28
• At $x = 0$ , what is $t = ?$@Venkat Amith – sani Jul 15 '20 at 7:33
• At $x=0$ then $t=$, $cotx- cosecx=t$ , $\frac{cosx-1}{sinx}$, $t=-Tan(\frac{x}{2})$ then $t=0$ at $x=0$. @sani – Anonymous Jul 15 '20 at 9:15