question about answer to fourier series question

• Feb 9th 2011, 12:27 AM
hunterage2000
question about answer to fourier series question
I have worked through the following question

$f(t)=\begin{cases} -1, -2 < t < -1 \\ t, -1 < t < 1 \\ 1, 1 < t < 2 \\
\end{cases}$

with a period of 4

and got

4/n^2*pi^2 sin (n*pi/2) - 2/n*pi cos (n*pi)

Can someone tell me why the cos part of the answer is n*pi and not (-1)^n?
• Feb 9th 2011, 06:53 AM
Ackbeet
Well,

$\cos(n\pi)=(-1)^{n}.$

You can convince yourself of this by looking at the graph of the cosine function.

• Feb 9th 2011, 09:02 AM
hunterage2000
so why would this be (-1)^2 and not the another?
• Feb 9th 2011, 09:08 AM
Ackbeet
I don't understand your question. Can you please rephrase?
• Feb 9th 2011, 10:15 AM
hunterage2000
The step before I got the answer of (-1)^2 was cos(n*pi) for post 3. The step before post 1 was cos(n*pi) and stayed cos(n*pi) and I dont know why.
• Feb 9th 2011, 10:17 AM
Ackbeet
Where did the (-1)^2 come from? I thought we were talking about (-1)^n. Did you mean (-1)^n in all your posts?
• Feb 9th 2011, 10:46 AM
hunterage2000
yeah sorry I do
• Feb 9th 2011, 10:54 AM
Ackbeet
Ah. So the answer to your question is post # 5 is that I have no clue. Post # 2 still stands. It could be a preference of the author, though I find the exponential expression to be simpler than the trig expression.
• Feb 9th 2011, 12:16 PM
hunterage2000
so the answer can be both in post #2
• Feb 9th 2011, 12:18 PM
Ackbeet
They're entirely equivalent. It's a preference thing.
• Feb 9th 2011, 12:26 PM
hunterage2000
or right, we were never told that in class. Thats helped me, thanks for that.
• Feb 9th 2011, 12:29 PM
Ackbeet
You're very welcome. Have a good one!