# Homework Help: Fourier Series - Am I Crazy or is My Teacher Tricking Me?

1. Nov 3, 2012

### mundane

I am SO annoyed with this problem. Ready to jump out a window.

1. The problem statement, all variables and given/known data

Find the first three terms of the Fourier series that approximates f(θ) = tan(θ) from θ = -π/2 to π/2.

3. The attempt at a solution

So, I know that for an equation on [$\frac{-b}{2}$, $\frac{b}{2}$], to define the Fourier series for that equation we use f(x)={a0+a1cosx+a2cos2x+ ... +b1sinx+b2sin2x+ ...}

I only need to find the first three terms, so its just a0+a1cosx+b1sinx.

a0 is defined as $\frac{1}{\pi}$$\int\f(x)dx$ definite integral from -π/2 to π/2.

a1 is defined as $\frac{2}{\pi}$$\int\f(x)cos(2πx/π)dx$ definite integral from -π/2 to π/2.

b1 is defined as $\frac{2}{\pi}$$\int\f(x)sin(2πx/π)dx$ definite integral from -π/2 to π/2.

For a0, my antiderivative was -log(cos(x)). After substitution, a0=0.

For a1, my antiderivative was log(cos(x))-(1/2)cos(2x). After substitution, a1=0.

I have not done b1 yet. Am I being trolled?

Does this ave something to do with the fact that tan(x) is undefined at those two interval points? Am I going in the wrong direction???
1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution

2. Nov 3, 2012

### mundane

Those red f(x) should have no forward slash before them, sorry.

3. Nov 3, 2012

### Hurkyl

Staff Emeritus
Actually, you should have expected those two. tan x is an odd function, so you should expect all of the coefficients on the cosines to be 0 (because those terms give you the even part of the function).

4. Nov 3, 2012

### mundane

I know, but I had to show my work, I knew it was coming but thought maybe I was missing something.

For b1, I got π. So my first three terms are 0+(0)cosx+πsinx?

That's a horrendous approximation... Is that right?

5. Nov 3, 2012

### Hurkyl

Staff Emeritus
Did you remember the constant out front?

The approximation is going to have to be bad, given the shape of sine and tangent. I don't use Fourier series enough to know whether or not I should have expected b1=1.

Are you sure your professor didn't mean for you to compute b1 through b3?

6. Nov 3, 2012

### Hurkyl

Staff Emeritus
Actually, aren't your basis functions supposed to be cos 2x, cos 4x, cos 6x, ... and sin 2x, sin 4x, sin 6x, ...?

7. Nov 3, 2012

### mundane

No, they aren't supposed to be that... does this look alright though?

8. Nov 3, 2012

### Hurkyl

Staff Emeritus
I plugged your integral into wolframalpha, and I got a different number.

I'll say it one more time, since I'm not convinced: are you really, really sure that, e.g., a1 cos x is supposed to be one of the terms, despite the fact it's period does not divide pi and your formula for computing a1 doesn't involve cos x?

9. Nov 3, 2012

### mundane

I am looking at my book right now. It says that is the formula. We have done plenty of these in class, and have always used that. What integral did you plug in, and what did you get?I am getting the same numbers.

10. Nov 3, 2012

### mundane

I did make a mistake though. b1 should be (2/pi)(pi), so it should be 2, not pi. I forgot to multiply it, I think you may have said that if I understood your last comment.,,?