Fourier series problem solving for an,bn

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 4K views
dp182
Messages
19
Reaction score
0

Homework Statement


let f(x)={0;-2[itex]\leq[/itex]x[itex]\leq[/itex]0.
x;0[itex]\leq[/itex]x[itex]\leq[/itex]2
find a0
an
bn
given the period is 4

Homework Equations


a0=1/L[itex]\int[/itex]f(x)dx
an=1/L[itex]\int[/itex]f(x)cos(n[itex]\pi[/itex]x/L)
bn=1/L[itex]\int[/itex]f(x)sin(n[itex]\pi[/itex]x/L)

The Attempt at a Solution


so I can get a0 = 1 but I run into trouble with an. so I plug
an=1/2[itex]\int[/itex]xcos(n[itex]\pi[/itex]x/L) for the interval 0[itex]\leq[/itex]x[itex]\leq[/itex]2 and I get the solution
=(1/n2[itex]\pi[/itex]2)2xn[itex]\pi[/itex]sin(n[itex]\pi[/itex]x/2)+4cos(n[itex]\pi[/itex]x/2) then subbing in for x I get (1/n2[itex]\pi[/itex]2)(4n[itex]\pi[/itex]sin(n[itex]\pi[/itex])+4cos(n[itex]\pi[/itex])-1) can anyone tell me what I am doing wrong here?
 
Physics news on Phys.org
Hi dp182!

dp182 said:

Homework Statement


let f(x)={0;-2[itex]\leq[/itex]x[itex]\leq[/itex]0.
x;0[itex]\leq[/itex]x[itex]\leq[/itex]2
find a0
an
bn
given the period is 4

Homework Equations


a0=1/L[itex]\int[/itex]f(x)dx
an=1/L[itex]\int[/itex]f(x)cos(n[itex]\pi[/itex]x/L)
bn=1/L[itex]\int[/itex]f(x)sin(n[itex]\pi[/itex]x/L)

The Attempt at a Solution


so I can get a0 = 1 but I run into trouble with an. so I plug
an=1/2[itex]\int[/itex]xcos(n[itex]\pi[/itex]x/L) for the interval 0[itex]\leq[/itex]x[itex]\leq[/itex]2 and I get the solution
=(1/n2[itex]\pi[/itex]2)2xn[itex]\pi[/itex]sin(n[itex]\pi[/itex]x/2)+4cos(n[itex]\pi[/itex]x/2) then subbing in for x I get (1/n2[itex]\pi[/itex]2)(4n[itex]\pi[/itex]sin(n[itex]\pi[/itex])+4cos(n[itex]\pi[/itex])-1) can anyone tell me what I am doing wrong here?

You made two mistakes: you forgot the term 1/L, so you still need to divide by 2. Secondly, when you "subbed for x", you made a mistake in "subbing for 0". That is, the correct formula is

[tex]\int_0^2{f(x)dx}=F(2)-F(0)[/tex]

But somehow, you calculated F(0) wrong.
 
but wouldn't F(0) be 4cos(0)/n2pi2 which is just 4/n2pi2
 
ya but I brought out a 4/n2pi2 so its not -1 its -4/n2pi2