Home » Blog » Compute the integral from 0 to π/2 of sin x – cos x

Compute the integral from 0 to π/2 of sin x – cos x

Compute the following integral:

    \[ \int_0^{\frac{\pi}{2}} (\sin x - \cos x) \, dx. \]


We compute as follows:

    \begin{align*}  \int_0^{\frac{\pi}{2}} (\sin x - \cos x ) \, dx &= \int_0^{\frac{\pi}{2}} \sin x \, dx - \int_0^{\frac{\pi}{2}} \cos x \, dx \\  &= (-\cos x) \biggr \rvert_0^{\frac{\pi}{2}} - \sin x \biggr \rvert_0^{\frac{\pi}{2}} \\  &= 1 - 0 - 1 \\  &= 0. \end{align*}

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