The binomial expansion of \( (1+x)^n \) is given by \( 1 + nx + \frac{n(n-1)}{2!}x^2 + \dots \).
For the given expansion \( (1+kx)^n \), we can substitute \( y = kx \) to get \( (1+y)^n \). The first three terms of the expansion are \( 1 + ny + \frac{n(n-1)}{2!}y^2 + \dots \). Substituting \( y=kx \) back, we have:
\( 1 + n(kx) + \frac{n(n-1)}{2!}(kx)^2 + \dots \)
\( 1 + nkx + \frac{n(n-1)}{2!}k^2x^2 + \dots \)
We are given that the first three terms are \( 1 + 6x + 12x^2 \). Comparing the coefficients:
1. Coefficient of \( x \): \( nk = 6 \)
2. Coefficient of \( x^2 \): \( \frac{n(n-1)}{2}k^2 = 12 \)
From equation (1), \( n = \frac{6}{k} \).
Substitute this into equation (2):
\( \frac{\frac{6}{k}(\frac{6}{k}-1)}{2}k^2 = 12 \)
\( \frac{6k^2}{2k}(\frac{6-k}{k}) = 12 \)
\( 3k(\frac{6-k}{k}) = 12 \)
\( 3(6-k) = 12 \)
\( 18 - 3k = 12 \)
\( 3k = 18 - 12 \)
\( 3k = 6 \)
\( k = 2 \)
With \( k=2 \), we can find \( n \): \( n = \frac{6}{2} = 3 \). Let's check this with the \( x^2 \) coefficient: \( \frac{3(3-1)}{2}(2^2) = \frac{3 \times 2}{2} \times 4 = 3 \times 4 = 12 \), which matches the given expansion.