# absolute trig integral

• Dec 10th 2007, 06:40 AM
akhayoon
absolute trig integral
Hi, I'm getting really weird answers for the answer of this integral

$\displaystyle \int_{0}^{\pi}|\frac{1}{2}+cosx|~dx$
• Dec 10th 2007, 06:56 AM
topsquark
Quote:

Originally Posted by akhayoon
Hi, I'm getting really weird answers for the answer of this integral

$\displaystyle \int_{0}^{\pi}|\frac{1}{2}+cosx|~dx$

$\displaystyle \int_{0}^{\pi} \left | \frac{1}{2}+cosx \right | ~dx = \int_0^{2\pi/3}\left ( \frac{1}{2} + cos(x) \right )~dx - \int_{2\pi/3}^{\pi} \left ( \frac{1}{2} + cos(x) \right )~dx$

I get $\displaystyle \sqrt{3} + \frac{\pi}{6}$.

-Dan
• Dec 10th 2007, 06:59 AM
Jhevon
Quote:

Originally Posted by akhayoon
Hi, I'm getting really weird answers for the answer of this integral

$\displaystyle \int_{0}^{\pi}|\frac{1}{2}+cosx|~dx$

remember what absolute values mean. $\displaystyle |x| = \left \{ \begin{array}{cc} x & \mbox{ if } x \ge 0 \\ & \\ -x & \mbox{ if } x < 0 \end{array} \right.$

thus we need to find where our function (without absolute values) is negative, and negate its integral on that region. we can find that 1/2 + cos(x) is negative for [2pi/3, pi], thus:

$\displaystyle \int_0^{\pi} \left| \frac 12 + \cos x \right|~dx = \int_0^{\frac {2 \pi}3} \left( \frac 12 + \cos x \right)~dx - \int_{\frac {2 \pi}3}^{\pi} \left( \frac 12 + \cos x \right)~dx$
• Dec 10th 2007, 07:00 AM
akhayoon
oh so does the whole 1/2+cosx change to -1/2-cosx?

or does just cosx change to -cosx
• Dec 10th 2007, 07:01 AM
Jhevon
Quote:

Originally Posted by akhayoon
oh so does the whole 1/2+cosx change to -1/2-cosx?

or does just cosx change to -cosx

notice that we have 1/2 + cos(x) in brackets with a minus sign in front of it. what does that mean?
• Dec 10th 2007, 07:28 AM
Soroban
Hello, akhayoon!

Did you make a sketch?

Quote:

$\displaystyle \int_{0}^{\pi}\left|\frac{1}{2}+\cos x\right|\,dx$

It is the cosine curve raised a half-unit.
Code:

        |         *         |:::*         |:::::*         |::::::*         |:::::::         |:::::::*         |::::::::      π     ---+--------o------+---         |        ↑*::::::         |        ↑  *::::         |      2π/3    *         |

I totally agree with Dan's integrals and his final answer.