Janet Forbes

2022-07-02

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

Mateo Carson

Expert

Step 1
Let $f\left(x\right)={\int }_{0}^{x}|\mathrm{sin}x|\phantom{\rule{thinmathspace}{0ex}}dx=\left(1-\mathrm{cos}x\right),0\le x\le \pi .$.
since the integrand is $\pi$- periodic, we can extend the formula for $f\left(x\right)=f\left(\pi \right)+f\left(x-\pi \right),\pi \le x\le 2\pi$
Step 2
And so on. you can verify that .
in particular $f\left(16\pi \right)=32.$.

Savanah Boone

Expert

Step 1
For $x\in \left[n\pi ,\left(n+1\right)\pi \right]$, we get
$\begin{array}{}\text{(1)}& {\int }_{0}^{n\pi }|\mathrm{sin}\left(t\right)|\phantom{\rule{thinmathspace}{0ex}}\mathrm{d}t=2n\end{array}$
and $\begin{array}{rl}{\int }_{n\pi }^{x}|\mathrm{sin}\left(t\right)|\phantom{\rule{thinmathspace}{0ex}}\mathrm{d}t& ={\int }_{0}^{x-n\pi }\mathrm{sin}\left(t\right)\phantom{\rule{thinmathspace}{0ex}}\mathrm{d}t\\ \text{(2)}& & =1-\mathrm{cos}\left(x-n\pi \right)\end{array}$
Step 2
Piecing (1) and (2) together yields $\begin{array}{}\text{(3)}& {\int }_{0}^{x}|\mathrm{sin}\left(t\right)|\phantom{\rule{thinmathspace}{0ex}}\mathrm{d}t=1-\mathrm{cos}\left(x-\pi \stackrel{n}{\stackrel{⏞}{⌊x/\pi ⌋}}\right)+2\stackrel{n}{\stackrel{⏞}{⌊x/\pi ⌋}}\end{array}$

Do you have a similar question?

Recalculate according to your conditions!