Solution:
Concept: In a product of two expansions, a term in x5 comes from multiplying a term in xk of the first factor by a term in x5−k of the second, for k=0,1,…,5. Add all these products.
Step 1 — Write both general terms. In (1+2x)6 the coefficient of xk is 6Ck2k; in (1−x)7 the coefficient of xj is 7Cj(−1)j:
(1+2x)6=1+12x+60x2+160x3+240x4+192x5+64x6
(1−x)7=1−7x+21x2−35x3+35x4−21x5+7x6−x7
Step 2 — Pair the terms whose powers add up to 5. Multiply each coefficient of xk in the first by the coefficient of x5−k in the second:
1×(−21)12×3560×(−35)160×21240×(−7)192×1=−21=420=−2100=3360=−1680=192
Step 3 — Add the six products. Every pair contributes to x5, so the coefficient is their total:
−21+420−2100+3360−1680+192=171
The coefficient of x5 is 171.