Consider a particle in an infinite square well with $$V(x) \begin{cases} = 0 & −a \lt x \lt a\\ \to \infty & \text{otherwise} \end{cases}$$ At $t = 0$, the particle has the wavefunction (defined over $−a \lt x \lt a$): $$\psi(x,t=0)=A\cos^{3}\left(\frac{\pi x}{2a}\right)$$
Find the value of the constant $A$.
Using De Moivre's theorem I was able to show that $$\psi(x,t=0)=A\cos^{3}\left(\frac{\pi x}{2a}\right)=\frac{3A}{4}\cos\left(\frac{\pi x}{2a}\right)+\frac{A}{4}\cos\left(\frac{3\pi x}{2a}\right)\tag{1}$$
& using the fact that $$\psi=\sum_na_n\phi_n\tag{2}$$
Using $\mathrm{(1)}$ & $\mathrm{(2)}$ I find that $$\psi(x, t=0)=\sum_na_n\phi_n=a_1\phi_1+a_3\phi_3$$ so $a_1=\dfrac{3A}{4}$, $\,\,\phi_1=\cos\left(\dfrac{\pi x}{2a}\right)$, $\,\,a_3=\dfrac{A}{4}$, $\,\,\phi_3=\cos\left(\dfrac{3\pi x}{2a}\right)$
Now using $$\sum_{n=-\infty}^{\infty}{\lvert a_n \rvert}^2=1$$
So $$\left(\frac{3A}{4}\right)^2+\left(\frac{A}{4}\right)^2=1$$
Which, on rearranging, gives $$A=\sqrt{\frac85}$$
The problem is that the correct answer is $$A=\sqrt{\frac{8}{5a}}$$
I am very curious about why that factor of $a$ is part of the normalization constant $\mathrm{A}$ since it is also half the width of the well and appears in the argument of the cosine eigenstate. How can this normalization constant have a property of the system?
I have applied what I thought was the correct logic. But it seems I am missing something. Does anyone have any idea how the author reached that answer?
EDIT:
I have been given two answers to this question, thank you to those that took the time to answer.
There is still one thing I can't understand, and unfortuanately I will have to upload the full question and solution in order to get the point across. Below is a 2nd year undergraduate physics assessed problem:
Here is the professors solution to the first part of the question:
and here is the solution to the second part of the question:
Many thanks.



I would like to state that you have a mistake. The (normalized) eigenstate function $\phi_n$ should look like $$\phi_n(x)=\frac{1}{\sqrt{a}}\,\cos\left(\frac{n\pi x}{2a}\right)\text{ for }x\in[-a,+a]\,.$$ This can be easily checked since $$\int_{-a}^{+a}\,\cos^2\left(\frac{n\pi x}{2a}\right)\,\text{d}x=a\,.$$ Therefore, from (1) and (2) in your question, you should get $$a_1=\frac{3A\sqrt{a}}{4}\text{ and }a_3=\frac{A\sqrt{a}}{4}\,.$$