Examples from worksheet "Fourier's work, I"
Contents
syms x n
(1)
f = symsum((-1)^(n-1)*cos((2*n-1)*x)/(2*n-1),n,1,50)
F = @(x) pi/4
ezplot(f,[-pi/2,pi/2])
hold on
ezplot(F,[-pi/2,pi/2])
hold off
axis([-pi/2,pi/2,0,1])
f =
cos(5*x)/5 - cos(3*x)/3 - cos(7*x)/7 + cos(9*x)/9 - cos(11*x)/11 + cos(13*x)/13 - cos(15*x)/15 + cos(17*x)/17 - cos(19*x)/19 + cos(21*x)/21 - cos(23*x)/23 + cos(25*x)/25 - cos(27*x)/27 + cos(29*x)/29 - cos(31*x)/31 + cos(33*x)/33 - cos(35*x)/35 + cos(37*x)/37 - cos(39*x)/39 + cos(41*x)/41 - cos(43*x)/43 + cos(45*x)/45 - cos(47*x)/47 + cos(49*x)/49 - cos(51*x)/51 + cos(53*x)/53 - cos(55*x)/55 + cos(57*x)/57 - cos(59*x)/59 + cos(61*x)/61 - cos(63*x)/63 + cos(65*x)/65 - cos(67*x)/67 + cos(69*x)/69 - cos(71*x)/71 + cos(73*x)/73 - cos(75*x)/75 + cos(77*x)/77 - cos(79*x)/79 + cos(81*x)/81 - cos(83*x)/83 + cos(85*x)/85 - cos(87*x)/87 + cos(89*x)/89 - cos(91*x)/91 + cos(93*x)/93 - cos(95*x)/95 + cos(97*x)/97 - cos(99*x)/99 + cos(x)
F =
@(x)pi/4
(2)
g = symsum((-1)^(n-1)*sin((2*n-1)*x)/(2*n-1)^2,n,1,5)
G = @(x) pi*x/4
ezplot(g,[-pi/2,pi/2])
hold on
ezplot(G,[-pi/2,pi/2])
hold off
axis([-pi/2,pi/2,-1.3,1.3])
g =
sin(5*x)/25 - sin(3*x)/9 - sin(7*x)/49 + sin(9*x)/81 + sin(x)
G =
@(x)pi*x/4
(3)
h = symsum(sin((2*n-1)*x)/(2*n-1),n,1,50)
ezplot(h,[0,pi])
hold on
ezplot(F,[0,pi])
hold off
axis([0,pi,0,1])
h =
sin(3*x)/3 + sin(5*x)/5 + sin(7*x)/7 + sin(9*x)/9 + sin(11*x)/11 + sin(13*x)/13 + sin(15*x)/15 + sin(17*x)/17 + sin(19*x)/19 + sin(21*x)/21 + sin(23*x)/23 + sin(25*x)/25 + sin(27*x)/27 + sin(29*x)/29 + sin(31*x)/31 + sin(33*x)/33 + sin(35*x)/35 + sin(37*x)/37 + sin(39*x)/39 + sin(41*x)/41 + sin(43*x)/43 + sin(45*x)/45 + sin(47*x)/47 + sin(49*x)/49 + sin(51*x)/51 + sin(53*x)/53 + sin(55*x)/55 + sin(57*x)/57 + sin(59*x)/59 + sin(61*x)/61 + sin(63*x)/63 + sin(65*x)/65 + sin(67*x)/67 + sin(69*x)/69 + sin(71*x)/71 + sin(73*x)/73 + sin(75*x)/75 + sin(77*x)/77 + sin(79*x)/79 + sin(81*x)/81 + sin(83*x)/83 + sin(85*x)/85 + sin(87*x)/87 + sin(89*x)/89 + sin(91*x)/91 + sin(93*x)/93 + sin(95*x)/95 + sin(97*x)/97 + sin(99*x)/99 + sin(x)
(4)
k = symsum((-1)^(n-1)*sin(n*x)/n,n,1,50)
K = x/2
ezplot(k,[0,pi])
hold on
ezplot(K,[0,2])
hold off
k =
sin(3*x)/3 - sin(2*x)/2 - sin(4*x)/4 + sin(5*x)/5 - sin(6*x)/6 + sin(7*x)/7 - sin(8*x)/8 + sin(9*x)/9 - sin(10*x)/10 + sin(11*x)/11 - sin(12*x)/12 + sin(13*x)/13 - sin(14*x)/14 + sin(15*x)/15 - sin(16*x)/16 + sin(17*x)/17 - sin(18*x)/18 + sin(19*x)/19 - sin(20*x)/20 + sin(21*x)/21 - sin(22*x)/22 + sin(23*x)/23 - sin(24*x)/24 + sin(25*x)/25 - sin(26*x)/26 + sin(27*x)/27 - sin(28*x)/28 + sin(29*x)/29 - sin(30*x)/30 + sin(31*x)/31 - sin(32*x)/32 + sin(33*x)/33 - sin(34*x)/34 + sin(35*x)/35 - sin(36*x)/36 + sin(37*x)/37 - sin(38*x)/38 + sin(39*x)/39 - sin(40*x)/40 + sin(41*x)/41 - sin(42*x)/42 + sin(43*x)/43 - sin(44*x)/44 + sin(45*x)/45 - sin(46*x)/46 + sin(47*x)/47 - sin(48*x)/48 + sin(49*x)/49 - sin(50*x)/50 + sin(x)
K =
x/2