## Integration of sin^2(x)

Could somebody please check my work on the integration of $$sin^{2}x dx$$? Thank you for your time.

First step: Complexify the function in order to make straight integration possible

$$\sin x=\frac{e^{ix}-e^{-ix}}{2i}$$

$$\sin^{2}x=-\frac{1}{2}-\frac{e^{2ix}+e^{-2ix}}{4}$$

Second step: Integrate the complex function

$$-\frac{1}{4}\int{2+e^{2ix}+e^{-2ix} dx} = -\frac{1}{4}(2x+\frac{e^{2ix}}{2i}-\frac{e^{-2ix}}{2i}+C)$$

$$\mbox{However,} \frac{e^{2ix}-e^{-2ix}}{2i} = \sin(2x), \mbox{so}$$
$$-\frac{1}{4}(2x+\frac{e^{2ix}}{2i}-\frac{e^{-2ix}}{2i}+C) = -\frac{\frac{1}{2}\sin(2x)+x}{2}+C, \mbox{which appears to be the answer. Can it survive the derivative test?}$$

Third step: Take the derivative of $$-\frac{\frac{1}{2}\sin(2x)+x}{2}+C$$ and see if it equals $$\sin^{2}x$$

$$\frac{d}{dx}(-\frac{\frac{1}{2}\sin(2x)+x}{2}+C)=-\frac{1}{2}-\frac{1}{2}\cos(2x)=-\frac{1}{2}(1+\cos(2x))=-\cos^{2}x \mbox{, which is the answer less one.}$$

Where is the error in the above process?

 PhysOrg.com science news on PhysOrg.com >> 'Whodunnit' of Irish potato famine solved>> The mammoth's lament: Study shows how cosmic impact sparked devastating climate change>> Curiosity Mars rover drills second rock target
 I don't think it's that complicated. I would just use the identity $\sin^2x = \frac{1}{2}(1 - \cos2x)$. that's probably what I would use if I had to reduce (& integrate) any even power of sin or cos, since $\cos^2x = \frac{1}{2}(1 + \cos2x)$. look at all the other trig identities on wiki: http://en.wikipedia.org/wiki/Trig_identities

Mentor
 Quote by planck42 Could somebody please check my work on the integration of $$sin^{2}x dx$$? Thank you for your time. First step: Complexify the function in order to make straight integration possible $$\sin x=\frac{e^{ix}-e^{-ix}}{2i}$$ $$\sin^{2}x=-\frac{1}{2}-\frac{e^{2ix}+e^{-2ix}}{4}$$
Check this step again. Does this agree with the identity

$$\sin^2 x = \frac {1-\cos 2x}2$$

Recognitions:
Gold Member
Staff Emeritus

## Integration of sin^2(x)

 Quote by planck42 Could somebody please check my work on the integration of $$sin^{2}x dx$$? Thank you for your time. First step: Complexify the function in order to make straight integration possible $$\sin x=\frac{e^{ix}-e^{-ix}}{2i}$$ $$\sin^{2}x=-\frac{1}{2}-\frac{e^{2ix}+e^{-2ix}}{4}$$
You have a sign error.
$$\left(\frac{e^{ix}- e^{-ix}}{2i}\right)^2= -\frac{1}{4}\left({e^{2ix}- 2+ e^{-2ix}\right)$$
$$= \frac{1}{2}- \frac{e^{2ix}+ e^{-2ix}}{4}$$

 Second step: Integrate the complex function $$-\frac{1}{4}\int{2+e^{2ix}+e^{-2ix} dx} = -\frac{1}{4}(2x+\frac{e^{2ix}}{2i}-\frac{e^{-2ix}}{2i}+C)$$ $$\mbox{However,} \frac{e^{2ix}-e^{-2ix}}{2i} = \sin(2x), \mbox{so}$$ $$-\frac{1}{4}(2x+\frac{e^{2ix}}{2i}-\frac{e^{-2ix}}{2i}+C) = -\frac{\frac{1}{2}\sin(2x)+x}{2}+C, \mbox{which appears to be the answer. Can it survive the derivative test?}$$ Third step: Take the derivative of $$-\frac{\frac{1}{2}\sin(2x)+x}{2}+C$$ and see if it equals $$\sin^{2}x$$ $$\frac{d}{dx}(-\frac{\frac{1}{2}\sin(2x)+x}{2}+C)=-\frac{1}{2}-\frac{1}{2}\cos(2x)=-\frac{1}{2}(1+\cos(2x))=-\cos^{2}x \mbox{, which is the answer less one.}$$ Where is the error in the above process?

 Quote by HallsofIvy You have a sign error. $$\left(\frac{e^{ix}- e^{-ix}}{2i}\right)^2= -\frac{1}{4}\left({e^{2ix}- 2+ e^{-2ix}\right)$$ $$= \frac{1}{2}- \frac{e^{2ix}+ e^{-2ix}}{4}$$
Wow. What a simple error to overlook. So the final answer is
$$-\frac{1}{4}\sin(2x)+\frac{1}{2}x+C$$ which does differentiate to $$\sin^{2}x$$

Thank you.

 the expansion for sin(x) which you have used is for hyperbolic function of sin(x) . hyperbolic function of sin(x) is sin(hx).
 Recognitions: Gold Member Science Advisor Staff Emeritus No, he has used the correct formula: $$sin(x)= \frac{e^{ix}- e^{-ix}}{2i}$$ The corresponding formula for sinh(x) is $$sinh(x)= \frac{e^x- e^{-x}}{2}$$.
 can u explain the formula from where it is derived
 Mentor Euler's formula, $$e^{ix} = \cos x + i\sin x$$