I've encountered a discrepancy while calculating the same integral using two different methods: direct integration and integration by parts. The integral in question is: $$\int (b_1 x + b_2 x^2) x^{-2} \, dx$$ Direct Integration:
First, I simplified and then integrated directly:
$$\int (b_1 x^{-1} + b_2) \, dx = b_1 \ln|x| + b_2 x + C$$
Integration by Parts:
Next, I used integration by parts, setting $u=b_1x+b_2x^2$ and $dv=−dx^{−1}$. I obtained:
$$\int (b_1x + b_2x^2) \left(\frac{dx}{x^2}\right) = -(b_1x + b_2x^2)\left(\frac{1}{x}\right) - \int \left(-\frac{1}{x}\right) (b_1 + 2b_2x) \, dx $$ Which simplifies to: $$-b_1 - b_2x + b_1 \ln|x| + 2b_2x + C $$
Question:
Why is there a discrepancy in the polynomial terms of the two results? Specifically, the term $b_1$ in the integration by parts result doesn't appear in the direct integration result.
This seems a generic problem for all functions since if I expand $f(x)$ around $x=0$, I obtain $f(x) = f(0) + b_1 x + b_2 x^2+...$. Then direct integration of $\int f(x)x^ndx$ ,where $n>1, n\in N$, doesn't yield a constant term $b_{n-1}$ while with integration by parts I have $b_{n-1}$.