AIM question trial

Subject: MAEE309
Quiz: FourierSeries
Question: fourierSeries_5

Close Bottom Edit source Mark New version

Seed:
Question (5 marks)
 
You might find the lab on Fourier Series useful in answering this question. The Matlab lab sheet is here. Find the Fourier series of the 2π-periodic function
f(x) = x        for −π < x ≤ π
In entering your answers, we will denote the coefficients in the series by
f(x) = a0 +

m=1 
( a2m−1 cos((2m−1) x) + b2m−1 sin((2m−1) x) + a2m cos(2m x) + b2m sin(2m x) )
In this sum, m goes from 1 to infinity.
The various coefficients for which you are asked are rational functions of m, and should be entered as such. Use the facts that sin(mπ) = 0, cos(2mπ) = 1, cos((2m−1)π) = −1 to remove trig functions from your expressions for the coefficients. Enter π as Pi.
.1 (1 mark)
 

a0 =
Your last answer was:
0

Question note: []
Your answer is correct.
The mark for your last attempt was 1.00

The teacher's answer was:
0


.2 (1 mark)
 
For the remainder of the question, m ≥ 1:
a2m−1 =
Your last answer was:
0

Question note: []
Your answer is correct.
The mark for your last attempt was 1.00

The teacher's answer was:
0


.3 (1 mark)
 

a2m =
Your last answer was:
0

Question note: []
Your answer is correct.
The mark for your last attempt was 1.00

The teacher's answer was:
0


.4 (1 mark)
 

b2m−1 =
Your last answer was:
2 ( 2 m−1 ) −1

Question note: []
Your answer is correct.
The mark for your last attempt was 1.00

The teacher's answer was:
2 ( 2 m−1 ) −1

This can be entered as:
2/(2*m-1)


.5 (1 mark)
 

b2m =
Your last answer was:
−m−1

Question note: []
Your answer is correct.
The mark for your last attempt was 1.00

The teacher's answer was:
−m−1

This can be entered as:
-1/m


Solution:
While there are general formulae for Fourier coefficients, it is usual, and saves effort, to check, at the beginning, whether the function is even or odd. Why? ...
  • Even functions necessarily have all their sine series coefficients equal to zero.

  • Odd functions necessarily have all their cosine series coefficients equal to zero.

In this problem, the function f is odd, and hence all an = 0.

To find the sine coefficients, use the formulae:
bn =  2

π

π

0 
f(x) sin(n x) dx, n ≥ 1.
Matlab can be used to evaluate the integrals. While it is possible to give Matlab the information that m, n or whatever are integers and hence that
sin(n π) = 0,    cos(2 m π) = 1,    cos((2 m − 1)π) = −1,    etc.
it is probably easier in this problem to find a few coefficients and look for a pattern.

If the problem arose in a real engineering situation, one would do both this first step - numeric values of m as examples - and the general m case. In any event, Matlab such as the following should find the integrals:
syms x f s0 s1 s2 Pi c sm 
s0 = sym(0); s1 = sym(1); s2 = sym(2); Pi = sym(pi); c = s2/Pi; 
f = x 
for m = 1:5 
  sm = sym(m) 
  b2mMinus1 = simplify(c*int(f*sin((s2*sm-s1)*x), x, s0, Pi)) 
  b2m =  simplify(c*int(f*sin(s2*sm*x), x, s0, Pi)) 
end  

Mark  New version

Question note: [["m"], ["x"], ["n"], ["f_", "x"], ["nr_", "2"], ["s_", "\"syms x f s0 s1 s2 Pi c sm \\ns0 = sym(0); s1 = sym(1); s2 = sym(2); Pi = sym(pi); c = s2/Pi; \\nf = x \\nfor m = 1:5 \\n sm = sym(m) \\n b2mMinus1 = simplify(c*int(f*sin((s2*sm-s1)*x), x, s0, Pi)) \\n b2m = simplify(c*int(f*sin(s2*sm*x), x, s0, Pi)) \\nend\""], ["a2m_", "0"], ["a2mm1_", "0"], ["b2mm1_", "2/(2*m-1)"], ["b2m_", "-1/m"], ["a0Lis_", "[1/2*Pi, 1/3*Pi^2, 1/6*Pi^2, 2/Pi]"], ["a2mLis_", "[0, 1/m^2, -1/m^2, -4/Pi/(2*m-1)/(1+2*m)]"], ["b2mLis_", "[0, -1/m, 8*m/Pi/(2*m-1)/(1+2*m), -3/2/m^3, 0]"], ["d_", "\"discontinuous at integer multiples of $\\\\pi$\""], ["de_", "\"discontinuous at even multiples of $\\\\pi$\""], ["do_", "\"discontinuous at odd multiples of $\\\\pi$\""], ["c_", "\"continuous on the whole real line\""], ["i_", "2"], ["nicef_", "x"], ["na_", "4"], ["a0_", "0"], ["evnFnLis_", "[abs(x), x^2, abs(x)*(Pi-abs(x)), abs(sin(x))]"], ["oddFnLis_", "[signum(x), x, signum(x)*cos(x), x*(Pi^2-x^2), x*(Pi-abs(x))]"], ["noeFnLis_", "[x, max(0,sin(x))]"], ["a2mm1Lis_", "[-4/Pi/(2*m-1)^2, -4/(2*m-1)^2, 0, 0]"], ["b2mm1Lis_", "[4/Pi/(2*m-1), 2/(2*m-1), 0, 12/(2*m-1)^3, 8/Pi/(2*m-1)^3]"], ["oddcttyLis_", "[\"discontinuous at integer multiples of $\\\\pi$\", \"discontinuous at odd multiples of $\\\\pi$\", \"discontinuous at integer multiples of $\\\\pi$\", \"continuous on the whole real line\", \"continuous on the whole real line\"]"], ["evncttyLis_", "[\"continuous on the whole real line\", \"continuous on the whole real line\", \"continuous on the whole real line\", \"continuous on the whole real line\"]"], ["noecttyLis_", "[\"discontinuous at even multiples of $\\\\pi$\", \"continuous on the whole real line\"]"], ["niceEvnFns_", "[x, x^2, x*(Pi-x), sin(x)]"], ["niceOddFns_", "[1, x, cos(x), x*(Pi^2-x^2), x*(Pi-x)]"], ["nb_", "5"], ["nn_"]]