Solution:
Concept: The binomial theorem says that, for a positive integer n,
(x+y)n=nC0xn+nC1xn−1y+nC2xn−2y2+⋯+nCnyn
where nCr=r!(n−r)!n!. The (r+1)th term is the general term Tr+1=nCrxn−ryr. The expansion has n+1 terms, and in every term the powers of x and y add up to n.
Step 1 — Write the first three terms. With first term 1 and second term ax, the general term is nCr(ax)r:
(1+ax)n=1+nax+2n(n−1)a2x2+⋯
Step 2 — Compare coefficients. The coefficients of x and of x2 must match 12 and 64:
na=12(1)
2n(n−1)a2=64(2)
Step 3 — Eliminate a. Square equation (1) to get n2a2=144. Now divide equation (2) by this, so that a2 cancels:
2n2a2n(n−1)a2=14464
2nn−1=94
Step 4 — Solve for n. Cross-multiply and collect the terms in n:
9(n−1)=8n
n=9
Step 5 — Find a. We use equation (1) and divide 12 by n:
a=912=34
Check: We put n=9 and a=34 into the third coefficient, and get 64, as given:
29×8×916=64
Therefore, n=9 and a=34.