Fourier series solutions IV - Computing Fourier coefficients

We will now answer one of three main questions about Fourier series:

Question

If a periodic function f can be represented by a (complex) Fourier series, then what are the coefficients in that Fourier series?

Representation by power series


Before answering this question, let's recall how the situation played out for power series. To that end, suppose a given function f can be represented by a power series (centered at x=0, for simplicity). This means that there exist some constants an such that

f(x)=βˆ‘n=0∞anxn,

at least on some open interval around x=0. We can make various deductions from such an equality. For instance, we can evaluate both sides at x=0. This results in the equality

f(0)=a0.

That's convenient, since we now know a0=f(0). We could also try evaluating both sides at other values of x, but there are two issues with that. The first is that we're not exactly certain on which interval around x=0 the equality holds. We just know they're equal on some open interval. Ignoring that issue, there's another problem. Suppose we knew the functions were also equal at x=1, say. Evaluating both sides at x=1 would then give

f(1)=βˆ‘n=0∞an.

This is nice, but it's an equality involving all of the unknown coefficients. We would prefer an equality involving a single coefficient, like how we found f(0)=a0.

So we try another idea. Since f equals the power series near x, the derivative of f should also match the derivative of the power series, at least near x. In other words, we should also have

fβ€²(x)=βˆ‘n=1nanxnβˆ’1.

Now we return to our initial idea, once again evaluating both sides at x=0. This gives

fβ€²(0)=1β‹…a1,

and hence a1=fβ€²(0). At this point, the strategy is clear. If we take k derivatives on both sides of our original equation and then evaluate at x=0, we obtain the equality

f(k)(0)=k!ak,

and hence ak=f(k)(0)k!. We thus conclude that if any power series centered at x=0 represents f, then that power series must be

βˆ‘n=0∞f(n)(0)n!xn.

Representation by complex exponential functions


We now try a similar strategy for (complex) Fourier series. Suppose f(t) is a periodic function with period 1, and suppose f(t) can be represented by some Fourier series. That is, suppose

f(t)=βˆ‘n=βˆ’βˆžβˆžcne2Ο€int.

If we assume this equality is meant to hold for all real t, then in principle we can evaluate both sides at any value of t we so desire. For example, evaluating both sides at t=0 yields

f(0)=βˆ‘n=βˆ’βˆžβˆžcn=β‹―+cβˆ’2+cβˆ’1+c0+c1+c2+β‹―.

Much like when we evaluated the power series at x=1 above, we have learned something about the Fourier coefficients, but not exactly what we were looking for. Instead of determining any single coefficient, we obtained an equality involving every coefficient. Taking derivatives doesn't help this time, either, as one can readily verify. For example, we can deduce that

fβ€²(t)=βˆ‘n=βˆ’βˆžβˆž2Ο€incne2Ο€int,

and evaluating at t=0 then gives

fβ€²(0)=βˆ‘n=βˆ’βˆžβˆž2Ο€incn=β‹―βˆ’4Ο€icβˆ’2βˆ’2Ο€icβˆ’1+2Ο€ic1+4Ο€ic2+β‹―.

Again, we've learned something, but it's not clear how useful that information is.

So we're forced to try something new. What we're about to do could fairly be described as a trick, in that it's not intuitively clear from where this idea originates.[1] In any case, this trick should (for the moment) simply be viewed as a way to isolate the value of any single coefficient. To that end, suppose we wish to obtain an equality involving only the coefficient cm, for some fixed integer m. Observe that whenever n is an integer distinct from m, we have

∫01e2Ο€inteβˆ’2Ο€imtdt=∫01e2Ο€i(nβˆ’m)tdt=12Ο€i(nβˆ’m)(e2Ο€i(nβˆ’m)βˆ’e0)=12Ο€i(nβˆ’m)(1βˆ’1)=0.

(Recall that e2Ο€ik=1 whenever k is an integer.) On the other hand, when n=m, we have

∫01e2Ο€imteβˆ’2Ο€imtdt=∫011dt=1.

We've discovered an operation that can "extract" information about cm, namely to multiply by eβˆ’2Ο€mt and integrate over [0,1]. So let's try that with our original equation:

∫01f(t)eβˆ’2Ο€imtdt=∫01(βˆ‘n=βˆ’βˆžβˆžcne2Ο€int)eβˆ’2Ο€imtdt=∫01(βˆ‘n=βˆ’βˆžβˆžcne2Ο€i(nβˆ’m)t)dt=βˆ‘n=βˆ’βˆžβˆžcn(∫01e2Ο€i(nβˆ’m)tdt)=cm.
Warning

It is not always safe to interchange the order of integration and infinite summation, but we won't worry about that danger here.

In summary, we've shown:

Integral formula for complex Fourier series coefficients

Suppose f(t) is a periodic function with period 1. If

f(t)=βˆ‘n=βˆ’βˆžβˆžcne2Ο€int

for some complex numbers cn, then those complex numbers must satisfy

cn=∫01f(t)eβˆ’2Ο€intdt.

Some remarks

The function f(t)eβˆ’2Ο€int is always periodic with period 1, so the above integral can be computed over any interval of length 1, i.e.,

∫01f(t)eβˆ’2Ο€intdt=∫aa+1f(t)βˆ’2Ο€intdt.

Sometimes calculations can be made simpler by exploiting this fact; e.g., by computing

βˆ«βˆ’1212f(t)eβˆ’2Ο€intdt

when the function f(t) is known to have some type of symmetry about the origin.

New notation for the complex Fourier coefficients

It is very common to write f^(n) for the complex Fourier coefficient cn in the above result. In other words, they are the numbers that satisfy

f^(n)=∫01f(t)eβˆ’2Ο€intdt.

If f(t) is represented by any complex Fourier series, then that series must be the series

βˆ‘n=βˆ’βˆžβˆžf^(n)e2Ο€int.

We call this series the complex Fourier series corresponding to f (even in the case f itself does not exactly equal this series).

A terrible example


We will have better examples in the next section, but let's start with an example of a function f(t) for which we have two separate methods to compute the complex Fourier coefficients. To that end, consider the function

f(t)=sin⁑(2Ο€t)βˆ’cos⁑(2Ο€t)+5sin⁑(6Ο€t).

Using our identities, we have

f(t)=sin⁑(2Ο€t)βˆ’cos⁑(2Ο€t)+5sin⁑(6Ο€t)=e2Ο€itβˆ’eβˆ’2Ο€it2iβˆ’e2Ο€it+eβˆ’2Ο€it2+5β‹…e6Ο€itβˆ’eβˆ’6Ο€it2i=βˆ’52ieβˆ’6Ο€it+(βˆ’12βˆ’12i)eβˆ’2Ο€it+(βˆ’12+12i)e2Ο€it+52ie6Ο€it=5i2eβˆ’6Ο€it+(βˆ’12+i2)eβˆ’2Ο€it+(βˆ’12βˆ’i2)e2Ο€itβˆ’5i2e6Ο€it

It immediately follows that

f^(βˆ’3)=52i,f^(βˆ’1)=βˆ’12+12i,f^(1)=βˆ’12βˆ’12i,f^(3)=βˆ’52i,

and all other f^(n)=0.

Now let's do something incredibly painful and see how we can obtain these same values using the integral formula. By our integral formula, we have

f^(0)=∫01f(t)dt=∫01sin⁑(2Ο€t)βˆ’cos⁑(2Ο€t)+5sin⁑(6Ο€t)dt=[βˆ’12Ο€cos⁑(2Ο€t)βˆ’12Ο€sin⁑(2Ο€t)βˆ’56Ο€cos⁑(6Ο€t)]01=0.

For all n≠0, we have

f^(n)=∫01f(t)eβˆ’2Ο€intdt=∫01(sin⁑(2Ο€t)βˆ’cos⁑(2Ο€t)+5sin⁑(6Ο€t))eβˆ’2Ο€intdt=∫01sin⁑(2Ο€t)eβˆ’2Ο€intdtβˆ’βˆ«01cos⁑(2Ο€t)eβˆ’2Ο€intdt+5∫01sin⁑(6Ο€t)eβˆ’2Ο€intdt.

Each of these three integrals requires two integration by parts to compute. We could compute theme each manually, or we could look up the following general formulas in a table of integrals:

∫sin⁑(at)ebtdt=1a2+b2(bsin⁑(at)βˆ’acos⁑(at))ebt+C∫cos⁑(at)ebtdt=1a2+b2(asin⁑(at)+bcos⁑(at))ebt+C.

However, there is a small catch: these formulas are only valid when a2+b2β‰ 0. For example, we have

∫01sin⁑(2Ο€t)eβˆ’2Ο€intdt=[14Ο€2βˆ’4Ο€2n2(βˆ’2Ο€insin⁑(2Ο€t)βˆ’2Ο€cos⁑(2Ο€t))eβˆ’2Ο€int]01=0,

so long as 4Ο€2βˆ’4Ο€2n2β‰ 0, i.e., nβ‰ Β±1. Similarly, for nβ‰ Β±1 we also have

∫01cos⁑(2Ο€t)eβˆ’2Ο€intdt=[14Ο€2βˆ’4Ο€2n2(2Ο€sin⁑(2Ο€t)βˆ’2Ο€incos⁑(2Ο€t))eβˆ’2Ο€itn]01=0,

and for n≠±3 we have

∫01sin⁑(6Ο€t)eβˆ’2Ο€intdt=[136Ο€2βˆ’4Ο€2n2(βˆ’2Ο€insin⁑(6Ο€t)βˆ’6Ο€cos⁑(6Ο€t))eβˆ’2Ο€int]01=0.

We've thus shown that f^(n)=0 for all n≠±1,±3. It remains to computer f^(n) for n=±1,±3. For n=1, observe that

∫01sin⁑(2Ο€t)eβˆ’2Ο€itdt=∫01sin⁑(2Ο€t)(cos⁑(2Ο€t)βˆ’isin⁑(2Ο€t))dt=∫01sin⁑(2Ο€t)cos⁑(2Ο€t)dtβˆ’i∫01sin2⁑(2Ο€t)dt=0βˆ’iβ‹…12=βˆ’12i,

where we computed the last integrals by the usual methods of calculus. By a similar method, one computes

∫01cos⁑(2Ο€t)eβˆ’2Ο€itdt=∫01cos2⁑(2Ο€t)dtβˆ’i∫01sin⁑(2Ο€t)cos⁑(2Ο€t)dt=12,

and

∫01sin⁑(6Ο€t)eβˆ’2Ο€itdt=∫01sin⁑(6Ο€t)cos⁑(2Ο€t)dtβˆ’i∫01sin⁑(6Ο€t)sin⁑(2Ο€t)dt=0.

Putting these altogether gives

f^(1)=∫01sin⁑(2Ο€t)eβˆ’2Ο€itdtβˆ’βˆ«01cos⁑(2Ο€t)eβˆ’2Ο€itdt+5∫01sin⁑(6Ο€t)eβˆ’2Ο€itdt=βˆ’12iβˆ’12+5β‹…0=βˆ’12βˆ’12i.

We could repeat the same painful procedure to compute f^(βˆ’1), or we could recall that f^(βˆ’1) is the complex conjugate of f^(1), and so f^(βˆ’1)=βˆ’12+12i.

We are done as soon as we repeat the above procedure for n=3. We will omit most of the details and just give the necessary integrals and their values. We ultimately find that

f^(3)=∫01sin⁑(2Ο€t)eβˆ’6Ο€itdtβˆ’βˆ«01cos⁑(2Ο€t)eβˆ’6Ο€itdt+5∫01sin⁑(6Ο€t)eβˆ’6Ο€itdt=0βˆ’0+5β‹…βˆ’12i=βˆ’52i.

As before, we then also have that f^(βˆ’3)=52i.

To summarize, we have found

f^(βˆ’3)=52i,f^(βˆ’1)=βˆ’12+12i,f^(1)=βˆ’12βˆ’12i,f^(3)=βˆ’52i,

and all other f^(n)=0.

Observation

Look at how much easier it was to compute f^(n) using the identities! Just as with computing Taylor series, sometimes it can really pay off not to rely exclusively on the integral formula to compute Fourier coefficients.

Suggested next notes


Fourier series solutions V - Computing some Fourier series


  1. We will soon see a straightforward explanation for what's really going on with this idea. β†©οΈŽ