In: Advanced Math
3) Find the Fourier series of ?(?), which is assumed to have the
period 2?. Specify the relationships for Fourier coefficients, and
illustrate the pattern for the first several terms within the
series ?(?). You may use software to solve for the integrals, but
show the complete result and illustrate the simplification process
to a reduced form. [35 pts]
?(?) = ?2 (0 < ? < 2?)
We have obtained the Fourier series expansion of the given function and plotted first fer terms using MATLAB (code attached).
MATLAB code:
function fourier_cal(N)
% N is the number of terms in Fourier series;
L1=0; % lower limit of the interval;
L2=2*pi; % upper limit of the interval;
L=(L2-L1)/2; % Mid-point of the interval;
f1 = @(t) t.^2; % Original function;
an = @(n,t) (cos(n.*t*pi/L))*( 4/(n.^2) ); % an*cos(nx);
bn = @(n,t) (sin(n.*t*pi/L))*( -4*pi/n ); % bn*sin(nx);
a0=(8*pi*pi/3);
t=L1:0.001:L2;
f_original=f1(t);
f_fourier=0*t;
for i=1:numel(t)
for n=1:N
f_fourier(i)=f_fourier(i)+an(n,t(i))+bn(n,t(i));
end
f_fourier(i)=f_fourier(i)+0.5*a0;
end
plot(t,f_original,'-b',t,f_fourier,'--r');
xlabel('x')
ylabel('f(x)')
legend('Actual function','Fourier Series')
title('Actual function vs Fourier Series')
end