Definite Integration

Evaluate $\displaystyle \int \limits_{0}^{\frac{\pi}{2}} \log \left(\cos x\right) \; dx$


$\begin{aligned} \text{Let } I & = \int \limits_{0}^{\frac{\pi}{2}} \log \left(\cos x\right) \; dx \;\;\; \cdots \; (1) \\\\ & = \int \limits_{0}^{\frac{\pi}{2}} \log \left[\cos \left(\dfrac{\pi}{2} - x\right)\right] \; dx \hspace{3em} \left[\text{Note: } \int \limits_{0}^{a} f\left(x\right) \; dx = \int \limits_{0}^{a} f\left(a - x\right) \; dx\right] \\\\ \text{i.e. } I & = \int \limits_{0}^{\frac{\pi}{2}} \log \left(\sin x\right) \; dx \;\;\; \cdots \; (2) \end{aligned}$ Adding equations $(1)$ and $(2)$ gives

$\begin{aligned} 2 I & = \int \limits_{0}^{\frac{\pi}{2}} \left[\log \left(\cos x\right) + \log \left(\sin x\right)\right] \; dx \\\\ & = \int \limits_{0}^{\frac{\pi}{2}} \log \left(\cos x \cdot \sin x\right) \; dx \hspace{3em} \left[\text{Note: } \log C + \log D = \log \left(C \cdot D\right)\right]\\\\ & = \int \limits_{0}^{\frac{\pi}{2}} \log \left(\dfrac{2 \sin x \cos x}{2}\right) \; dx \\\\ & = \int \limits_{0}^{\frac{\pi}{2}} \log \left(\dfrac{\sin 2x}{2}\right) \; dx \\\\ & = \int \limits_{0}^{\frac{\pi}{2}} \log \left(\sin 2x\right) \; dx - \int \limits_{0}^{\frac{\pi}{2}} \log \left(2\right) \; dx \hspace{3em} \left[\text{Note: } \log C - \log D = \log \left(\dfrac{C}{D}\right)\right] \\\\ & = \int \limits_{0}^{\frac{\pi}{2}} \log \left(\sin 2x\right) \; dx - \log \left(2\right) \times \left[x\right]_{0}^{\pi / 2} \\\\ & = \int \limits_{0}^{\frac{\pi}{2}} \log \left(\sin 2x\right) \; dx - \dfrac{\pi}{2} \; \log \left(2\right) \;\;\; \cdots \; (3) \end{aligned}$ Let $I_1 = \displaystyle \int \limits_{0}^{\frac{\pi}{2}} \log \left(\sin 2x\right) \; dx$ $\;\;\; \cdots \; (4)$

Let $2x = u$ $\;\;\; \cdots \; (5)$

Differentiating equation $(5)$ gives

$2 \; dx = du$ $\implies$ $dx = \dfrac{du}{2}$ $\;\;\; \cdots \; (5a)$

$\text{When } \begin{cases} x = 0, & u = 0 \\ x = \dfrac{\pi}{2}, & u = \pi \end{cases}$ $\;\;\; \cdots \; (5b)$

$\therefore$ $\;$ In view of equations $(5)$, $(5a)$ and $(5b)$, equation $(4)$ can be written as

$I_1 = \dfrac{1}{2} \displaystyle \int \limits_{0}^{\pi} \log \left(\sin u\right) \; du$ $\;\;\; \cdots \; (6)$

Since $\log \left[\sin \left(\pi - u\right)\right] = \log \left(\sin u\right)$

$\implies$ $\displaystyle \int \limits_{0}^{\pi} \log \left(\sin u\right) \; du = 2 \int \limits_{0}^{\frac{\pi}{2}} \log \left(\sin u\right) \; du$ $\;\;\; \cdots \; (7)$

$\therefore$ $\;$ In view of equation $(7)$ equation $(6)$ becomes

$\begin{aligned} I_1 & = \dfrac{1}{2} \times 2 \int \limits_{0}^{\frac{\pi}{2}} \log \left(\sin u\right) \; du \\\\ & = \int \limits_{0}^{\frac{\pi}{2}} \log \left(sin u\right) \; du \\\\ & = \int \limits_{0}^{\frac{\pi}{2}} \log \left(sin x\right) \; dx \hspace{3em} \left[\text{Note: Definite integral is independent of variable}\right] \\\\ & = I \hspace{3em} \left[\text{By equation }(2)\right] \;\;\; \cdots \; (8) \end{aligned}$

$\therefore$ $\;$ In view of equation $(8)$, equation $(3)$ becomes

$2 I = I - \dfrac{\pi}{2} \log \left(2\right)$

i.e. $I = - \dfrac{\pi}{2} \log \left(2\right)$