The x2 term of the product is 1×40x2+(−x)(10x)=40x2−10x2=30x2. So the coefficient is 30.
Common mistake: missing a cross term when multiplying. In (1−x)(1+2x)5, the x2 term comes from two products, 1×40x2 and −x×10x.
Exam tip: list which products give the power you need before multiplying. For "find k" questions, write the coefficient as an equation in k, and remember a squared unknown gives a ± pair.
Check yourself
The coefficient of x in (1+ax)6 is 18. Find a.
6a=18, so a=3.
Find the coefficient of x in (3+x)(1+2x)4.
(1+2x)4=1+8x+…, so 3×8+1×1=25.
Why can you stop expanding early in a product question?
Only the terms up to the power you need can affect that coefficient.