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 sine times cosine

Definite integral of the product of sine and cosine. Integrating sin(mt) * cos(nt) over a full period equals zero for any integer m and n. Created by Sal Khan.

## Want to join the conversation?

- It would be helpful to state and point to the sum rule and difference rule (for sin function) towards the beginning of the video.
`sin(A+B) = sinA cosB + cosA sinB`

sin(A-B) = sinA cosB - cosA sinB

So the following becomes obvious:`sin(mt)cos(nt) = 1/2 [ sin((m+n)t) + sin((m-n)t) ]`

(42 votes) - If there are such thing as long divition is there such thing as long times?(5 votes)
- What a great question! I bet long multiplication refers to how you multiply numbers bigger than 12. We all memorize our times tables up to 12, and beyond that we do the thing where you multiply one digit at a time and shift over and add it all up. That would be long multiplication. It takes a long time.(5 votes)

- At0:39, Sal claims that the integral of sin(mx) dx from 0 to 2pi is 0 for any integer m, even if m is zero.

Looking at the curve visually, this makes sense as the sin(0) is 0 and constant from 0 to 2pi.

However, we established in the last video that the integral = -1/m * cos(mx)

So -1/0 * (cos(0)-cos(0)) = 0

So -1/0 * 0 = 0

However the equation above is false! We know that dividing anything by 0 makes it undefined and so -1/0 * 1 = not defined...

This means there's some faulty logic that I've applied. Can someone please explain which step is wrong? Is it just the idea that "anything multiplied by 0 is 0"?

Thank you!

EDIT: I just realized the same "logic" holds for the second integral as well

Integral of cos(0) from 0 to 2pi is simply the area of the rectangle of sides 1 and 2pi units, so it's 2pi

Once again, taking the anti-derivative from last video:

1/m * (sin(m*2pi) - (sin(m*0)) = 2pi

1/0 * (0-0) = 2pi

In this case the "anything multiplied by 0 is 0" rule actually seems to be violated...(3 votes)- edit: he never stated that int [cos (0)]=0. i misunderstood, sorry.(1 vote)

- if integration represents the area under the curve, the answer comes out to be zero, because the graph of sine and cosine are symmetrical, and the one cancel the other out.

Since the area above the graph is consider positive and the other negative.

Can you please explain how come to be zero?(3 votes) - With the integral we find the area under the curve, since the area above the x-axis and below the x-axis is symmetrical, and by integration the one above the x-axis is positive and the one below the x-axis is negative the answer comes out to be zero.

But is the area of the curve zero? Can you please explain the reason why you consider this integral to be zero?(2 votes)- You may have realized that integral of sin(mt) and cos(mt) alone, from 0 to 2*pi was zero because the curve was symmetrical under the period of integration i.e., positive area (region under curve above time axis) and negative area (region under curve below time axis) was EQUAL!

This was possible solely because curves sin(mt) and cos(mt) were periodic in nature, which means they repeat after certain time period.

Note that, sin(1*t) has period of 2*pi ('1' complete cycle in period of integration), while sin(mt) has period 2*pi/m ('m' complete cycles in period of integration), hence equal no. of positive and negative areas.

Now, sin(mt)*cos(nt) will also be a periodic function (if you try to plot it) and will contain integral no. of complete cycles in period of integration, and therefore integration of sin(mt)*cos(nt) will be zero.(2 votes)

- How to sin wave signal processing(1 vote)
- Hello Dinesh,

Please elaborate. Are you asking how to produce a sinusoid using DSP methods or are you asking how to filter a sinusoid from a complex waveform?

Please leave a comment below.

Regards,

APD(3 votes)

- Why don't negative integers work in the cosine property?(1 vote)
- Esther it,s broken or it is really techy and it could be programmed rong(2 votes)

- When the integration is equal to zero ?(1 vote)
- I am certain this is not true when m=n though. I think you should mention that. This is because if you take the limit the second integral ends up being cos(0)/0 as m-n=0. Hence you need to use L'Hopitals rule to determine that specific solution right?(1 vote)
- I think there is an error. You can't say "for any integer m" at0:44, because else you divide by zero in the definite integral from 0 to 2pi.

Can anyone confirm?(1 vote)- When you evaluate a definite integral of sin(mt)dt, where does a /0 occur?(1 vote)

## Video transcript

- [Voiceover] We're in our quest to give ourselves a little bit of a mathematical underpinning
of definite integrals of various combinations of trig functions. So, it'll be hopefully straightforward for us to actually find the coefficients, our Fourier coefficients,
which we're going to do a few videos from now. And we've already started
going down this path. We've established that
the definite integral from zero to two pi of sine
of mt dt is equal to zero, and that the definite
integral of cosine mt dt is equal to zero for
any non-zero integer m. And actually, we can
generalize that a little bit. For sine of mt, it could
be for any m actually. And if you don't believe
me, I encourage you, so let me write this, for any, for any integer
m, this top interval's going to be zero and this second interval for any for non-zero,
non-zero integer, integer m. And you can see, if you had
zero in this second case, it would be cosine of zero t, so this would just evaluate to one, so you'd just be integrating the value one from zero to two pi, and so that's going to
have a non-zero value. So, with those two out of the way, let's go a little bit deeper, get a little bit more foundations. So, I now want to establish that the definite integral
from zero to two pi of sine of mt times cosine of nt dt, that this equals zero for any
integers, integers m and n. And they could even be the same. They don't have to
necessarily be different, but they could be different. How do we do this? Well, let's just rewrite
this part right over here, leveraging some trig identities. And if this is completely
unfamiliar to you, I encourage you to review
your trig identities on Khan Academy. So, this is the same thing, has a definite integral
from zero to two pi. This sine of mt times cosine nt, we can rewrite it using the
product to sum formulas. So, that is, let me use
a different color here. So, this thing right over here that I've underlined in magenta, or that I'm squaring off in magenta, that can be rewritten as one half times sine of m plus n t, sine of m plus n t, plus sine, sine of m minus n, m minus n t. And then let me just
close that with a dt, dt. Now, if we were to just rewrite this using some of our integral properties, we could rewrite it as, so this part over here, we could, and let's assume we
distribute the one half, so we're gonna distribute the one half and use some of our integral properties. And so what are we going to get? So, this part roughly, right over here, we could rewrite as one half
times the definite integral from zero to two pi of
sine of m plus n t dt and then this part, once
you distribute the one half and you use some integration properties, this could be plus one half
times the definite integral from zero to two pi of sine
of m minus n, m minus n t dt. Now, what are each of these
things going to be equal to? Well, isn't this right over here, isn't that just some integer? If I have to take the sum
of two arbitrary integers, that's going to be some integer. So, that's going to be some integer. And this, too, is going to be
some integer right over here. And we've already established
that the definite integral of sine of some integer
times t dt is zero. So, by this first thing
that we already showed, this is going to be equal to zero, that's going to be equal to zero. It doesn't matter that you're
multiplying by one half. One half times zero is zero. One half times zero is zero. This whole thing is going
to evaluate to zero. So, there you go; we've
proven that as well.