# Finding Fourier Coefficients for a Function's Waveform

• WJSwanson

## Homework Statement

For an even function, the Fourier series takes the form
$^{\infty}_{n=0}\Sigma A_n cos(\frac{2\pi n x}{\lambda})$
where $\lambda$ is the wavelength of the function. In this problem you will see how to find the Fourier coefficients $A_n$.

a.) Prove that
$A_0 = \frac{1}{\lambda} \int^{\lambda}_0 F(x)dx$
(Hint: Integrate F(x) from x = 0 to x = $\lambda$.)

b.) Prove that, for m > 0,
$A_m = \frac{2}{\lambda} \int^{\lambda}_0 F(x) cos(\frac{2\pi m x}{\lambda}) dx$
where Am (rather than An) is the Fourier coefficient for reasons that will become apparent in your proof. [Hint: Multiply both sides of equation (6.57) by $cos (\frac{2\pi m x}{\lambda})$, and integrate from 0 to λ.]

## Homework Equations

Equation (6.57): $F(x) = ^\infty _{n=0} \Sigma A_n cos(\frac{2\pi n x}{\lambda})$
Final result (a) should be: $A_0 = \frac{1}{\lambda} \int^{\lambda}_0 F(x) dx$
Final result (b) should be: $A_m = \frac{2}{\lambda} \int^{\lambda}_0 F(x) cos(\frac{2\pi m x}{\lambda}) dx$
For a square wave: $A_n = \frac{2}{\pi n} cos(\frac{\pi a n}{\lambda})$ (Eq. 6.26)

## The Attempt at a Solution

For part (a) I tried integrating as suggested. I ended up with

$\int^{\lambda}_0 A_n cos(\frac{2\pi n x}{\lambda})dx = \frac{\lambda A_{n} sin(2\pi n)}{2\pi n}$
...which doesn't do anything for me. Substituting 0 for n sets the whole sine argument equal to 0 (which is problematic in its own right, given the known expected outcome) but even worse puts a 0 in the denominator. If I substitute the function for An for an even square wave, I get

$\frac{2}{\pi n} * cos(\frac{\pi a n}{\lambda}) * \frac{sin({2\pi n})}{2\pi n}$

...which still doesn't do a thing for me, for the same reasons. I'm pretty badly lost here, and I'm not sure where to take the problem.

What if you pick a function for F(x) such that only one of the An coefficients it not zero?
Say F(x)=L.

I'm afraid I don't quite understand what you mean. I should replace F with an arbitrary function L?

Not a function L, but an arbitrary constant L.

Since F(x) is supposed to be written as the sum of cosines, for a constant function each cosine term must be zero, except for the constant term A0.

So if you calculate A0 with the integral expression, you should find the constant L again.

WJSwanson said:
For part (a) I tried integrating as suggested. I ended up with

$\int^{\lambda}_0 A_n cos(\frac{2\pi n x}{\lambda})dx = \frac{\lambda A_{n} sin(2\pi n)}{2\pi n}$

What is sin(2πn), (do not forget that n is integer)?

ehild

I like Serena said:
Not a function L, but an arbitrary constant L.

Since F(x) is supposed to be written as the sum of cosines, for a constant function each cosine term must be zero, except for the constant term A0.

So if you calculate A0 with the integral expression, you should find the constant L again.

How would the cosine terms be zero if they're cos(2πnx)? Wouldn't that require that x is always equal to 1/4 + some integer m, or something along those lines? I don't know how that would work unless there was some phase angle introduced to the argument, for n = 0.

ehild said:
What is sin(2πn), (do not forget that n is integer)?

ehild

Right, sin(2πn) is 0 for all integer values of n. That's what was so problematic for me. Is the point supposed to be that A0 is always equal to 0?

The Fourier theorem states that any even function F(x) with wavelength λ can be written as:
F(x)=A0 + A1 cos(2pi x/λ) + A2 cos(2pi 2x/λ) + A3 cos(2pi 3x/λ) + ...

The coefficients A0, A1, A2, A3, ... are unique.

If F(x) is the constant function, it can be written as F(x)=A0.
This means that A1, A2, A3, ... will have to be zero, making all the cosine terms zero.

Can you calculate A0 with the integral formula for A0?

So that would mean I have

$F(x) = A_0 cos(\frac{2\pi n x}{\lambda}) = A_0 cos(0) = A_0$

which in turn means that

$\int^{\lambda}{0} F(x)dx = \int^{\lambda}_0 A_0 dx = \lambda A_0$

which then gives

$\lambda A_0 = \int^{\lambda}_0 F(x)dx \Rightarrow A_0 = \frac{1}{\lambda} \int^{\lambda}_0 F(x)dx$
?

Hey, that's the answer I'm told to expect. Thanks. I feel kind of like a moron right about now. I'm in an intro class for PDEs and somehow I forgot the basics of freshman-level calc. :|
Thanks for the help, lol. I'll put up an attempt at part b.) in a while.

Last edited:

Congrats! ;)

Okay, so part b.) was actually pretty easy and straightforward. I did it in like 3 minutes.

I multiplied both sides by $cos(\frac{2\pi m x}{\lambda}$ to get

$F(x) cos(\frac{2\pi m x}{\lambda}) = \Sigma_{n=0}^{\infty} A_m cos(\frac{2\pi m x}{\lambda}) cos(\frac{2\pi n x}{\lambda})$

and from there just proved that since

$cos(\frac{2\pi m x}{\lambda}) cos(\frac{2\pi n x}{\lambda}) = \frac{1}{2} cos(\frac{2\pi x}{\lambda} (m-n)) + cos(\frac{2\pi x}{\lambda} (m+n))$

and m & n are defined as integers,

$m \neq n \Rightarrow \int^{\lambda}{0} cos(\frac{2\pi m x}{\lambda}) cos(\frac{2\pi n x}{\lambda})dx \equiv \frac{1}{2} sin(2\pi) + sin(2\pi) = 0$

and that

$m = n \Rightarrow \int^{\lambda}_0 cos(\frac{2\pi m x}{\lambda}) cos(\frac{2\pi n x}{\lambda})dx = \int^{\lambda}_0 cos^{2}(\frac{2\pi m x}{\lambda})dx = \int^{\lambda}_0 \frac{1}{2} (1 + cos(\frac{4\pi m x}{\lambda}) ) = \frac{\lambda}{2} + \frac{\lambda}{4\pi m} sin(4\pi m) = \frac{\lambda}{2} + k sin(0) = \frac{\lambda}{2}$.

Since by the definitions implied in the proof, m = n, you multiply the integrand for that case by Am and get

$A_m \frac{\lambda}{2} = \int^{\lambda}_0 F(x) cos(\frac{2\pi m x}{\lambda})dx \Rightarrow A_m = \frac{2}{\lambda} \int^{\lambda}_0 F(x) cos(\frac{2\pi m x}{\lambda})dx$...

...quod erat demonstrandum.

Just let me know if I fouled it up somewhere or got the right answer but got there by doing something naughty or non-rigorous. ;)

Well, you've got a typo at sin(4πm), which should be sin(4πm/lambda).
But otherwise... looks good! ;)

Last edited:

That wouldn't be a typo. That's the result of evaluating the integral at x = lambda. :)