<s>[INST] Binomial Expansion $(1+kx)^4 (1+x)^n$ 
Question
In the expansion of $(1+kx)^4 (1+x)^n$, the coefficient of $x$ is $13$ and the coefficient of $x^2$ is $74$.
  Find the possible values of $k$ and $n$.

My solution
$$
\begin{split}
(1+kx)^4 &= 1+4kx+6k^2 x^2+4k^3 x^3+k^4 x^4\\
(1+x)^n  &= 1+ \binom{n}{1}x+\binom{n}{2} x^2...
\end{split}
$$
So $\binom{n}{1}x + 4kx=13x$ and 
$\binom{n}{2}x^{2}+4k\binom{n}{1}x^{2}+6k^{2}x^{2}=74x^{2}$.
That is, $$\binom{n}{1}+4k=13 \quad (*)$$ and 
$$\binom{n}{2}+4k\binom{n}{1}+6k^{2}=74 \quad (**)$$
Since $\binom{n}{1}=n$, we have $n+4k=13$.
From trial and improvement I worked out that $n = 5$ and $k = 2$ satisfies both equations (*) and (**) above.
How do I find the other set of solutions?
 [/INST] The second equation gives
$$n(n-1) + 8nk + 12k^2 = 148$$
(by multiplying the equation by $2$ and noting $\binom n2 = \frac{n(n-1)}2.$
We have $n+4k=13$. Write $n = 13-4k$, and substitute this into the above equation, to obtain
$$(13-4k)(12-4k) + 8(13-4k)k + 12k^2 = 148,$$
which is a quadratic in $k$. You can now solve for $k$, and then use $n=13-4k$ to find $n$.
</s>