I'm investigating the following integral: $$ g(y) = \int_{-\infty}^\infty \frac{f(x)}{x - i y} dx $$ where I know that $f(-x) = - f(x)$, and $\lim_{x \to \infty} f(x) = 0$. (In practice I have data for $g(y)$, and am trying to find $f(x)$.) I can express this function as a Taylor series for y using the geometric series, which gives: $$ g(y) = \int_{-\infty}^\infty \frac{f(x)}{x - i y} dx = \sum_{n=0}^\infty (iy)^n \int_{-\infty}^\infty \frac{f(x)}{x^{n+1}} dx $$
Now comes the thing that's confusing me. Via partial integration, I find: $$ \int_{-\infty}^\infty \frac{f(x)}{x^{n+1}} dx = \frac{f(x)}{x^{n+1}} \Bigg{\vert}_{-\infty}^{\infty} + (n + 1) \int_{-\infty}^\infty \frac{f(x)}{x^{n+2}} dx = (n+1) \int_{-\infty}^\infty \frac{f(x)}{x^{n+2}} dx $$ where the first term was dropped because $\lim_{x \to \infty} f(x) = 0$. But this means that if the integrand on the left hand side was even, on the right hand side I find one which is odd, i.e. zero. Hence, all coefficients in my Taylor expansion will be zero, and $g(y)$ will be zero, which I know it is not.
I feel stupid for having to ask this, but what am I doing wrong? Am I not allowed to do partial integration this way?