# Integration of sin^2(x)

by planck42
Tags: integration, sin2x
 P: 82 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?
 P: 948 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
P: 15,201
 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$$

Math
Emeritus
Thanks
PF Gold
P: 39,682
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?
P: 82
 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.
 P: 162 the expansion for sin(x) which you have used is for hyperbolic function of sin(x) . hyperbolic function of sin(x) is sin(hx).
 Math Emeritus Sci Advisor Thanks PF Gold P: 39,682 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}$$.
 P: 162 can u explain the formula from where it is derived
 Mentor P: 15,201 Euler's formula, $$e^{ix} = \cos x + i\sin x$$

 Related Discussions Calculus & Beyond Homework 3 Calculus & Beyond Homework 5 Calculus & Beyond Homework 3 Calculus & Beyond Homework 5 Calculus 9