I am working through the following problem:
Let $P(x)$ be some arbitrary polynomial over the interval $[-1, +1]$. Then define $$A_n(P) = \int_{-1}^{+1} P(x)\cos{(n\pi x)}\,\mathrm{d}x$$
I am require to show that this coefficient (for $n > 0$) is in fact a polynomial in the variable $\frac{1}{n}$. My attempts so far have simply involved computing the integral using by parts, where the $u\cdot v$ term conveniently vanishes, and I am left with
$$A_n(P) = -\frac{1}{n\pi} \int_{-1}^{+1} P'(x)\sin{(n\pi x)} \, \mathrm{d}x$$
I am getting closer to the solution, or have I approached the problem in the wrong manner?
This is the correct technique. Persevere! One more integration by parts gives you $$ A_n(P) = \frac{1}{n^2\pi^2} \left[ P'(x)\cos{n\pi x} \right]_{-1}^1-\frac{1}{n^2\pi^2}\int_{-1}^1 P''(x) \cos{n\pi x} \, dx \\ = \frac{(-1)^n}{n^2\pi^2} (P'(1)-P'(-1))-\frac{1}{n^2\pi^2}\int_{-1}^1 P''(x) \cos{n\pi x} \, dx. $$ Now you can use induction, because $P''(x)$ has lower degree than $P(x)$. Because the degree jumps by two, you also have to check both degree one and degree zero to get both of the basis cases, however.