# 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.

• At 672 reputation points in 13 months you are expected to be able to write MathJax, instead of using images. Please reformat your post and pay more attention to the future ones. – Alex M. Jan 5 '17 at 9:45
• @Arthur, your edit is useful, but it will leave the OP under the impression that we are his unpayed servants here. – Alex M. Jan 5 '17 at 9:46
• @AlexM. You're right. All his posts are pictures, or pictures edited to MathJax by someone else. – Arthur Jan 5 '17 at 9:48
• @AlexM. Let's be honest here. The question itself treats Math.SE users that way. The user tried one or two things (I'm honestly not even sure which. I dunno what "Nr" and "Dr" even mean, but maybe my Googling is just failing me.) before apparently just giving up and asking Math.SE to do the work for him. There's no evidence of further research or much effort into various attempts using different techniques. At the least, they decided they couldn't be bothered to document what they did. – jpmc26 Jan 5 '17 at 10:56
• @jpmc26 I think OP means numerator and denominator? Not sure though. – Rumplestillskin Jan 5 '17 at 11:48

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{x}{\cos x+\sin x+1}=\frac{1}{2}\int_0^{\pi/2}\frac{\pi/2-x}{\cos x+\sin x+1}\\I=\frac{1}{4}\int_0^{\pi/2}\frac{\pi/2}{\cos x+\sin x+1}$$Now substitute $x$ for $2x$ again$$=\frac{\pi}{4}\int_0^{\pi/4}\frac{1}{2\cos^2x+2\sin x\cos x}=\frac{\pi}{8}\int_0^{\pi/4}\frac{\csc^2x}{1+\tan x}=\frac{\pi}{8}\int_0^{1}\frac{1}{1+u}du=\frac{\pi}{8}\log 2$$

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)$$

\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.

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)}.$$

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$