Put $x=r\cos t$ and $y=r\sin t=>r=\sqrt{x^2+y^2}$ and $t=tan^{-1}\frac{y}{x}$
$\displaystyle \int_0^{2\pi} |x \cos(\theta)+y \sin(\theta)|\, d\theta$
$=\sqrt{x^2+y^2}\displaystyle \int_0^{2\pi} | \cos(\theta -t)|\, d\theta$ assuming x,y are independent of $\theta$
Now $\cos x<0$ for $\frac{\pi}{2} and $\cos x≥0$, elsewhere
As the given range is 0 to $2\pi$ and $\cos(2\pi s+x)=\cos x$ for integral s, we can safely break the definite integral into the 4 quadrants i.e.,
$\displaystyle \int_0^{2\pi} | \cos(\theta -t)|\, d\theta$
$=\displaystyle \int_t^{\frac{\pi}{2}+t} \cos(\theta -t)\, d\theta$
$+\displaystyle \int_{\frac{\pi}{2}+t}^{\pi+t} (-\cos(\theta -t))\, d\theta$
$+\displaystyle \int_{\pi+t}^{\frac{3\pi}{2}+t}(-\cos(\theta -t))\, d\theta$
$+\displaystyle \int_{\frac{3\pi}{2}+t}^{2\pi+t} \cos(\theta -t)\, d\theta$
$=\sin(\theta-t)|_t^{\frac{\pi}{2}+t}$
$-\sin(\theta-t)|_{\frac{\pi}{2}+t}^{\pi+t}$
$-\sin(\theta-t)|_{\pi+t}^{\frac{3\pi}{2}+t}$
$+\sin(\theta-t)|_{\frac{3\pi}{2}+t}^{2\pi+t}$
$=(1-0)-(0-1)-(0-1)+(1-0)=4$
$\displaystyle \int_0^{2\pi} |x \cos(\theta)+y \sin(\theta)|\, d\theta=4\sqrt{x^2+y^2}$