Home » Blog » Compute the integral from 0 to π of |(1/2) + cos t|

Compute the integral from 0 to π of |(1/2) + cos t|

Compute the following integral:

    \[ \int_0^{\pi} \left| \frac{1}{2} + \cos t \right| \, dt. \]


First, we note that

    \[ \left| \frac{1}{2} + \cos t \right| =  \begin{dcases} \frac{1}{2} + \cos t & \text{if } 0 \leq t \leq \frac{2 \pi}{3} \\  -\left(\frac{1}{2} + \cos t\right) & \text{if } \frac{2 \pi}{3} < t \leq \pi. \end{dcases} \]

So, then we can compute,

    \begin{align*}  \int_0^{\pi} \left| \frac{1}{2} + \cos t \right| \, dt &= \int_0^{\frac{2 \pi}{3}} \left( \frac{1}{2} + \cos t \right) \, dt - \int_{\frac{2 \pi}{3}}^{\pi} \left( \frac{1}{2} + \cos t \right) \, dt \\  &= \int_0^{\frac{ 2 \pi}{3}} \frac{1}{2} \, dt  + \int_0^{\frac{2 \pi}{3}} \cos t \, dt - \int_{\frac{2 \pi}{3}}^{\pi} \frac{1}{2} \, dt - \int_{\frac{2 \pi}{3}}^{\pi} \cos t \, dt \\  &= \left. \frac{t}{2} \right|_0^{\frac{2 \pi}{3}} + (\sin t)\biggr \rvert_0^{\frac{2 \pi}{3}} - \left. \frac{t}{2} \right|_{\frac{2 \pi}{3}}^{\pi} - (\sin t) \biggr \rvert_{\frac{2 \pi}{3}}^{\pi} \\  &= \frac{2 \pi}{6} + \sin \left( \frac{2 \pi}{3} \right) - \left( \frac{\pi}{2} - \frac{2 \pi}{6} \right) - \left( \sin \pi - \sin \left( \frac{2 \pi}{3} \right) \right) \\  &= \frac{\pi}{3} + \frac{\sqrt{3}}{2} - \frac{\pi}{6} + \frac{\sqrt{3}}{2} \\  &= \frac{\pi}{6} + \sqrt{3}. \end{align*}

Point out an error, ask a question, offer an alternative solution (to use Latex type [latexpage] at the top of your comment):