Solution (source code)

= Solution

<Wavefunction normalization> requires unit total probability:
$$
1=\int_0^a|\Psi_n(x)|^2\,\mathrm dx
=|C_n|^2\int_0^a\frac{1-\cos(2n\pi x/a)}2\,\mathrm dx
=|C_n|^2\frac a2.
$$
Choosing an irrelevant overall phase to be zero gives
$$
\boxed{\Psi_n(x)=\sqrt{\frac2a}\sin\frac{n\pi x}{a}.}
$$
The amplitude has units of inverse square root length, so $|\Psi_n|^2\,\mathrm dx$ is dimensionless.