# Calculating the probability of finding particle in a certain excited state of energy in a 1D box

Assume that the wave function of a particle in a one-dimensional rigid box of length L $$(V=0$$ between $$x=0$$ and $$x=L$$ and $$V=+\infty$$ elsewhere) at time $$t=0$$, is given by

$$\Psi(x, 0) = \left\{ \begin{matrix} k, & \text{for} \ \ 0

where $$k$$ is a non-zero constant. Ignore the fact that it does not satisfy certain boundary conditions. Find the probability that the particle will be found in the ground state. Also, find the probability that it would be found in the first excited state.

My approach: By normalization, $$k=\sqrt{(1/L)}$$. To find the probability that it is in $$i$$th excited state, I just need to find $$c_i$$ (the coefficient of $$ith$$ eigenfunction and I'd get the probability by finding $$c_i^2$$. But how do I find $$c_i$$?

The solution for this question shows that we can just find $$c_i$$ as $$\int_0^L k\sqrt{(2/L)}\sin(n\pi x/L)dx$$, but how did they just arrive at this expression?

It is just the projection on the ground state. $$$$\mid \psi \rangle = \sum_n \langle n \mid \psi \rangle \mid n \rangle$$$$ So $$c_0 = \langle n \mid \psi \rangle$$. In this specific example, this corresponds to a Fourier-series.