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