Integration of sin^2(x)

1. Dec 25, 2009

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}$$

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?

2. Dec 25, 2009

fourier jr

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

Last edited: Dec 25, 2009
3. Dec 25, 2009

D H

Staff Emeritus
Check this step again. Does this agree with the identity

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

4. Dec 26, 2009

HallsofIvy

Staff Emeritus
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}$$

5. Dec 26, 2009

planck42

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.

6. Dec 27, 2009

amaresh92

the expansion for sin(x) which you have used is for hyperbolic function of sin(x) .
hyperbolic function of sin(x) is sin(hx).

7. Dec 27, 2009

HallsofIvy

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}$$.

8. Dec 27, 2009

amaresh92

can u explain the formula from where it is derived

9. Dec 27, 2009

D H

Staff Emeritus
Euler's formula,

$$e^{ix} = \cos x + i\sin x$$