$$\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)?


Note $$\int_{0}^{2\pi}\left|\sin\theta+\cos\theta\right|\mathrm d \theta=\int_{0}^{2\pi}\sqrt2\left|\sin(\theta+\frac\pi4)\right|\mathrm d \theta.$$ Since $\sin(\theta)$ is a periodic function with period $2\pi$. So $$\int_{0}^{2\pi}\left|\sin\theta+\cos\theta\right|\mathrm d \theta=\int_{0}^{2\pi}\sqrt2\left|\sin(\theta+\frac\pi4)\right|\mathrm d \theta=\sqrt2\int_0^{2\pi}|\sin\theta|\mathrm d \theta=4\sqrt2\int_0^{\pi/2}|\sin\theta|\mathrm d \theta=4\sqrt2.$$