# Half Range Fourier Sine and Cosine Series for x+x^2

Printable View

• May 26th 2011, 11:34 AM
bugatti79
Half Range Fourier Sine and Cosine Series for x+x^2
Folks,

Find the half range fourier cosine and sine series for $x+x^2$ for $0

1) Firstly, I would like to know whether this is an even or odd function before I evaluate the half range Sine / Cosine Series
My attempt: f(x)=f(-x) implies even fn, therefore

$f(x)=x+x^2$, replace x with -x giving

$f(-x)=-x+(-x)^2=-x+x^2???$

2) $P=2L=\frac{\pi}{2} \implies L=\frac{\pi}{4}$

I attempt to start of with $\displaystyle a_n=\frac{8}{\pi} \int_{0}^{\frac{\pi}{4}}(x+x^2)cos(4nx)dx$ Is this correct so far?

Thanks
• May 26th 2011, 12:17 PM
dwsmith
It is neither even nor odd.
• May 26th 2011, 12:41 PM
bugatti79
Quote:

Originally Posted by dwsmith
It is neither even nor odd.

Ok, I am confused now. If the function is neither odd nor even then its Fourier series would contain both sin and cos terms but the question is asking to calculate the half range sine and cosine series respectively?

Thanks
• May 26th 2011, 01:09 PM
dwsmith
Since it is neither, you can't omit $a_0, \ a_n, \ b_n$
• May 26th 2011, 10:23 PM
nehme007
Well, L = pi/2. Use the right L, and you should be on the right track.

The function is neither even nor odd. But the function isn't even defined from -pi/2 to 0 so it wasn't capable of being even or odd in the first place. What we can do is extend f so that it is defined from -pi/2 to 0 in a manner such that the extended function is even. That is, define f_1(x) such that f_1(x) = f(x) for 0 < x < pi/2 and f_1(-x) = f(x) for -pi/2 < x < 0. So f_1 is even and f_1 agrees exactly with f over the interval of interest (0 < x < pi/2). Now compute the Fourier series coefficients for f_1. Since f_1 is even, its Fourier series expansion only contains cosine terms. The integral you have written for a_n will give you those coefficients, provided you use the correct L. The Fourier series for f_1 is what you are calling the half range cosine series.

Of course, you could also extend f to make it an odd function. That is, you could define f_2(x) = f(x) for 0 < x < pi/2, and f_2(-x) = -f(x) for -pi/2 < x < 0. The Fourier series for f_2 contains only sine terms and is what you are calling the half range sine series. (Most texts omit the "half range" part and just call these the Fourier Sine Series and Fourier Cosine Series).

And, it's worth noting that you can do this with any function that's defined only for 0 < x < L, that is, defined only for positive x. The function doesn't have to exhibit any sort of symmetry and only has to be reasonably well behaved (whatever the requirements are for a function to have a Fourier series expansion, I forget what exactly). You can extend the function to be either even or odd, and create a both a cosine and a sine series.
• May 27th 2011, 12:47 AM
bugatti79
Quote:

Originally Posted by nehme007
Well, L = pi/2. Use the right L, and you should be on the right track.

The function is neither even nor odd. But the function isn't even defined from -pi/2 to 0 so it wasn't capable of being even or odd in the first place. What we can do is extend f so that it is defined from -pi/2 to 0 in a manner such that the extended function is even. That is, define f_1(x) such that f_1(x) = f(x) for 0 < x < pi/2 and f_1(-x) = f(x) for -pi/2 < x < 0. So f_1 is even and f_1 agrees exactly with f over the interval of interest (0 < x < pi/2). Now compute the Fourier series coefficients for f_1. Since f_1 is even, its Fourier series expansion only contains cosine terms. The integral you have written for a_n will give you those coefficients, provided you use the correct L. The Fourier series for f_1 is what you are calling the half range cosine series.

Of course, you could also extend f to make it an odd function. That is, you could define f_2(x) = f(x) for 0 < x < pi/2, and f_2(-x) = -f(x) for -pi/2 < x < 0. The Fourier series for f_2 contains only sine terms and is what you are calling the half range sine series. (Most texts omit the "half range" part and just call these the Fourier Sine Series and Fourier Cosine Series).

And, it's worth noting that you can do this with any function that's defined only for 0 < x < L, that is, defined only for positive x. The function doesn't have to exhibit any sort of symmetry and only has to be reasonably well behaved (whatever the requirements are for a function to have a Fourier series expansion, I forget what exactly). You can extend the function to be either even or odd, and create a both a cosine and a sine series.

Thanks for the good information.
1) How is L =pi/2? From my notes by definition the period P =2L where P is given in this problem as pi/2 hence L=pi/4?

2) So is it not necessary to draw the function in extended format in order to find the solution because that is where I have the difficulty doing.

Thanks
• May 27th 2011, 07:24 AM
nehme007
1. The extended versions of f range from -pi/2 < x < pi/2. Therefore the period is pi.
2. Although you can technically compute the coefficients by just blindly applying formulas, you should be able to draw the even/odd extensions just to make sure you really follow the concept. This guy does a pretty good job of explaining extensions: YouTube - &#x202a;Lec 16 | MIT 18.03 Differential Equations, Spring 2006&#x202c;&rlm; at around 46 minutes. To be more technically correct, you extend the function so that it is both even AND periodic (or odd and periodic to generate the sine series).
• May 27th 2011, 10:37 AM
bugatti79
Quote:

Originally Posted by nehme007
1. The extended versions of f range from -pi/2 < x < pi/2. Therefore the period is pi.
2. Although you can technically compute the coefficients by just blindly applying formulas, you should be able to draw the even/odd extensions just to make sure you really follow the concept. This guy does a pretty good job of explaining extensions: YouTube - &#x202a;Lec 16 | MIT 18.03 Differential Equations, Spring 2006&#x202c;&rlm; at around 46 minutes. To be more technically correct, you extend the function so that it is both even AND periodic (or odd and periodic to generate the sine series).

Thanks for the link. Ok, but since the function is neither even nor odd I must calculate all coefficients. I have attached my plot of the function and the set up for calculation. I wonder am i ready to go?

Thanks