Some plots for Example in class (3.8 #15)

> F:=t -> piecewise(t>0 and t<Pi, t, t>=Pi and t <2*Pi, 2*Pi- t); #use help to lookup "piecewise".        

F := proc (t) options operator, arrow; piecewise(0 < t and t < Pi, t, Pi <= t and t < 2*Pi, 2*Pi-t) end proc

> plot(F(t), t=0..10*Pi,color=black,thickness=3,title=`Forcing Function`);

[Plot]

> u:= t -> piecewise(t>0 and t<Pi,-sin(t) + t,t>=Pi and t<=2*Pi,-3*sin(t)+2*Pi - t,t>2*Pi,-4*sin(t));

u := proc (t) options operator, arrow; piecewise(0 < t and t < Pi, -sin(t)+t, Pi <= t and t <= 2*Pi, -3*sin(t)+2*Pi-t, 2*Pi < t, -4*sin(t)) end proc

> plot(u(t),t=0..10*Pi,color=black,thickness=3,title=`Solution`);

[Plot]

> evalf(2*Pi-solve(diff(-3*sin(t)+2*Pi-t,t)=0));  

4.372552071

> evalf(u(%));

4.739060362