$y=\int _{0}^{\pi /2}\frac{1}{1+\frac{\cos x}{\sin x}}dx$
$y=\int _{0}^{\pi /2}\frac{1}{1+\frac{\cos x}{\sin x}}dx$

$y=\int _{0}^{\pi /2}\frac{\sin x}{\sin x+\cos x}dx….(1)$

Use king theorem of definite integral

$\int _{a}^{b}f(x)dx=\int _{a}^{b}f(a+b-x)dx$

\[y=\int _{0}^{\pi /2}\frac{\sin \left( \frac{\pi }{2}-x \right)}{\sin \left( \frac{\pi }{2}-x \right)+\cos \left( \frac{\pi }{2}-x \right)}dx\]

\[y=\int _{0}^{\pi /2}\frac{\cos x}{\sin x+\cos x}dx…..(2)\]

Adding equation (1) and (2)

$2y=\int _{0}^{\pi /2}\frac{\sin x}{\sin x+\cos x}dx+\int _{0}^{\pi /2}\frac{\cos x}{\sin x+\cos x}dx$

$2y=\int _{0}^{\pi /2}\frac{\sin x+\cos x}{\sin x+\cos x}dx$

$2y=\int _{0}^{\pi /2}1dx$

$2y=(x)_{0}^{\pi /2}$

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