Math Help - Integral of Abs Value Trigonometric function

1. Integral of Abs Value Trigonometric function

So I have to integrate this function... looked simple enough at first but soon I found it was not so. I've found the answer using wolframalpha and solutions etc. but don't understand completely how to get there

I first tried integrating sin(abs(x)) just to -cos(abs(x)) and got 0+1/sqrt(2), obviously wrong. Then I tried to break it up - integral of sinx=-cosx for the positive value and integral of sin(-x)=cosx for the negative value, but this just gave me -1/sqrt(2)...

How exactly do I have to break this up to get it to work?

2. EDIT: No, that's wrong. Hold on a sec.

$\displaystyle = \int^{\pi /4}_{0} \sin x \ dx + \int^{\pi /2}_{0} \sin x \ dx$

Originally Posted by Random Variable
EDIT: No, that's wrong. Hold on a sec.
Alright, thank you!

4. Originally Posted by metaname90
Alright, thank you!
You need to break the original integral into two integrals 1 from -pi/4 to 0 and 0 to pi/2 since abs value is $-x, \ x<0$ and $x, \ x>0$

Originally Posted by dwsmith
You need to break into two integrals 1 from -pi/4 to 0 and 0 to pi/2
That's what Random Variable said before saying that was incorrect... he had:

$- \int^{0}_{-\pi/4} \sin x \ dx + \int^{\pi/2}_{0} \sin x \ dx$

But I was about to ask some more questions about exactly how that applies to other cases and not just this case... was it that $\int^{0}_{-\pi/4} \sin (-x) \ dx = \int^{0}_{-\pi/4} -\sin x \ dx = - \int^{0}_{-\pi/4} \sin x \ dx$ or what...

6. Originally Posted by Random Variable
EDIT: No, that's wrong. Hold on a sec.

$\displaystyle = \int^{\pi /4}_{0} \sin x \ dx + \int^{\pi /2}_{0} \sin x \ dx$
Okay thank you, I see where you got that function but I'm still trying to understand this exactly... for the second integral everything is just normal because x > 0, and for the first one since x < 0 we need the integral of sin(-x) which equals -sin(x) then we can take - integral of sinx but when we flip the integral that becomes positive... so how does -pi/4 go to pi/4?

Thanks!

7. Originally Posted by metaname90
That's what Random Variable said before saying that was incorrect... he had:

$- \int^{0}_{-\pi/4} \sin x \ dx + \int^{\pi/2}_{0} \sin x \ dx$

But I was about to ask some more questions about exactly how that applies to other cases and not just this case... was it that $\int^{0}_{-\pi/4} \sin (-x) \ dx = \int^{0}_{-\pi/4} -\sin x \ dx = - \int^{0}_{-\pi/4} \sin x \ dx$ or what...
You can do -Pi/4 to 0 too.

8. Originally Posted by metaname90
Okay thank you, I see where you got that function but I'm still trying to understand this exactly... for the second integral everything is just normal because x > 0, and for the first one since x < 0 we need the integral of sin(-x) which equals -sin(x) then we can take - integral of sinx but when we flip the integral that becomes positive... so how does -pi/4 go to pi/4?

Thanks!
$\displaystyle \int^{\pi /4}_{0} \sin x \ dx + \int^{\pi /2}_{0} \sin x \ dx \equiv -\int^{0}_{-\pi/4} \sin x \ dx + \int^{\pi /2}_{0} \sin x \ dx$

9. Originally Posted by metaname90
So I have to integrate this function... looked simple enough at first but soon I found it was not so. I've found the answer using wolframalpha and solutions etc. but don't understand completely how to get there

I first tried integrating sin(abs(x)) just to -cos(abs(x)) and got 0+1/sqrt(2), obviously wrong. Then I tried to break it up - integral of sinx=-cosx for the positive value and integral of sin(-x)=cosx for the negative value, but this just gave me -1/sqrt(2)...

How exactly do I have to break this up to get it to work?

Definition of |x|:

$|x|=\left\{\begin{array}{cc}\ x,&\mbox{ if }
x>0\\ \ 0, &\mbox{ if }
x=0\\ \ -x, & \mbox{ if } x<0\end{array}\right.$

sin(x) is an odd function, therefore:

$\sin\left(|x|\right)=\left\{\begin{array}{cc}\ \sin(x),&\mbox{ if }
x>0\\ \ \sin(0), &\mbox{ if }
x=0\\ \ -\sin(x), & \mbox{ if } x<0\end{array}\right.$