<s>[INST] Integral $\int \limits _0 ^\pi |\sin x + \cos x|\; dx$ $$\int \limits _0 ^\pi |\sin x + \cos x|\; dx$$
If I divide integral in two parts  $\int\limits_0^{\frac{\pi}{2}}{(\sin x + \cos x)\,dx}$ and $\int\limits_{\frac{\pi}{2}}^\pi{(\sin x - \cos x)\,dx}$...I am getting $4$...Am I right?
 [/INST] Though answers were already given, I'd like to suggest a different approach:
We see that the absolute value of $\cos(x) + \sin(x)$ is required.
Also, we are dealing with sinusoidal functions, which can be easily dealt with the square function, so:
$$
\begin{align}
\int\limits_0^\pi \lvert \cos(x) + \sin(x) \rvert &=  \\
&= \int\limits_0^\pi \sqrt{\left(\cos(x) + \sin(x) \right)^2} \\
&= \int\limits_0^\pi \sqrt{\cos^2(x) + 2  \sin(x) \cos(x) + \sin^2(x) } \\
&= \int\limits_0^\pi \sqrt{1 + 2  \sin(x) \cos(x) } \\
&= \begin{bmatrix} \text{Sinusoidal identity:} \\ 2  \sin(x) \cos(x) = \sin(2x) \end{bmatrix} \\
&= \int\limits_0^\pi \sqrt{1 + \sin(2x) } \\
\end{align}
$$
Now we should notice the function that we're dealing with (omitting the root, insignificant):

Picture was taken from WA for 1 + sin(2x).
So we're performing a sum operation over the rooted sine-wave, treating all values as positive.  
This is exactly like performing the same sum operation over the cosine function, with different limits - from $-\frac{\pi}{2}$ to $\frac{\pi}{2}$ (due to phase shift symmetry):
$$
\begin{align}
 \int\limits_0^\pi \sqrt{1 + \sin(2x) } &= \\
 &= \int\limits_{-\frac{\pi}{2}}^\frac{\pi}{2} \sqrt{1 + \cos(2x) } \\
 &= \begin{bmatrix} \text{Sinusoidal identity:} \\ cos(2x) = 2 \cos^2(x) - 1 \end{bmatrix} \\
 &= \int\limits_{-\frac{\pi}{2}}^\frac{\pi}{2} \sqrt{1 + 2 \cos^2(x) - 1 } \\
 &= \sqrt{2} \, \int\limits_{-\frac{\pi}{2}}^\frac{\pi}{2} \cos(x) \\
 &= 2\sqrt{2}
\end{align}
$$
</s>