After making edits taking Valter Moretti's corrections into account I now feel quite confident in this answer.
I have followed your calculations and they seem correct. But you certainly can't "drop the summation" as you mention in the comments. The sum reduces (with $n = 2k$) as
$$ \left<E\right> = \sum_{k=1}^{\infty} E_n |c_n|^2
= \sum_{k=1}^{\infty} \frac{n^2 \pi^2 \hbar^2}{2mL^2} \frac{24}{n^2 \pi^2}
= \sum_{k=1}^{\infty} \frac{12 \hbar^2}{mL^2}
= \frac{12 \hbar^2}{mL^2} \sum_{k=1}^{\infty} 1 = \infty. $$
The fact is that the expectation value of the energy is actually infinite.
Such a situation might seem bizarre, but as professor Moretti pointed out it is actually not an impossible situation; you will never measure an infinite value of the energy. The probability $|c_n|^2$ of measuring the energy $E_n$ still goes to zero as $n$ goes to infinity. An infinite expectation value simply means that if you take many measurements and average them, the average will increase without bound. This does not break any particular physical principles.
Actually, as detailed in the answers to the question that Qmechanic referenced, infinite energy expectation values are typical of discontinuous wavefunctions such as the one in your initial condition. In fact, the coefficients $c_n$ that you have derived show that $\psi$ is discontinuous, because it ts a theorem of Fourier analysis that if $\psi$ is continuous, then there is a constant $K$ such that $|c_n| \leq K/n^2$. In this case, $c_n$ goes to zero as $1/n$, not $1/n^2$.
In the last equation (6.31) there is an imaginary component of the expectation value of the superposition of the two states. Our teacher said "we" don't know what it really means.
To be level with you, the only honest way I can find to characterize your teacher's statement is as complete rubbish. At best, that "we" includes your teacher only. We understand those terms perfectly.
Your expression,
\begin{align}
\cos\left(\frac{E_m-E_n}{\hbar}\right) t
\int_{-\infty}^\infty & x [b^*a \psi_m^*\psi_n + a^*b \psi_n^*\psi_m]dx
\\ & \quad
+ i \sin\left(\frac{E_m-E_n}{\hbar}\right) t
\int_{-\infty}^\infty x [b^*a \psi_m^*\psi_n - a^*b \psi_n^*\psi_m]dx
\tag{6.31}
\end{align}
is best understood as an expression of the form
\begin{align}
\langle x \rangle
=
A \cos\left(\frac{E_m-E_n}{\hbar}\right) t
+ B\sin\left(\frac{E_m-E_n}{\hbar}\right) t,
\end{align}
with the coefficients
\begin{align}
A & = \int_{-\infty}^\infty x [b^*a \psi_m^*\psi_n + a^*b \psi_n^*\psi_m]dx \qquad \text{and} \\
B & = i \int_{-\infty}^\infty x [b^*a \psi_m^*\psi_n - a^*b \psi_n^*\psi_m]dx.
\end{align}
The integrand in $A$ contains the sum $b^*a \psi_m^*\psi_n + a^*b \psi_n^*\psi_m$ of a complex number and its conjugate, so it is always real-valued. Similarly, the integrand in $B$ includes the difference $b^*a \psi_m^*\psi_n - a^*b \psi_n^*\psi_m$ of those same two complex-conjugate terms, which means that the integrand is always pure imaginary; once you add the global factor of $i$, you get a real-valued $B$.
As with all sums of the form $A \cos\left(\frac{E_m-E_n}{\hbar}\right) t + B\sin\left(\frac{E_m-E_n}{\hbar}\right) t$, the relative weight and sign of the two coefficients gives the phase of the oscillation. And, frankly, your book's formalism goes a good long way to make that phase extremely hard to understand. For an easier form, consider instead the following identity for the oscillating terms:
\begin{align}
\mathrm{osc.}
& =
b^*a \int_{-\infty}^\infty x \psi_m^*e^{+(iE_m/\hbar)t}\psi_ne^{-(iE_n/\hbar)t} dx
+a^*b \int_{-\infty}^\infty x \psi_n^*e^{+(iE_n/\hbar)t}\psi_me^{-(iE_m/\hbar)t} dx
\\ & =
2\mathrm{Re}\mathopen{}\left[
b^*a \ e^{i\frac{E_m-E_n}{\hbar}t} \int_{-\infty}^\infty x \psi_m^*\psi_n dx
\right]
,
\end{align}
which is valid since any term plus its complex conjugate gives twice the real part of both. Now, for most problems, the dipole-moment integral $d_{mn} = \int_{-\infty}^\infty x \psi_m^*\psi_n dx$ can be chosen as real-valued, so it can go straight out of the real part, and more importantly we can represent the product of the amplitudes as
$$
b^*a = |b||a| e^{i\phi},
$$
where $\phi = \arg(a)-\arg(b)$ is the relative complex phase between the two amplitudes. This means, then, that the oscillating terms can be expressed as
\begin{align}
\mathrm{osc.}
& =
2|b||a| d_{mn}\mathrm{Re}\mathopen{}\left[
e^{i\frac{E_m-E_n}{\hbar}t}e^{i\phi}
\right]
\\ & =
2|b||a| d_{mn}\cos\mathopen{}\left(
\frac{E_m-E_n}{\hbar}t + \phi
\right),
\end{align}
which (as opposed to the actively-obscure form in your book) makes it very clear what the relationship is between the relative phase of the coefficients and the phase of the oscillations in the dipole moment.
For more on the subject, see my answer to Is there oscillating charge in a hydrogen atom?.
Oh, and while I'm bashing your book:
Here, as before, we let $a^*a=a^2$ and $b^*b=b^2$.
Never, ever do this. This is lazy writing and the only thing that it will achieve is to confuse your reader.
Beiser is acceptable as a stepping stone to bigger and better books (say, Cohen-Tannoudji, Sakurai, Shankar, take your pick), and as soon as you're able to digest the better ones you should move on from Beiser.
Best Answer
For the infinite potential well, do we not have $H = \frac{p^2}{2m}$ inside the well? Then $\frac{\partial H}{\partial t} = 0$.
I think you have misinterpreted $\frac{\partial H}{\partial t}$. You seem to be applying $\frac{\partial }{\partial t}$ to $(\psi^* H\psi)$, but you should be applying $\frac{\partial H}{\partial t}$ to $\psi$, and then multiplying that by $\psi^*$.
Ehrenfest's theorem applied to the Hamiltonian is the analogue to the classical mechanics theorem that $H$ is conserved unless it depends explicitly on time.