There appears to be an error in the question. I think ∂u/∂t(x,0)=sin(3πx), not sin(πx).
When this adjustment is made u(x,t)=sin(3πx)(sin(9πt)+3cos(9πt))/9π.
Assume initially that u(x,t)=X(x)T(t), then:
∂u/∂x=X'T, ∂u/∂t=XT', ∂²u/∂x²=X''T, ∂²u/∂t²=XT''.
(X implies X(x) and T implies T(t). Also, X' and T' imply dX/dt and dT/dt, and similarly for second derivatives.)
∂²u/∂t²=9∂²u/∂x² (given) so XT''=9TX''; T''/T=9X''/X (separation of variables).
If XT'(0)=sin(3πx) and X'T(0)=cos(3πx), X=sin(3πx)/T'(0), and X'=cos(3πx)/T(0).
Therefore, differentiating X=sin(3πx)/T'(0), X'=3πcos(3πx)/T'(0) which should be equal to cos(3πx)/T(0), implying T'(0)=3πT(0).
u(0,t)=u(1,t) so X(0)T(t)=X(1)T(t), implying X(0)=X(1). This is satisfied because sin(3π)=sin(π)=0.
X''=-9π²sin(3πx)/T'(0)=-9π²X, so X''/X=-9π² and T''/T=9X''/X=-81π², and T=asin(9πt)+bcos(9πt), where a and b are constants.
T'=9πacos(9πt)-9πbsin(9πt). T(0)=b, T'(0)=9πa=3πT(0)=3πb, b=3a
u(x,t)=(sin(3πx)/(9πa))(asin(9πt))+3acos(9πt)). The constant a cancels.
Therefore u(x,t)=sin(3πx)(sin(9πt)+3cos(9πt))/(9π).