<s>[INST] Integrate by substitution (Not by parts) $\int(x^2-2x)(x^3-3x^2+9)dx$ I have an integration question and I cannot figure out why my answer is incorrect as online calculators will use integration by parts instead, when technically we haven't (and won't) learn that method so I want to be very comfortable with integration with substitution.
$$\int\big(x^2-2x\big)\big(x^3-3x^2+9\big)dx$$
So what I did was
$$u=x^3-3x^2+9$$
$$=\int(x^2-2x)\;u\;\frac{dx}{3(x^2-2x)}$$
$$=\frac{1}{3} \int u \;du $$
$$=\frac{u^2}{6}$$
$$=\frac{\big(x^3-3x^2+9\big)^2}{6}+C$$
But apparently this is incorrect.
My problem may be misunderstanding what can be substituted when?
Help is appreciated.
 [/INST] As per your comment, you can always expand:
$$\int\big(x^2-2x\big)\big(x^3-3x^2+9\big)dx$$
$$= \int x^5-3x^4+9x^2-2x^4+6x^3-18x \  \mathrm{d} x$$
$$= \int x^5-5x^4+6x^3+9x^2-18x \  \mathrm{d} x$$
$$= \frac{1}{6}x^6 - x^5 + \frac{3}{2}x^4 + 3x^3-9x^2 + C$$
$$= \frac{1}{6} \left(x^6 - 6x^5 + 9x^4 + 18x^3 - 54x^2 + C'\right)$$
Which should be equivalent to:
$$\frac{1}{6}  \left( \left(x^3-(3x^2-9) \right)\left(x^3-(3x^2-9) \right)  \right)$$
$$=\frac{1}{6} \left(x^6-2(x^3)(3x^2-9) + (3x^2-9)^2 \right)$$
$$=\frac{1}{6} \left(x^6-6x^5+18x^3+9x^4-54x^2+81 \right)$$
$$=\frac{1}{6} \left(x^6-6x^5+9x^4+18x^3-54x^2+C' \right) \color{#228b22}{\checkmark}$$
</s>