According to WolframAlpha, $$\int (x^2+1)^n dx = x \cdot _2F_1(\frac{1}{2},-n;\frac{1}{3};-x^2)$$ and $$_2F_1(\frac{1}{2},-n;\frac{1}{3};-x^2)= \sum_{n=0}^{\infty} \frac{1}{3}(-n)\frac{(-x^2)^n}{n!}.$$
Can you tell which are correct terms of the sum of solution of the integral $\int (x^2+1)^n dx $? these $$(n=0): x, (n=1): 1/3x(x^2+3), (n=2): 1/3 x(x^4+x^2), \dots$$
or (by using $_2F_1(a,b;c;z)= \sum_{n=0}^{\infty} \frac{(a)_n(b)_n}{(c)_n}\frac{z^n}{n!}$(1)), these which I got $$(n=0): 0, (n=1): 1/3x(x^2), (n=2): 1/3 x(-x^4+x^2), \dots$$ If mine are incorrect, can you compute some terms of the sum (1)?