Infinite square well, Probability of measurement of particle's energy

The Attempt at a Solution

I have managed to do the first 3 parts of the questions. The last two 4 markers are the ones I am having difficulties with. I have tried using the expansion postulate which states the wavefunction is equal to the sum of the expansion coefficent "a" and the eigenfunction. Then by squaring the expansion coefficient, this should provide the probability.

The wavefunction from part 3) was found to be 2Acos(kx), and I've tried integrating this by squaring it, but I notice that's not the right way to go about this problem.

Any help would be much appreciated.

If you take ψ and Φ, then integrate from a to -a, would that provide the expansion coefficient a$_{n}$? In which case, by squaring this coefficient, this would provide the probability?