MAT129: Velocity and Displacement
Spring, 2016
Andy Long

Clear[x,a,b,c]
speed[x_,a_, b_, c_]:=c*UnitBox[(x-a)/(b-a)-.5]
speedometer[x_]:=speed[x,0,.5,30]+speed[x,.5,1,90]
Plot[speedometer[x],{x,0,1},AxesOrigin->{0,0}]
odometer[a_]=NIntegrate[speedometer[x],{x,0,a}]

Plot[odometer[x],{x,0,1},AxesOrigin->{0,0}]