I am working on a problem in the context of an infinite symmetric potential barrier around the origin, with barriers at $x=- \frac{a}{2}$ and $x=\frac{a}{2}$. The wave function is a symmetric triangle-function:
$$ \Psi (x) = \begin{cases} 0 & x < - \frac{a}{2} \\ \sqrt{\frac{12}{a^3}} \left( \frac{a}{2} - \lvert x \rvert \right) & -\frac{a}{2} \leq x \leq \frac{a}{2} \\ 0 & x > \frac{a}{2} \end{cases} $$
I must calculate the probability of measuring a particle in the above eigenstate in the ground state (when $n=1$). The way to attack this problem is to calculate the coefficient $c_1$, and then square it. Here follows my (wrong) attempt.
$$ c_n = \int\limits_{-\infty}^{\infty} \psi_n^*(x)\Psi (x)\,\mathrm dx $$
I understand from the above expression that the $\psi_n^* (x)$ is just the "regular" solution to the particle in a box. Given this symmetric potential, and that $n=1$ (odd $n$, even function), I must set
$$ \psi _1^* (x) = \sqrt{\frac{2}{a}} \cos\frac{\pi x}{a} $$
The expression for $c_n$ becomes
$$ c_n = \int\limits_{-a/2}^{a/2} \sqrt{\frac{2}{a}} \cos\frac{\pi x}{a} \sqrt{\frac{12}{a^3}} \left( \frac{a}{2} - \lvert x \rvert \right)\,\mathrm dx \\ $$
Simplifying gives
$$ c_n = \frac{2 \sqrt{6}}{a^2} \int\limits_{-a/2}^{a/2} \cos \left( \frac{\pi x}{a} \right) \left( \frac{a}{2} - \lvert x \rvert \right)\,\mathrm dx $$
This can be solved by partial integration, setting $u'=\cos \left( \frac{\pi x}{a} \right)$ and $v= \left( \frac{a}{2} - \lvert x \rvert \right)$. Hence, $u=\frac{a}{\pi}\sin \left( \frac{\pi x}{a} \right) $ and $v'=-1$. The integral itself then becomes
$$ \int\limits_{-a/2}^{a/2} \cos \left( \frac{\pi x}{a} \right) \left( \frac{a}{2} - \lvert x \rvert \right)\,\mathrm dx = \frac{a}{\pi}\sin \left( \frac{\pi x}{a} \right)\left( \frac{a}{2} - \lvert x \rvert \right) - \int \frac{a}{\pi}\sin \left( \frac{\pi x}{a} \right) (-1)\,\mathrm dx $$
Cleaning up
$$ \mbox{Integral} = \frac{a^2}{2 \pi} \sin \left( \frac{\pi x}{a} \right) - \lvert x \rvert \frac{a}{\pi} \sin \left( \frac{\pi x}{a} \right) - \frac{a^2}{\pi ^2} \cos \left( \frac{\pi x}{a} \right) $$
Now we just need to insert the limits. However, we see quite easily from the above expression that upon inserting $x=\pm \frac{a}{2}$, the last term vanishes, since $\cos ( \pm\pi / 2 = 0)$. The sine terms will equal $1$ when the limit is positive and $-1$ when the limit is negative. Hence, we are left with
$$ \mbox{Integral} = \left[ \frac{a^2}{2 \pi} - \frac{a}{2} \frac{a}{\pi} \right] - \left[ \frac{a^2}{2 \pi}(-1) - \lvert \frac{-a}{2} \rvert \frac{a}{\pi}(-1) \right] = \frac{a^2}{2 \pi} + \frac{a^2}{2 \pi} = \frac{a^2}{\pi} $$
Plugging this into the original expression
$$ c_n = \frac{2 \sqrt{6}}{a^2} \cdot \frac{a^2}{\pi} = \frac{2 \sqrt{6}}{\pi} \approx 1.56 $$
So, you see the problem. My $c_n$ is larger than one, which will give me a rather un-physical probability. Am I wrong in this derivation in my assumption for $\psi _n^* (x)$? If not, then where?
Wolfram Alpha gives me that
$$ \mbox{Integral} = \frac{2a^2}{\pi ^2} \\ \Rightarrow c_1 = \frac{2 \sqrt{6}}{a^2} \cdot \frac{2a^2}{\pi ^2} = \frac{4 \sqrt{6}}{\pi ^2} $$
Using this gives me a probability of $c_1^2 \approx 0.986$, which at least has physical meaning. Also, logic tells me that there is a very high probability of finding the particle in the ground state, so this further backs up WA's answer.