$$ \int(x^2+1)(x+1)dx$$
Per partes, let $$u = x+1; u' = 1 $$ $$v' = x^2+1; v = x^3/3 + x $$
$$=(x+1)(x^3/3+x) - \int1*(x^3/3+x) = (x+1)(x^3/3+x) - \frac{1}{3}\frac{x^4}{4}-\frac{x^2}{2} + C $$
Wolfram gave me this $x^4/4+x^3/3+x^2/2+x+C$. I understand it, but I would like to know if my solution is right too? (Will I get points for my solution on exam? I know it depends on professor, but does my solution contain any essential mistake?)
EDIT: sorry for bad sign, I have badly rewritten it from papers
You are making this a lot harder than it needs to be. Just use the distributive property to expand it out into a polynomial. That is:
$$(x^2 + 1)(x + 1)=x^3+x^2+x+1$$
If you are masochist, however, integration by parts works too. :)