Take the Laplace transform of the following initial value and solve for Y(s)=L{y(t)} :
y^('')+9y={(sin(\pi t),0<=t<1),(0,1<=t),(y(0)=0),(y^(')(0)=0):}
Y(s)=(\pi )/((s^(2)+\pi ^(2))(s^(2)+9))-(\pi e^(-2))/((s^(2)+\pi ^(2))(s^(2)+9)) (1). Hint: write the right hand side in terms of the Heaviside function.
Now find the inverse transform to find y(t)=(\pi )/(\pi ^(2)-9)(cos(3t)-cos(\pi t))+ut*(\pi )/(\pi ^(2)-9)(cos(3(t-1))-cos(\pi (t-1)))u_(c)(t).(\pi )/((s^(2)+\pi ^(2))(s^(2)+9))=(\pi )/(\pi ^(2)-9)((1)/(s^(2)+9)-(1)/(s^(2)+\pi ^(2)))