Solution:
Key idea: We multiply out the product, complete the square to reach t2−a2, and then use ∫t2−a2dt=logt+t2−a2+C.
Step 1 — Multiply out the product.
We expand (x−1)(x−2) to get a quadratic.
(x−1)(x−2)=x2−3x+2
Step 2 — Complete the square.
Half the coefficient of x is −23, so we add and subtract 49.
x2−3x+2=(x−23)2−49+2
x2−3x+2=(x−23)2−41
x2−3x+2=(x−23)2−(21)2
Step 3 — Substitute.
We put x−23=t, so that dx=dt.
I=∫t2−(21)2dt
Step 4 — Apply the standard form.
We use ∫t2−a2dt=logt+t2−a2, with a=21.
I=logt+t2−41+C
Step 5 — Return to x.
From Step 2, t2−41 is the original quadratic x2−3x+2.
I=logx−23+x2−3x+2+C
Therefore, ∫(x−1)(x−2)dx=logx−23+x2−3x+2+C, for x<1 or x>2.