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.
 A: We have $$I=\int_{0}^{\pi/4}\frac{2x}{2\cos^2x+2\cos x\sin x}dx=\int_0^{\pi/4}\frac{2x}{\cos 2x+\sin 2x+1}dx=\frac{1}{2}\int_0^{\pi/2}\frac{xdx}{\cos x+\sin x+1}=\frac{1}{2}\int_0^{\pi/2}\frac{\pi/2-x}{\cos x+\sin x+1}dx\\I=\frac{1}{4}\int_0^{\pi/2}\frac{\pi/2}{\cos x+\sin x+1}dx$$Now substitute $x$ for $2x$ again$$=\frac{\pi}{4}\int_0^{\pi/4}\frac{dx}{2\cos^2x+2\sin x\cos x}=\frac{\pi}{8}\int_0^{\pi/4}\frac{\sec^2xdx}{1+\tan x}=\frac{\pi}{8}\int_0^{1}\frac{1}{1+u}du=\frac{\pi}{8}\log 2$$
A: Let $$I(x)= \int^{\frac{\pi}{4}}_0 \frac{x}{\cos(x)(\cos(x)+\sin(x))} dx$$ 
$$ I(x)= \int^{\frac{\pi}{4}}_0 \frac{x}{\cos(x)(\sqrt2\sin(x+\frac{\pi}{4}))} dx$$ 
$$ I(x)= \int^{\frac{\pi}{4}}_0 \frac{x}{\sqrt2\cos(x)\sin(x+\frac{\pi}{4})} dx$$ 
Since $$ I(x)=I(\frac{\pi}{4}-x)$$
$$ I(\frac{\pi}{4}-x)=\int^{\frac{\pi}{4}}_0 \frac{\frac{\pi}{4}-x}{\cos(\frac{\pi}{4}-x)(\sqrt2\sin(\frac{\pi}{4}-x+\frac{\pi}{4}))} dx$$
$$ I(\frac{\pi}{4}-x) =\int^{\frac{\pi}{4}}_0 \frac{\frac{\pi}{4}-x}{\sqrt2 \cos(x)\sin(x+\frac{\pi}{4})} dx$$
But $$ I(x)=I(\frac{\pi}{4}-x)$$ 
so $$ I+I =\int^{\frac{\pi}{4}}_0 \frac{\frac{\pi}{4}-x}{\sqrt2 \cos(x)\sin(x+\frac{\pi}{4})}+\int^{\frac{\pi}{4}}_0 \frac{x}{\sqrt2\cos(x)\sin(x+\frac{\pi}{4})} dx$$
$$ 2I = \frac{\pi}{4\sqrt2}\int^{\frac{\pi}{4}}_0  \frac{1}{\cos(x)\sin(x+\frac{\pi}{4})} dx$$
Can you continue?
$$ I = \frac{\sqrt2\pi}{16}\int^{\frac{\pi}{4}}_0  \frac{1}{\cos(x)(\frac{1}{\sqrt{2}})(\cos(x)+\sin(x))} dx$$
$$ I = \frac{\pi}{8}\int^{\frac{\pi}{4}}_0  \frac{\sec(x)}{\sin(x)+\cos(x)}\cdot\frac{\frac{1}{\cos(x)}}{\frac{1}{\cos(x)}} dx$$ 
$$ I = \frac{\pi}{8}\int^{\frac{\pi}{4}}_0  \frac{\sec^2(x)}{\tan(x)+1} dx$$ 
$$ I = \frac{\pi}{8} \left[\ln|\tan(x)+1 \right]^{\frac{\pi}{4}}_0$$
$$ I = \frac{\pi}{8} \cdot \ln(2) $$
A: \begin{align}
\int_0^{\pi/4}\frac{x\,dx}{\cos x(\cos x + \sin x)} &= \int_0^{\pi/4}\frac{x\,dx}{\cos^2(x)+\cos(x)\sin(x)}\\ &=\int_0^{\pi/4}\frac{2x\,dx}{\cos(2x)+\sin(2x)+1} \\&=\frac{1}{2}\int_0^{\pi/2}\frac{t\,dt}{\cos(t)+\sin(t)+1} 
\end{align}
By $t \to 1-t$
$$I =\frac{1}{2}\int_0^{\pi/2}\frac{(\pi/2-t)\,dt}{\cos(t)+\sin(t)+1} $$
Separate the integrals 
$$I =\frac{1}{2}\int_0^{\pi/2}\frac{(\pi/2)\,dt}{\cos(t)+\sin(t)+1} -I$$
$$I  = \frac{\pi}{8}\int_0^{\pi/2}\frac{\,dt}{\cos(t)+\sin(t)+1} = \frac{\pi}{8}\log(2)$$
The last integral could be solved using Weierstrass substitution.
A: Note that $$I=\int_{0}^{\pi/4}\frac{x}{\cos\left(x\right)\left(\cos\left(x\right)+\sin\left(x\right)\right)}dx=\int_{0}^{\pi/4}\frac{x}{\cos^{2}\left(x\right)\left(1+\tan\left(x\right)\right)}dx
 $$ $$\stackrel{\tan\left(x\right)=u}{=}\int_{0}^{1}\frac{\arctan\left(u\right)}{1+u}du\stackrel{IBP}{=}\frac{\pi}{4}\log\left(2\right)-\int_{0}^{1}\frac{\log\left(1+u\right)}{1+u^{2}}du
 $$ now note that $$\int_{0}^{1}\frac{\log\left(1+u\right)}{1+u^{2}}du\stackrel{u=\frac{1-y}{1+y}}{=}\int_{0}^{1}\frac{\log\left(2\right)-\log\left(1+y\right)}{1+y^{2}}dy
 $$ hence $$\int_{0}^{1}\frac{\log\left(1+u\right)}{1+u^{2}}du=\frac{\log\left(2\right)}{2}\int_{0}^{1}\frac{dy}{1+y^{2}}=\frac{\pi}{8}\log\left(2\right)
 $$ so $$I=\color{red}{\frac{\pi}{8}\log\left(2\right)}.$$ 
A: 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$
A: \begin{align}J&=\int_0^{\pi/4}\frac{x\,dx}{\cos x(\cos x + \sin x)}\\&\overset{\text{IBP}}=\Big[\ln\left(1+\tan x\right)x\Big]_0^{\pi/4}-\int_0^{\pi/4}\ln\left(1+\tan x\right)dx\\
&=\frac{1}{4}\pi\ln 2-\int_0^{\pi/4}\ln\left(1+\tan x\right)dx\\
\int_0^{\pi/4}\ln\left(1+\tan x\right)dx&\overset{u=\frac{\pi}{4}-x}=\int_0^{\pi/4}\ln\left(1+\frac{1-\tan u}{1+\tan u}\right)du\\
&=\int_0^{\pi/4}\ln\left(\frac{2}{1+\tan u}\right)du\\
&=\frac{1}{4}\pi\ln 2-\int_0^{\pi/4}\ln\left(1+\tan u\right)du\\
\end{align}
Therefore,
\begin{align}\int_0^{\pi/4}\ln\left(1+\tan u\right)du&=\frac{1}{8}\pi\ln 2\\
J&=\boxed{\frac{1}{8}\pi\ln 2}
\end{align}
NB:
IMHO when you have $\displaystyle \int_a^b f(x)x dx$ check out if $f$ have a simple antiderivative.
Of course, check out first if $f(a+b-x)=f(x)$
