You need to start with the eigenvalues and eigenvectors of the Schrodinger's equation. Suppose that you have calculated them, and called them $E_n$ and $\Psi_n$. In general, any solution can be written as a linear combination of the eigenvectors, so your $\Psi$ function is $$\Psi(x,0)=\frac{1}{\sqrt{2}}\sin\left(\frac{\pi x}{a}\right)\cos\left(\frac{2\pi x}{a}\right)=\sum_{n=1}^\infty c_n \Psi_n$$
To get the values of the $c_n$ coefficients, $$c_n=\int_0^a\Psi_n^*(x,0)\Psi(x,0) dx$$
The value of the energy is given by:
$$\begin{align}&=\int_0^a\Psi^*(x,0)H\Psi(x,0)dx\\
&=\int_0^a\Psi^*(x,0)H\left(\sum_{n=1}^\infty c_n \Psi_n\right)dx
\\&=\int_0^a\Psi^*(x,0)\left(\sum_{n=1}^\infty c_n E_n \Psi_n\right)dx\\&=\int_0^a\left(\sum_{m=1}^\infty c_m^* \Psi_m^*\right)\left(\sum_{n=1}^\infty c_n E_n \Psi_n\right)dx\\
&=\sum_{n=1}^\infty |c_n|^2 E_n\end{align}$$
To get the last step, I used the fact that the $\Psi_n$ form an orthonormal set