Doing definite integration $\int_0^{\pi/4}\frac{x\,dx}{\cos x(\cos x + \sin x)}$ We have to solve the following integration
$$
\int_0^{\pi/4}\frac{x\,dx}{\cos x(\cos x + \sin x)}
$$
I divided both in Nr and Dr by $\cos^2 x$.
But after that I stuck.

Let $I$ the integral that we want to compute. First we perform the change of variables $x=u+\frac{\pi}{4}$ and then the change of variables $u=-w$ to get:
$I=\displaystyle{\int_{-\frac{\pi}{4}}^{0}\frac{u}{\cos u(\cos u -\sin u)}du+\frac{\pi}{4}\int_{-\frac{\pi}{4}}^{0}\frac{1}{\cos u(\cos u -\sin u)}du}=\\ -\displaystyle{\int_{0}^{\frac{\pi}{4}}\frac{w}{\cos w(\cos w +\sin w)}dw+\frac{\pi}{4}\int_{0}^{\frac{\pi}{4}}\frac{1}{\cos w(\cos w +\sin w)}dw}$
and therefore we have:
$I=-I +\displaystyle{\frac{\pi}{4}\int_{0}^{\frac{\pi}{4}}\frac{1}{\cos w(\cos w +\sin w)}dw\Rightarrow I=\frac{\pi}{8}\int_{0}^{\frac{\pi}{4}}\frac{1}{\cos w(\cos w +\sin w)}dw}$
But with the substitution $y=tanw$ we obtain:
$\displaystyle{\int_{0}^{\frac{\pi}{4}}\frac{1}{\cos w(\cos w +\sin w)}dw=\int_{0}^{\frac{\pi}{4}}\frac{1}{\cos^2 w}\frac{1}{(1 +\tan w)}dw=\int_{0}^{1}\frac{1}{1+y}dy=\ln2}$
and finally $I=\frac{\pi}{8}\ln2$.
Note: In the change of variables $x=u+\frac{\pi}{4}$ we used the trigonometric identities:
$\cos (x+y)=\cos x \cos y - \sin x \sin y \\ \sin (x+y)=\sin x \cos y + \cos x \sin y$
