# 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

$$\newcommand{\bbx}{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}{\displaystyle{#1}} \newcommand{\expo}{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}{\mathcal{#1}} \newcommand{\mrm}{\mathrm{#1}} \newcommand{\pars}{\left(\,{#1}\,\right)} \newcommand{\partiald}[]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}{\left\vert\,{#1}\,\right\vert}$$ \begin{align} \int_{0}^{\pi/2}{\cot\pars{x} \over \cot\pars{x} + \csc\pars{x}}\,\dd x & = \int_{0}^{\pi/2}{\cos\pars{x} \over \cos\pars{x} + 1}\,\dd x = \int_{0}^{\pi/2}{2\cos^{2}\pars{x/2} - 1 \over 2\cos^{2}\pars{x/2}}\,\dd x \\[5mm] & = \int_{0}^{\pi/2}\bracks{1 - {1 \over 2}\sec^{2}\pars{x \over 2}}\,\dd x = \left.x - \tan\pars{x \over 2}\right\vert_{\ 0}^{\ \pi/2} \\[5mm] & = {\pi \over 2} - \tan\pars{\pi \over 4} = \bbox[15px,#ffd,border:1px solid navy]{{\pi \over 2} - 1}\ \approx\ 0.5708 \end{align}

• 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