Clear["Global`*"];

Homework 3 WarmUp:

Not complete: 
You must adjust the coefficients by hand:

Manipulate:

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]
 )

f1[x_]=x;
f2[x_]=Ceiling[x-1/2];
f3[x_]=1-Abs[x];

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

Manipulate[
Plot[{f1[x],fun[c0,c1,c2,c3]//Evaluate},{x,0,1},
PlotStyle->{Red,Blue}]
,{{c0,0.5},-2,2}
,{{c1,0.0},-2,2}
,{{c2,0.0},-2,2}
,{{c3,0.0},-2,2}
]

Manipulate[
Plot[{f2[x],fun[c0,c1,c2,c3]//Evaluate},{x,0,1},
PlotStyle->{Red,Blue}]
,{{c0,0.5},-2,2}
,{{c1,0.0},-2,2}
,{{c2,0.0},-2,2}
,{{c3,0.0},-2,2}
]

Manipulate[
Plot[{f3[x],fun[c0,c1,c2,c3]//Evaluate},{x,-1,1},
PlotStyle->{Red,Blue}]
,{{c0,0.5},-2,2}
,{{c1,0.0},-2,2}
,{{c2,0.0},-2,2}
,{{c3,0.0},-2,2}
]