$\int_{0}^{\pi}|\sqrt2\sin x+2\cos x|dx$ $\int_{0}^{\pi}|\sqrt2\sin x+2\cos x|dx$
MyAttempt
$\int_{0}^{\pi}|\sqrt2\sin x+2\cos x|=\int_{0}^{\pi/2}\sqrt2\sin x+2\cos x dx+\int_{\pi/2}^{\pi}|\sqrt2\sin x+2\cos x| dx$
I could solve first integral but in second one,i could not judge the mod will take plus sign or minus sign or how to break it in further intervals?
 A: Hint: For any $\theta\in\mathbb{R}$, $\displaystyle\int_\theta^{\pi+\theta}\,\big|\sin(x)\big|\,\text{d}x=\int_0^{\pi}\,\big|\sin(x)\big|\,\text{d}x=2$.  Also, $$\sqrt{2}\sin(x)+2\cos(x)=\sqrt{6}\sin\big(x+\arctan(\sqrt{2})\big)\,.$$
A: We Can Write $\displaystyle \sqrt{2}\sin x+2\cos x = \sqrt{\left(\sqrt{2}\right)^2+2^2}\left\{\frac{\sqrt{2}}{\sqrt{6}}\sin x+\frac{2}{\sqrt{6}}\cos x\right\}$
$\displaystyle  = \sqrt{6}\left\{\sin x\cdot \frac{1}{\sqrt{3}}+\cos x\cdot \frac{2}{\sqrt{6}}\right\} = \sqrt{6}\left\{\sin x\cdot \cos \alpha+\cos x\cdot \sin \alpha\right\} = \sqrt{6}\cdot \sin (x+\alpha)$
Where $$\displaystyle \sin \alpha = \frac{2}{\sqrt{6}}$$ and $$\displaystyle \cos \alpha = \frac{1}{\sqrt{3}}$$ and $$\displaystyle \tan \alpha = \sqrt{2}$$ . So $\displaystyle \frac{\pi}{4}<\alpha <\frac{\pi}{3}$
So Integral Convert into $$\displaystyle \sqrt{6}\int_{0}^{\pi}\left|\sin (x+\alpha)\right|dx$$
Let $(x+\alpha) = t\;,$ Then $dx = dt$ and Changing Limit, we get
$$\displaystyle I = \sqrt{6}\int_{\alpha}^{\pi+\alpha}|\sin t|dt = \sqrt{6}\int_{\alpha}^{\pi}\sin tdt-\sqrt{6}\int_{\pi}^{\pi+\alpha}\sin tdt $$
So we get $$\displaystyle I = \sqrt{6}\left(1+\cos \alpha\right)+\sqrt{6}\left(-\cos \alpha +1\right) = 2\sqrt{6}$$
A: The break point occurs when $\sqrt{2}\sin x+2\cos x=0$, which is at 
$$x=\pi-\arctan(\sqrt{2})$$
Thus, the integral is 
$$\begin{align}
\int_0^{\pi}|\sqrt{2}\sin x+2\cos x|\,dx&=\int_0^{\pi-\arctan(\sqrt{2})}(\sqrt{2}\sin x+2\cos x)\,dx\\\\
&-\int_{\pi-\arctan(\sqrt{2})}^{\pi}(\sqrt{2}\sin x+2\cos x)\,dx
\end{align}$$
Can you finish from here?
A: Hint
Consider the function $$f(x)=\sqrt2\sin (x)+2\cos (x)$$ $$f'(x)=\sqrt2\cos(x)-2\sin (x)$$ The function starts being positive, goes throught a maximum and then decreases and cancels somewhere in the interval. So, find the root $a$ such that $f(a)=0$ and now $$I=\int_{0}^{\pi}|\sqrt2\sin (x)+2\cos (x)|\,dx$$ $$I=\int_{0}^{a}\Big(\sqrt2\sin(x)+2\cos (x)\Big)dx-\int_{a}^{\pi}\Big(\sqrt2\sin(x)+2\cos (x)\Big)dx$$ $$I=4 \sin (a)-2 \sqrt{2} \cos (a)$$
A: $\displaystyle A \sin \ x + B \cos \ x = \sqrt{A^2 + B^2}\sin( x + \phi )$, where $\displaystyle \cos \phi =  \frac{A}{\sqrt{A^2 + B^2}}$.
In our case $\displaystyle \cos\phi=\frac{1}{\sqrt{3}} \Rightarrow \phi\in\left(0;\frac{\pi}{2}\right)$.
Thus: $\displaystyle \begin{aligned}\int\limits_0^\pi\left|\sqrt{2}\sin x+2\cos x\right|dx&=\sqrt{6}\int\limits_0^\pi\left|\sin(x+\phi)\right|dx=\sqrt{6}\int\limits_0^{\pi-\phi}\sin(x+\phi)dx+\sqrt{6}\int\limits_{\pi-\phi}^\pi(-\sin(x+\phi))dx=\\&=\left.-\sqrt{6}\cos(x+\phi)\right|_0^{\pi-\phi}+\left.\sqrt{6}\cos(x+\phi)\right|_{\pi-\phi}^\pi=-\sqrt{6}\left(\cos\pi-\cos\phi\right)+\sqrt{6}\left(\cos(\pi+\phi)-\cos\pi\right )=\\&=\sqrt{6}+\sqrt{2}-\sqrt{2}+\sqrt{6}=2\sqrt{6}\end{aligned}$
A: Let's first find out the break point $$\sqrt 2\sin x+2\cos x=0$$ $$\sqrt 2\sin x=-2\cos x\iff \tan x=-\frac{2}{\sqrt 2}$$ $$x=\tan^{-1}(-\sqrt 2)$$
Now, we have $$\int_{0}^{\pi}\left|\sqrt 2\sin x+2\cos x \right|dx$$
$$=\int_{0}^{\tan^{-1}(-\sqrt 2)}\left|\sqrt 2\sin x+2\cos x \right|dx+\int_{\tan^{-1}(-\sqrt 2)}^{\pi}\left|\sqrt 2\sin x+2\cos x \right|dx$$
$$=\int_{0}^{\tan^{-1}(-\sqrt 2)}(\sqrt 2\sin x+2\cos x)dx-\int_{\tan^{-1}(\sqrt 2)}^{\pi}(\sqrt 2\sin x+2\cos x )dx$$
I hope you can solve further
