Please consider the image below. It contains the problem and the work I have done. I am off by a minus sign and I'm not sure how to get rid of it. Consider what I have and what the book has. ...
I have a probability distribution (PDF) defined by a Fourier series.. actually it's a purely cosine series over a known range. The PDF quite smooth, so most of the power is in the low 5 or so ...