I got a different value with wolfram of evaluating $~\int_{0}^{2\pi}\left|\sin\theta+\cos\theta\right|\mathrm d \theta$ $$\begin{align}
A&:=\int_{0}^{2\pi}\left|\sin\theta+\cos\theta\right|\mathrm{d}\theta\\
\end{align}$$
$$\begin{align}
\sin\theta+\cos\theta&<0\leftrightsquigarrow\theta\neq{\pi\over2},{3\pi\over 2}\\
\cos\theta&<-\sin\theta\\
1&<-\tan\theta\\\iff-1&>\tan\theta
\\\equiv\tan\theta&<-1\\
f(\theta)&:=\sin\theta+\cos\theta
\\
A&=\int_{0}^{{\pi\over 2}}f(\theta)\mathrm d\theta-\int_{{\pi\over 2}}^{{\pi\over 2}+{\pi\over 4}}f(\theta)\mathrm d\theta+\int_{{\pi\over 2}+{\pi\over 4}}^{3\pi\over 2}f(\theta)\mathrm d\theta\\~~~&-\int_{{3\pi\over 2}}^{{3\pi\over2}+{\pi\over 4}}f(\theta)\mathrm d\theta+\int_{{3\pi\over 2}+{\pi\over 4}}^{2\pi}f(\theta)\mathrm d\theta
\end{align}$$
And I got $~ A=0 ~$ but wolfram shows me the value of $~ A ~$ should be $~ 4\sqrt{2} ~$
Where I've made (a) mistake(s)?

I would like to evaluate the integral from definition of absolute value by splitting the integration interval into 3 intervals.
$$
\begin{aligned}
\int_0^{2 \pi}|\sin \theta+\cos \theta| d \theta 
\stackrel{\theta\mapsto\theta-\frac{\pi}{4}}{=}&  \sqrt{2} \int_0^{2 \pi}\left|\cos \left(\theta-\frac{\pi}{4}\right)\right| d \theta \\
=  &\sqrt{2} \int_{-\frac{\pi}{4}}^{\frac{7 \pi}{4}}|\cos \theta| d \theta \\
= & \sqrt{2}\left(\int_{-\frac{\pi}{4}}^{\frac{\pi}{2}}|\cos \theta| d \theta+\int_{\frac{\pi}{2}}^{\frac{3 \pi}{2}}|\cos \theta| d \theta+\int_{\frac{2 \pi}{2}}^{\frac{7 \pi}{4}} \cos \theta d \theta\right) \\
= & \sqrt{2}\left(\int_{-\frac{\pi}{4}}^{\frac{\pi}{2}} \cos \theta d \theta-\int_{\frac{\pi}{2}}^{\frac{3 \pi}{2}} \cos \theta d \theta+\int_{\frac{3 \pi}{2}}^{\frac{\pi \pi}{4}} \cos \theta d \theta\right) \\
= & \sqrt{2}\left([\sin \theta]_{-\frac{\pi}{4}}^{\frac{\pi}{2}}-[\sin \theta]_{\frac{\pi}{2}}^{\frac{3 \pi}{2}}+[\sin \theta]_{\frac{3 \pi}{2}}^{\frac{7\pi}{4}}\right) \\
= & \sqrt{2}\left(1+\frac{1}{\sqrt{2}}+2-\frac{1}{\sqrt{2}}+1\right) \\
= & \ 4 \sqrt{2}
\end{aligned}
$$
