# Thread: (Urgent: Test today) Find the Fourier series of f(x), first 3 terms

1. ## (Urgent: Test today) Find the Fourier series of f(x), first 3 terms

I have a question.

Find the Fourier series if f(x) of period 2L and write the first three terms.

f(x) = { sinx , 0 < x < pi
0 , -pi < x < 0

When the function is broken up into even and odd functions

f(x) = 0.5*sinx + 0.5*|sinx|

the resulting f(x) comes out

f(x) = 1/pi + 0.5*sinx - 2/pi[(cos2x)/3 + (cos4x)/15 + (cos6x)/35]

But when the function is worked out without splitting it up, the resulting f(x) comes out

f(x) = 1/pi - 2/pi[(cos2x)/3 + (cos4x)/15 + (cos6x)/35]

So my question to you is this, where does the "0.5*sinx" come from in the first answer and why don't the two answers equal one another?

2. Originally Posted by myoplex11
I have a question.

Find the Fourier series if f(x) of period 2L and write the first three terms.

f(x) = { sinx , 0 < x < pi
0 , -pi < x < 0

When the function is broken up into even and odd functions

f(x) = 0.5*sinx + 0.5*|sinx|

the resulting f(x) comes out

f(x) = 1/pi + 0.5*sinx - 2/pi[(cos2x)/3 + (cos4x)/15 + (cos6x)/35]

But when the function is worked out without splitting it up, the resulting f(x) comes out

f(x) = 1/pi - 2/pi[(cos2x)/3 + (cos4x)/15 + (cos6x)/35]

So my question to you is this, where does the "0.5*sinx" come from in the first answer and why don't the two answers equal one another?
Comment 1: The second series is wrong. It is an even function, while
the function you have defined is not even.

Comment 2: You refer to the period of 2L at the top, but its quite evident
that later you are working with period 2pi.

Comment 3: what do you think the expression "the first three terms" means
in this context. I would take the constant and the terms in cos(x) and sin(x),
even if some of them had zero as their coefficient. (this might give you an
even or odd function but it would still be correct for such a short series)

The first of your forms is correct.

$\displaystyle b_1=\frac{1}{\pi}\int_0^{2\pi} f(x)\sin(x)\, dx=\frac{1}{\pi}\int_0^{\pi} \sin^2(x)\, dx = \frac{1}{\pi}(\pi/2)=1/2$

RonL

3. This is neither an even or odd function.
What are you trying to do exactly.
Express this function over this interval as a sine or cosine series? Or (but not both) express the periodical function.