Antiderivative of $|\sin(x)|$ Because $$\int_0^{\pi}\sin(x)\,\mathrm{d}x=2,$$ then $$\int_0^{16\pi}|\sin(x)|\,\mathrm{d}x=32.$$
And Wolfram Alpha agrees to this, but when I ask for the indefinite integral $$\int|\sin(x)|\,\mathrm{d}x,$$ Wolfram gives me $$-\cos(x)\,\mathrm{sgn}(\sin(x))+c.$$ However, $$[-\cos(x)\,\mathrm{sgn}(\sin(x))]_0^{16\pi}=0,$$ So what's going on here? What is the antiderivative of $|\sin(x)|$?

$\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\Li}[1]{\,{\rm Li}_{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
$\ds{}$
\begin{align}&\color{#66f}{\large\int\verts{\sin\pars{x}}\,\dd x}
=x\verts{\sin\pars{x}}-\int x\,{\rm sgn}\pars{\sin\pars{x}}\cos\pars{x}\,\dd x
\\[5mm]&=x\verts{\sin\pars{x}}
-\int\,{\rm sgn}\pars{\sin\pars{x}}\,\dd\bracks{\cos\pars{x} + x\sin\pars{x}}
\\[1cm]&=x\verts{\sin\pars{x}}
-\bracks{\cos\pars{x} + x\sin\pars{x}}\,{\rm sgn}\pars{\sin\pars{x}}
\\[5mm]&+\int\bracks{\cos\pars{x} + x\sin\pars{x}}2\delta\pars{\sin\pars{x}}
\cos\pars{x}\,\dd x
\\[1cm]&=-\cos\pars{x}\,{\rm sgn}\pars{\sin\pars{x}}
+2\int\delta\pars{\sin\pars{x}}\,\dd x
\\[5mm]&=\color{#66f}{\large -\cos\pars{x}\,{\rm sgn}\pars{\sin\pars{x}}
+2\sum_{n=-\infty}^{\infty}\ \int\delta\pars{x - n\pi}\,\dd x}
\end{align}

Then,
$$
\int_{0}^{16\pi}\verts{\sin\pars{x}}\,\dd x
=\overbrace{\left.\vphantom{\LARGE A}-\cos\pars{x}\,{\rm sgn}\pars{\sin\pars{x}}
\right\vert_{\ 0}^{\ 16\pi}}^{\ds{=\ \dsc{0}}}\ +\
2\ \overbrace{\sum_{n=-\infty}^{\infty}\
\int_{0^{-}}^{\pars{16\pi}^{\, +}}\delta\pars{x - n\pi}\,\dd x}^{\ds{=\ \dsc{16}}}
\ =\ 32
$$
