I came across a textbook problem that showed an integral solved with the substitution method:
$$\int_a^b(b-x)^2dx = \left(-\frac{(b-x)^3}{3}\right)\Biggl\vert_a^b$$
I then attempted to solve the same definite integral by expanding out the polynomial first and then integrating. Step 1 I got this:
$$\int_a^b(b^2 - 2bx +x^2)dx$$
Next, I integrated each part of the polynomial and got this:
$$=(b^2x - bx^2 + \frac{x^3}{3})\Biggl\vert_a^b$$
I must have done something wrong here since these results are not equivalent. Where am I missing something? Thanks for your help!
If you pretend that
$$\int_a^b(b^2 - 2bx +x^2)\ dx = \left(-\frac{b^3}3 + b^2x - bx^2 + \frac{x^3}{3}\right)\Biggl\vert_a^b$$
by setting the integration constant to $-\frac{b^3}3$, you should see that the two approaches give the same result.