How can I find:$$\int \left|\sin(x)\right|\,\mathrm dx?$$ So far I have only seen Calculus I and integration by parts. When I try to integrate by parts I end up with another absolute value in the integrand function, and I do not know how to deal with it.
How to find the indefinite integral $\int |\sin x| \mathrm dx$?
-
2Have you made any effort on your own? What confuses you? – 2017-01-08
-
0@TheCount Yes, but so far I have only seen Calculus I and integration by parts. When I try to integrate by parts I end up with another absolute value in the integral of the formula. – 2017-01-08
-
1For the OP: many users here tend to downvote so-called PSQs (Problem Statement Questions) like yours, and answers, too (some god will forgive them, but the poor human Jack won't). So it is in your (and community's) best interest to improve your actual question by adding some context (your attempts, why this question is relevant to you, something along these lines). Cheers. – 2017-01-08
-
0What is the range of the integration? What if it was just $\int\sin x dx$? – 2017-01-08
-
1@TheCount I don't actually have a specific problem to solve. I was just curious about it. – 2017-01-08
4 Answers
Over each interval $[k\pi,(k+1)\pi)$, the integral is like the integral of $\sin\left(x-\pi\left\lfloor\frac{x}\pi\right\rfloor\right)$. The integral over each of those intervals is $2$. Therefore,
$$
\int\left|\sin(x)\right|\,\mathrm{d}x=2\left\lfloor\frac{x}\pi\right\rfloor-\cos\left(x-\pi\left\lfloor\frac{x}\pi\right\rfloor\right)+C
$$

To avoid jump discontinuities when $\sin x=0$, considering the definite integral first:
\begin{align*} \int_{0}^{x} |\sin t| \, dt &= \int_{0}^{x} \sqrt{1-\cos^2 t} \, dt \\ &= \int_{0}^{x-\frac{\pi}{2}} \sqrt{1-\sin^2 u} \, du \\ &= E\left( x-\frac{\pi}{2},1 \right) \\ \int |\sin t| \, dt &= E\left( x-\frac{\pi}{2},1 \right)+C \\ \end{align*}
where $\displaystyle E(\phi,k)=\int_{0}^{\phi} \sqrt{1-k^2\sin^2 \theta} \, d\theta \,$ is the incomplete elliptic integral of the second kind.
-
0After the substitution, shouldn't we get $$\int_{\frac\pi2-x}^{\frac\pi2}\sqrt{1-\sin^2(u)}\,\mathrm{d}u$$ This explains the sign change on W|A. Thus, the final answer is $C-E\!\left(\frac\pi2-x,1\right)$, which makes sense because $E$ is an increasing function. – 2017-01-09
-
0Sorry for typo, the wolframalpha outputs are correct. – 2017-01-09
You will probably need to break the region into intervals of $π$.
Each region $...(-π, 0), (0,π), (π,2π)...$ will have area 2.
Then, on the edges of the integral, if any additional area needs to be computed, use two definite integrals and add that to the area in the regions.
Each "region" has area 2 because $\int_0^π |sin(x)| = |-\cos(π)+\cos(0)| = 2$
-
0Isn't there a way calculate the indefinite integral? – 2017-01-08
-
0Not with an absolute value, no. – 2017-01-08
-
0You have to break it apart after every absolute value change. – 2017-01-08
In $L^2(0,2\pi)$ we have: $$\left|\sin(x)\right| = \frac{2}{\pi}-\frac{4}{\pi}\sum_{n\geq 1}\frac{\cos(2n x)}{4n^2-1} \tag{1}$$ hence it follows that: $$ \int \left|\sin(x)\right|\,dx = C+\frac{2x}{\pi}-\color{blue}{\frac{4}{\pi}\sum_{n\geq 1}\frac{\cos(2n x)}{(2n-1)2n(2n+1)}}\tag{2} $$ where the blue term is a $\pi$-periodic function with mean zero, bounded in absolute value by $\frac{4\log 2-2}{\pi}<\frac{1}{4}$.