I'm reading this book. In Ch. 3.4, it studies the wave equation $u_{tt}=c^2u_{xx}$ with BCs $u_x(0,t)=0,\,u_x(L,t)=0$, and ICs $u(x,0)=f(x),\,u_t(x,0)=g(x)$.
The total energy of a string is the summation of the kinetic energy and the potential energy: $E=E_k+E_p=\frac{1}{2}\int_0^Lu_t^2dx+\frac{c^2}{2}\int_0^Lu_x^2dx$. I know that $E_k=mv^2/2$ and $E_p=kx^2/2$.
However, in the integral, $E_k$ term does not contain mass and the $E_p$ term has $u_x^2$ in stead of the square of the displacement. How can I figure out the unit and the dimension?
I have wondered similar things myself many times in the past (here an example). Mathematical books usually simplify physical constants to $1$, and moreover, they occasionally abuse of language. (Example. The word "energy" is one of the most common in mathematics, but it does not always match its physical meaning).
Note that the "dimensionally correct" equation for a vibrating string is
$$ \mu \frac{\partial^2 u}{\partial t^2} - T\frac{\partial^2 u}{\partial x^2}=0,$$
with the notations of the linked post (i.e. $\mu=$ mass density, $T=$ tension). This is dimensionally consistent: $u$ is a displacement, so $$ [u]=L, $$ ("dimension of $u$ is Length"), $\mu$ is a mass density, so $$ [\mu]=ML^{-1}$$ ("mass times length$^{-1}$"), and $T$ is tension, which is a force, so $$ [T]=MLt^{-2}$$ ("mass times length times time$^{-2}$"). Therefore $$ \left[ \mu \frac{\partial^2 u}{\partial t^2} \right] = Mt^{-2} = \left[ T\frac{\partial^2 u}{\partial x^2} \right].$$
The equation you wrote, that is $$ u_{tt} - c^2 u_{xx}=0$$ corresponds to this one with $$ c=\sqrt{\frac{T}{\mu}}.$$ You can check that this $c$ has the dimensions of speed: $[c]=Lt^{-1}$.