Find the fourier series representation of x^2

Click For Summary

Homework Help Overview

The discussion revolves around finding the Fourier series representation of the function x² over the intervals (-π, π) and (0, 2π). Participants express confusion regarding the calculation of Fourier coefficients, particularly a₀, aₙ, and bₙ, and the correct application of integration techniques.

Discussion Character

  • Mixed

Approaches and Questions Raised

  • Participants discuss the formulas for calculating Fourier coefficients, with some questioning the correct expression for a₀ and the integration process for aₙ and bₙ. There is mention of confusion regarding the application of integration by parts and the use of trigonometric identities.

Discussion Status

Some participants have provided insights into the formulas for a₀ and bₙ, while others are exploring different approaches to the problem. There is a lack of consensus on the correct method, and several interpretations of the Fourier series coefficients are being examined.

Contextual Notes

Participants note discrepancies in the formulas encountered in various online sources and textbooks, leading to confusion about the correct approach to the problem. There are also references to the emotional stress of managing multiple homework assignments and the impact on their understanding of the material.

Gale
Messages
683
Reaction score
1
ok, i wasn't sure if i ought put this in math or phys, we're going over it my phys class, but its just math... whatever..

So i had to find the Fourier series representation of x^2 in the intervals (-pi, pi) and (0, 2pi). i haven't even started the (0, 2pi) one, cause i can't get the first half.

so i started with the coefficients, and for a_0 i got

a_0= 1/\pi \int_{-\pi}^\pi (0)^2 * cos(0*\pi) dx= 0 and i don't think that's right, the answer in the back of the book was... ok turns out i didn't write it down, but it was something + stuff*cos. So i assumed the something was the a_0/2 but i think it had pi^2 and i think it was over 3 or something, it seemed like maybe it wasn't a_0, so i kept going, with my a_n's.

so for a_n, i set it up, do integration by parts twice, and i get 0 again. same for b_n. i don't know what I'm doing wrong but everything keeps cancelling out and i get zeros. so could someone maybe help me through this problem? this isn't even an assigned problem, but i thought i'd try one i knew the answer to first, to make sure i knew what i was doing, but turns out i have no idea. help?
 
Last edited:
Physics news on Phys.org
ok, apparently my equation for a_0 is wrong for starters, i googled Fourier series of x^2 and found some sites, but they don't show all the steps, or the equation for a_0 that they start with. i don't have a book so I'm looking at online sources, and I'm not really sure what's going on any more. here's what i though,

a_n= 1/\pi \int_{-\pi}^\pi f(x)* cos(nx) dx

then for a_0 you eval f and cos at x=0. apparently this isn't the case? I'm confused.
 
If

a_n= 1/\pi \int_{-\pi}^\pi f(x)* cos(nx) dx

then looking for a_0 means plugging in n = 0 into that equation. (It wouldn't make sense to plug in x = 0 anyways, because that's a dummy variable)


FYI, I think the a_0 term goes by a different formula than all the others... I think it's 1/2\pi out front, but I don't remember for sure.


I can't tell what's going wrong with your integration if you don't show your work. :wink:
 
Last edited:
ok, i plug in n=0, that's good to know. now I've been looking online and in my notes, and in different places it says a_0 has 1/pi and others say 1/2pi. then some say the general formula is a_0/2 and some just say a_0, and i thought this mad sense until i realized some of the places say a_0 = 1/2pi also had a_0/2 and I'm like ugh. i can't find stuff that makes sense.

also, i was doing the series for sin(pi*x) and i figured, you don't use any cosines, (why would you) but then when i solve for b_n's i get 0, so it means no sins! ugh. i don't know what the problem is! these seem so straight forward and i can't get a single answer!
 
ok ok, some work:

f(x)= sin(\pi*x); x= (-1/2, 1/2)

i thought there was no cosines so no a_n's..

a_0= 1/\pi \int_{-1/2}^{1/2} sin(\pi x) dx) = 0

b_n= 1/\pi \int_{-1/2}^{1/2} sin(\pi x)*sin(2n\pi x)dx= \frac {(-1)^n}{\pi} \int_{-1/2}^{1/2} sin^2(2 \pi nx)= \frac {(-1)^n}{2 \pi}*-cos^3(2\pi nx)*(\frac{1}{2\pi n} |_{-1/2}^{1/2}= \frac{(-1)^{n+1}}{4\pi^2 n} cos^3(2\pi nx) |_{-1/2}^{1/2}= 0

cause cos(pi)=cos(-pi) right? sooooo...
 
Oh, did you change problems? You're not working on f(x) = x² anymore?

<br /> b_n=<br /> 1/\pi \int_{-1/2}^{1/2} sin(\pi x)*sin(2n\pi x)dx<br /> = \frac {(-1)^n}{\pi} \int_{-1/2}^{1/2} sin^2(2 \pi nx)<br />

How did you do this? I don't think \sin (\pi x) = (-1)^n \sin(2 \pi n x).

Also, the next step is wrong too: it looks like you tried to use the chain rule for derivatives. You don't have that here -- the analogous concept is making a substitution. Your calc book probably has a whole section on trig integrals if you want to look up how to do that one... but that integral doesn't matter since the first step is wrong.

What you want to use is a trig identity!
 
Last edited:
i dunno, i quit, never mind.
 
PF rules state that Gale is not allowed to quit, reread the material and try again.
 
ok, once i stopped crying, finished some other homework, and tried to feel less stupid, i tried again.

so, yes i changed problems because x^2 isn't on my homework, and i'd rather be working on a homework problem, so i can at least have one problem to turn in tomorrow...


anyway...
there's no a_n terms because the function is sin(pi x); x=(-1/2, 1/2)

so
b_n= 1/\pi \int_{-1/2}{1/2}sin(\pi x)*sin(2n\pi x) dx= 1/\pi\[1/2( \frac {(sin(2n-1)\pi x}{(2n-1)\pi} - \frac{sin(2n+1)\pi x}{(2n+1)\pi}) |_{-1/2}^{1/2}

i used a table of integrals, which is fine for this class. now, when i evaluate it, i think i just get twice the integral at the upper limit, cause sin(-A)=-sin(A), get what i mean? i didn't want to write it all out in tex. yeah... so i get

1/\pi^2( \frac {sin(2n-1) \pi/2}{(2n-1)}-sin(2n+1)\pi/2}{(2n+1))}

k, then I'm trying to simplify the sin's. so for the first one i do

sin(2n-1)\pi/2= sin(n\pi -\pi/2)=sin(n\pi)cos(\pi/2)-sin(\pi/2)cos(n\pi)= 1

the second:

sin(2n+1)\pi/2= sin(n\pi +\pi/2)=sin(n\pi)cos(\pi/2)+sin(\pi/2)cos(n\pi)= -

then we use those, and get a common denom, and i get:

b_n= \frac {(2n+1)+(2n-1)}{4n^2-1}=\frac {4n}{4n^2-1}
that's wrong though...
 
  • #10
1. Regarding the a0 confusion. My textbook says that if you decide to call the first (constant) term in the Fourier series a0/2, then this has the advantage that all of the an's can be calculated from the same formula, including a0.

2. My formula for bn is as follows:

b_n = \frac{1}{L}\int_{-L}^{L} f(x) \sin\frac{n \pi x}{L} \ dx

Substituting L = 1/2, I get:

b_n = 2 \int_{-1/2}^{1/2} \sin(\pi x) \sin(2n \pi x) \ dx

So i guess my question is, where is the 1/pi coming from in front of your integrals? Did I just overlook something simple?
 
  • #11
3. It's really handy to have some common trig identities at your fingertips. Whenever I see sinAsinB, I think of the trig identities where those sin-sin terms occur:

cos(A+B) = cosAcosB - sinAsinB
cos(A-B) = cosAcosB + sinAsinB

How do we get rid of those pesky cos-cos terms? They have the same sign in each equation, so try subtracting the upper equation from the lower!

cos(A-B) - cos(A+B) = sinAsinB - (-sinAsinB) = 2sinAsinB

So sinAsinB = 1/2[cos(A-B) - cos(A+B)], and that's a good one to remember.

Let A = 2n(pi)x, B = pi*(x)

The integrand becomes:

\frac{1}{2}[\cos(2n-1)\pi x - \cos (2n+1)\pi x]

The integral becomes:

b_n = \int_{-1/2}^{1/2}{\cos(2n-1)\pi x \ dx} - \int_{-1/2}^{1/2}{\cos(2n+1)\pi x \ dx}

Now you can see where that antiderivative you found in the table comes from! Remember these trig identities, in quantum mechanics class, for instance, we were just sort of expected to know them off the tops of our heads (lol).

You sound overworked. I know the feeling. For me the 'day of homework convergence' is Friday, not Monday. I almost always have a weekly quantum mechanics assignment and complex analysis assignment due on that day. This week it will be much worse because I also have a Friday midterm in my Signals and Systems course on none other than Fourier series and Fourier transforms. =\

Don't know what else to suggest except to keep calm. You win some, you lose some. Stress is your worst enemy. (I have to keep telling myself that too.)
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K