MATH3271 - FW03

Assignment 1

Question 1(a)

>    f:= cos(x) + sin(3*x);

f := cos(x)+sin(3*x)

>    plot(f,x=-3*Pi..3*Pi, colour = black);

[Maple Plot]

The period of f is 2*Pi.

Question 1(b)

>    g:=cos(x)*sin(3*x);

g := cos(x)*sin(3*x)

>    plot(g,x=-2*Pi..2*Pi,colour = black);

[Maple Plot]

The period of g is Pi.

Question 1(c).

>    h:= cos(2*Pi*x/3);

h := cos(2/3*Pi*x)

>    plot(h, x=-6..6,colour=black);

[Maple Plot]

The period of h is 3.

Question 1(d)

>    p:=floor(x)-2*floor(x/2);

p := floor(x)-2*floor(1/2*x)

>    plot(p,x = -4..4,colour=black);

[Maple Plot]

The period of p is 2.

Question 3(b)(i)

>    f:=cos(x/2);

f := cos(1/2*x)

>    s4:=(2+4/3*cos(x) -4/15*cos(2*x)+4/35*cos(3*x)-4/63*cos(4*x))/Pi;

s4 := (2+4/3*cos(x)-4/15*cos(2*x)+4/35*cos(3*x)-4/63*cos(4*x))/Pi

>    s6:=s4+(4/99*cos(5*x)-4/143*cos(6*x))/Pi;

s6 := (2+4/3*cos(x)-4/15*cos(2*x)+4/35*cos(3*x)-4/63*cos(4*x))/Pi+(4/99*cos(5*x)-4/143*cos(6*x))/Pi

>    plot([f,s4,s6],x=-Pi..Pi,colour=black);

[Maple Plot]

Question 3(b)(ii)

>    f:=Heaviside(-x-1)+Heaviside(x-1);

f := Heaviside(-x-1)+Heaviside(x-1)

>    s4:=1/2 +2/Pi*(-cos(Pi*x/2)+1/3*cos(3*Pi*x/2));

s4 := 1/2+2/Pi*(-cos(1/2*Pi*x)+1/3*cos(3/2*Pi*x))

>    s6:=s4+2/Pi*(-1/5*cos(5*Pi*x/2));

s6 := 1/2+2/Pi*(-cos(1/2*Pi*x)+1/3*cos(3/2*Pi*x))-2/5*1/Pi*cos(5/2*Pi*x)

>    plot([f,s4,s6],x=-2..2,colour=black);

[Maple Plot]

Question 4(b)

Even extension

>    e: = 1 - abs(x);

e(x) = 1-abs(x)

>    s3:=1/2+4/Pi^2*(cos(Pi*x)+1/9*cos(3*Pi*x));

s3 := 1/2+4/Pi^2*(cos(Pi*x)+1/9*cos(3*Pi*x))

>    s5:=s3+4/Pi^2*1/25*cos(5*Pi*x);

s5 := 1/2+4/Pi^2*(cos(Pi*x)+1/9*cos(3*Pi*x))+4/25*1/Pi^2*cos(5*Pi*x)

>    plot([e,s3,s5],x = -1..1,colour=black);

[Maple Plot]

Odd extension

>    c:=x/abs(x)-x;

c := x/abs(x)-x

>    s3:=2/Pi*(sin(Pi*x)+1/2*sin(2*Pi*x)+1/3*sin(3*Pi*x));

s3 := 2/Pi*(sin(Pi*x)+1/2*sin(2*Pi*x)+1/3*sin(3*Pi*x))

>    s5:=s3+2/Pi*(1/4*sin(4*Pi*x)+1/5*sin(5*Pi*x));

s5 := 2/Pi*(sin(Pi*x)+1/2*sin(2*Pi*x)+1/3*sin(3*Pi*x))+2/Pi*(1/4*sin(4*Pi*x)+1/5*sin(5*Pi*x))

>    plot([c,s3,s5],x=-1..1,colour=black);

[Maple Plot]

>   

>   

>   

>   

>