Main content

### Course: Electrical engineering > Unit 6

Lesson 1: Fourier series- Fourier Series introduction
- Integral of sin(mt) and cos(mt)
- Integral of sine times cosine
- Integral of product of sines
- Integral of product of cosines
- First term in a Fourier series
- Fourier coefficients for cosine terms
- Fourier coefficients for sine terms
- Finding Fourier coefficients for square wave
- Visualizing the Fourier expansion of a square wave

© 2024 Khan AcademyTerms of usePrivacy PolicyCookie Notice

# Integral of product of sines

Definite integral of product of sines. The integral of sin(mt) * sin(nt) = 0, except for the special case when m = n. When m = n, the integral evaluates to pi. Created by Sal Khan.

## Want to join the conversation?

- Shouldn't there be a logical conjunction instead of alternative between m != n and m != -n?(8 votes)
- Yeah, I noticed that too.

m!=n or m!=-n is a tautology except in the case where m=n=0.(3 votes)

- In case anyone is wondering, what the result is when m= -n, the integral value is again pi

because cos(-mt)=cos(mt)

Thank you(6 votes) - But if m = n = 0, then the integral evaluates to 0 as well, because both m+n and m-n are equal to 0, so the integrals cancel out.(3 votes)
- Why is it any non-zero integer for the cosine integral? Why not any integer?(2 votes)
- If you let m=0 you get a degenerate case where the cosine term becomes a constant = 1 (it does not wiggle up and down like a cosine wave, it is stuck at 1). That particular integral does not evaluate to 0 over a full cycle of cosine, so that particular value of m is removed from the general expression. Sal talks about this two videos earlier: https://www.khanacademy.org/science/electrical-engineering/ee-signals/ee-fourier-series/v/ee-integral-of-sinmt-and-cosmt

The case for m=0 for both cos and sin integral terms is the DC term of a Fourier series, which is taken care of separately.(2 votes)

- This can also be proved, even more easily maybe, using integration by parts?(0 votes)

## Video transcript

- [Voiceover] So we've already established that these three definitive roles are going to be equal to zero over slightly different conditions. Let's keep on going, and remember the goal here
is to make it simple for us to find our Fourier coefficients
in a few videos from now. So now let's think about
the definitive role from zero to two pie if we're taking the product of sine of
mt times sine of nt dt, and we're gonna think about
it in two different scenarios. We're gonna think about
when m does not equal n or m does not equal negative n, and really we care more
about this scenario because in the Fourier series we're gonna be dealing
with positive integers, or non negative integers
I guess we could say, but this is going to be
true for both of them and we're gonna see when this is true this integral is going to
be zero when that's true, and it's gonna be equal to pie when m is equal to n, or another way we could write this. Actually let me write it this way. This integral is equal to zero when m does not equal n or m does not equal negative n and we're gonna assume integers. When integers m does not equal n or m does not equal negative n, and then if n is equal to m or visa versa. We could say that the
integral from zero to two pie. Let me do this in a different color. Just 'cause I think it will look nice. So the integral from zero to two pie. If m is equal to n we could write that as sine of mt times sine of mt which is gonna be sine squared of mt dt. We're going to establish
that this is going to be equal to pie. Now how are we going to do that? Well we can rewrite this
original thing right over here. We can rewrite this original thing using a product to sum formula. So let's actually do that. So rewriting this integral. It's the integral from zero to two pie and I can rewrite, and this
is just a trig identity that I'm going to be using. This is the same thing as
one half times times cosine of mt minus nt. So we could write that at m minus n t and then minus cosine of mt plus nt, or we could write that as m plus n t, and actually let me put parentheses around these whole things so it's
more clear what's going on. This right over here is just
the product to sum formula. When you're taking the product of the sine of two different things here, and of course this is going to be dt. Now if we use some of our
integration properties we can rewrite all of this as being the integral
from zero to two pie. In fact we could put that
one half out front twice. I'm gonna write this is, I guess you could say the
difference of two integrals. Two definite integrals. So we could have this one half. Let me write it in that same color. That one half right over there
times the definite integral from zero two pie of cosine
of m minus n t dt minus, and once again I'm just
distributing this one half, so minus, and taking it
out of the integrals. So minus one half times
the definite integral from zero to two pie, and I'm gonna have the dt out here, so let me just write the
dt out there in magenta, of cosine of m plus n, t, dt, and this is a slightly
different shade of blue so let me color that in as well. So once again we get from that to that just using our integration properties. You can distribute the one half and say okay the integral
of the difference is the same thing as the
difference of the integrals. You could take the one half
out of the integration sine and we get to this right over here. Now what do we know about this in the case where m and n are integers that either don't equal
each other or don't equal the negatives of each other? Well they don't equal each other or don't equal to the
negatives of each other. Then this right over here is
going to be a non-zero integer. Non-zero integer and
this also is going to be a non-zero integer, and so we already know
that if we're taking the definite integral of cosine of mt dt from zero to two pie. Where m is some non-zero integer. Where the coefficient on
t is a non-zero integer then that integral's
gonna evaluate it to zero, but that's what we're doing over here, and it doesn't look exactly the same but this is a non-zero
integer coefficient. This is a non-zero integer coefficient. So this whole integral's gonna be zero, this whole integral's gonna be zero, and even if you multiply it by one half you still get a bunch of zeros. So hopefully that makes you feel good about that statement right over here. When m does not equal n or
m does not equal negative n, this whole thing is just
going to evaluate it to zero. That's gonna be zero and
that is going to be zero. Now let's think about the
situation where m does equal n, and actually let me just
delete this a little bit so that we have some space to work with. So if we assume. Actually let me keep that part there. So let me keep all of that there. Alright, now if m is, and actually I even colored. So if we assume in the
case of sine squared of mt. If we assume if m is equal
to n then what happens here? Remember, the thing I wrote in green is just the top one where m is equal to n. If m is equal to n. Well what happens is this
second integral right over here. This is still going to be a
non-zero integer coefficient. So that one is going to still be zero based on what we just argued, but this right over here, m minus n, that is going to be zero. You're going to have a
zero coefficient there. So it's going to be cosine of zero t. Well cosine of zero t,
that's cosine of zero regardless of what t you have, and cosine of zero is
going to be equal to one, and so everything in the
case where m is equal to n. This whole thing
simplifies to the one half times the integral from zero to two pie, and I could write of one
dt if we like, one dt. Remember this is the case
where m is equal to n, and so what is that going to be equal to? Well that's going to be
equal to one half times. Well the anti derivative of one is just t. So it's just going to be t
evaluated at two pie and zero, and so that is going to
be equal to one half. I'm doing the same color so
we can keep track of things. So that is going to be
equal to one half times two pie minus zero. Two pie minus zero. Well two pie minus zero is just two pie. So I could just write that's
one half times two pie. Which of course is just
going to be equal to pie. So we just said, look
when m is equal to n. Well if m is equal to n
the magenta expression is the same thing as
what I wrote in green, and so when m is equal
to n at this integral. That integral, when m is
equal to n is going to be, and that's the same thing
as sine squared of mt, that is going to be equal to pie.