# Trig Integration with Absolute Value

• Sep 12th 2008, 10:00 AM
MagicS06
Trig Integration with Absolute Value
Hi, I don't know where to start on this problem:

$\displaystyle \int_0^{\frac{\pi}{2}} |\sin{x} -\cos{x}| \ dx$

Any hints will be appreciated, thanks.
• Sep 12th 2008, 10:03 AM
InfinitePartsInHarmony
Start by eliminating the absolute value. Do this by deducing all the places between the upper and lower bounds of integration where sin x - cos x is negative. Split the question up into separate integrals summed for each region, using multiplication by -1 to make the negative sections positive.

Then integrate as per normal.
• Sep 12th 2008, 10:16 AM
Plato
$\displaystyle \left| {\sin (t) - \cos (t)} \right| = \left\{ \begin{gathered} \cos (t) - \sin (t),\,t \in \left[ {0,\pi /4} \right] \hfill \\ \sin (t) - \cos (t),\,t \in \left[ {\pi /4,\pi /2} \right] \hfill \\ \end{gathered} \right.$
• Sep 12th 2008, 10:17 AM
Moo
Hello,

$\displaystyle \sin \frac \pi 4=\cos \frac \pi 4=\frac{\sqrt{2}}{2}$

Before this point, cos decreases and sin increases.
So before $\displaystyle \frac \pi 4$, cos > sin --> sin - cos < 0

$\displaystyle \int_{0}^{\frac \pi 2} |\sin(x)-\cos(x)| ~dx=\int_{0}^{\frac \pi 4} |\underbrace{\sin(x)-\cos(x)}_{\text{negative}}| ~dx+\int_{\frac \pi 4}^{\frac \pi 2} |\underbrace{\sin(x)-\cos(x)}_{\text{positive}}| ~dx$

Recall that $\displaystyle |x|=\left\{\begin{array}{ll} -x \quad if~x<0 \\ x \quad if~x\ge 0 \end{array} \right.$

This gives $\displaystyle \int_{0}^{\frac \pi 2} |\sin(x)-\cos(x)| ~dx=\int_{0}^{\frac \pi 4} -(\sin(x)-\cos(x)) ~dx+\int_{\frac \pi 4}^{\frac \pi 2} \sin(x)-\cos(x) ~dx$
• Sep 12th 2008, 10:24 AM
Soroban
Hello, MagicS06!

Quote:

$\displaystyle \int_0^{\frac{\pi}{2}} |\sin{x} -\cos{x}| \ dx$

$\displaystyle \text{Graph }\sin x \text{ and }\cos x\text{ on that interval.}$
Code:

        |         * *  * *         |  *  :         | * : * :         |*  :  *:         |  :  :       - * - + - * - -         0  ¼π  ½π         |

On $\displaystyle \left[0,\frac{\pi}{4}\right]\!:\;\;\sin x < \cos x$

. . The area is: .$\displaystyle \int^{\frac{\pi}{4}}_0\bigg(\cos x - \sin x\bigg)\,dx$

On $\displaystyle \left[\frac{\pi}{4},\:\frac{\pi}{2}\right]\!:\;\;\sin x > \cos x$

. . The area is: .$\displaystyle \int^{\frac{\pi}{2}}_{\frac{\pi}{4}} \bigg(\sin x - \cos x\bigg)\,dx$

Go for it!