- #1

- 15

- 0

## Homework Statement

Fourier Series of the following function f(x).

f(x) is -1 for -.5<x<0

f(x) is 1 for 0<x<.5

## Homework Equations

b[itex]_{n}[/itex] = [itex]\frac{1}{L}[/itex][itex]\int[/itex][itex]^{L}_{-L}[/itex]f(x)sin(nπx/L)dx

Where L is half the period.

## The Attempt at a Solution

Graphing the solution, I know that it is odd, which is why I didn't include the given function for the "even" cos(nπ) portion of the Fourier series.

Since the period is 1, L would be .5. So the function would look like this:

2[itex]\int[/itex][itex]^{0}_{-.5}[/itex](–sin(2nπx)dx) + 2[itex]\int[/itex][itex]^{.5}_{0}[/itex](sin(2nπx)dx)

To cut some work short, I get to:

[itex]\frac{1}{πn}[/itex] - [itex]\frac{cos(nπ}{πn}[/itex] - [itex]\frac{cos(nπ}{πn}[/itex] + [itex]\frac{1}{πn}[/itex]

Which becomes:

[itex]\frac{4}{πn}[/itex]sin[itex]^{2}[/itex]([itex]\frac{πn}{2}[/itex])

I check my solution on Mathematica using these commands:

a = If[-.5 < x < 0, -1, If[0 < x < .5, 1]]

FourierTrigSeries[a, x, 5]

And see that there are terms for values where my b[itex]_{n}[/itex] should be zero.

EDIT: I was looking at another attempt I had made to this problem, so I corrected for that.

Last edited: