3. Calculate $\int_{0}^{\frac{\pi}{4}} \ln (1+\operatorname{tg} x) d x$.
Solution. $\int_{0}^{\frac{\pi}{4}} \ln (1+\operatorname{tg} x) d x=\int_{0}^{\frac{\pi}{4}} \ln \left(1+\frac{\sin x}{\cos x}\right) d x=\int_{0}^{\frac{\pi}{4}} \ln (\sin x+\cos x) d x-\int_{0}^{\frac{\pi}{4}} \ln (\cos x) d x$

We have $\sin x+\cos x=\sin x+\sin \left(\frac{\pi}{2}-x\right)=2 \sin \frac{\pi}{4} \cos \left(x-\frac{\pi}{4}\right)=\sqrt{2} \cos \left(\frac{\pi}{4}-x\right) \Rightarrow$ $\ln (\sin x+\cos x)=\ln \sqrt{2}+\ln \left(\cos \left(\frac{\pi}{4}-x\right)\right)$ and then

$$
\int_{0}^{\frac{\pi}{4}} \ln (1+\operatorname{tg} x) d x=\int_{0}^{\frac{\pi}{4}} \ln \sqrt{2} d x+\int_{0}^{\frac{\pi}{4}} \ln \left(\cos \left(\frac{\pi}{4}-x\right)\right) d x-\int_{0}^{\frac{\pi}{4}} \ln (\cos x) d x
$$

With the change of variable $t=\frac{\pi}{4}-x$ we obtain

$\int_{0}^{\frac{\pi}{4}} \ln \left(\cos \left(\frac{\pi}{4}-x\right)\right) d x=\int_{\frac{\pi}{4}}^{0} \ln (\cos t) \cdot(-1) d t=\int_{0}^{\frac{\pi}{4}} \ln (\cos t) d t=\int_{0}^{\frac{\pi}{4}} \ln (\cos x) d x$ and substituting in relation (2) results in $\int_{0}^{\frac{\pi}{4}} \ln (1+\operatorname{tg} x) d x=\int_{0}^{\frac{\pi}{4}} \ln \sqrt{2} d x=\left.x \ln \sqrt{2}\right|_{0} ^{\frac{\pi}{4}}=\frac{\pi \ln 2}{8}$.

## Grading.

| Establish relation (1) | $1 \mathrm{p}$ |
| :--- | :--- |
| Obtain $\sin x+\cos x=\sqrt{2} \cos \left(\frac{\pi}{4}-x\right)$ | $2 \mathrm{p}$ |
| Establish relation (2) | $1 \mathrm{p}$ |
| $\int_{0}^{\frac{\pi}{4}} \ln \left(\cos \left(\frac{\pi}{4}-x\right)\right) d x=\int_{0}^{\frac{\pi}{4}} \ln (\cos x) d x$ | $2 \mathrm{p}$ |
| Finalization | $1 \mathrm{p}$ |