Homework 3:

Not complete: 
You must fill in missing steps:

Problem 1:

Clear["Global`*"];

Part a)

fun[c0_,c1_,c2_,c3_]:= 
 ( c0 
 + c1 Sin[2 Pi 1 x]
 + c2 Sin[2 Pi 2 x]
 + c3 Sin[2 Pi 3 x]
 )

doit[c0_,c1_,c2_,c3_]:= Plot[ fun[c0,c1,c2,c3] //Evaluate ,{x,0,1}];

You need to adjust the coefficients by hand.

p1=doit[1,2,3,4];

f[x_]=x;
p2=Plot[f[x],{x,0,1},PlotStyle->{Thickness[0.008]}];

Show[p1,p2];

Problem 2:

Clear["Global`*"];

Part a)

fun[c0_,c1_,c2_,c3_]:= 
 ( c0 
 + c1 Sin[2 Pi 1 x]
 + c2 Sin[2 Pi 2 x]
 + c3 Sin[2 Pi 3 x]
 )

doit[c0_,c1_,c2_,c3_]:= Plot[ fun[c0,c1,c2,c3] //Evaluate ,{x,0,1}];

You need to adjust the coefficients by hand.

p1=doit[1,2,3,4];

f[x_]=Ceiling[x-1/2];
p2=Plot[f[x],{x,0,1},PlotStyle->{Thickness[0.008]}];

Show[p1,p2];

Problem 3:

Clear["Global`*"];

Part a)

fun[c0_,c1_,c2_,c3_]:= 
 ( c0 
 + c1 Sin[2 Pi 1 x]
 + c2 Sin[2 Pi 2 x]
 + c3 Sin[2 Pi 3 x]
 )

doit[c0_,c1_,c2_,c3_]:= Plot[ fun[c0,c1,c2,c3] //Evaluate ,{x,-1,1}];

You need to adjust the coefficients by hand.

p1=doit[1,2,3,4];

f[x_]=1-Abs[x];
p2=Plot[f[x],{x,-1,1},PlotStyle->{Thickness[0.008]}];

Show[p1,p2];