# Problem 1b, midterm 2, section 3.4, D'Alembert solution wave equation f:=x->piecewise(x<0,0,x<1/2,0.3*x,x<1,0.3*(1-x),0); convert(f(x),piecewise,x); plot(f(x),x=0..1); h:=x->piecewise(x<0,0,x<1/2,0.3*x,x<1,0.3*(1-x),x<3/2,-0.3*(x-1),x<2,-0.3*(2-x),0); convert(h(x),piecewise,x); plot(h(x),x=0..2); g1:=x->x-floor(x); g:=x->2*g1(x/2); fstar:=x->h(g(x)); H:=(x,t)->(1/2)*(fstar(x-t)+fstar(x+t)); plot(fstar(x),x=-1..4); plot(H(x,1/3),x=0..1); evalf(1/6);evalf(0.3*(1/6)); plots[animate](plot,[H(x,t),x=0..6],t=0..2);