<s>[INST] How to calculate this efficiently? If in the expansion of $(1 + x)^m \cdot (1 – x)^n $, the coefficients of $ x $ and $ x^2 $are 3 and -6 respectively, then m is ?
I solved it in the following way :
Expanding we get, the coefficient of $ x $ as $ (m-n) = 3 \cdots (1)$ and coefficient of $ x^2 $ as $ \frac{n(n-1)}{2} + \frac{m(m-1)}{2} +- m \cdot n = -6 \cdots (2)$ after substituting and some algebraic treatment I got m = 12 and n = 9. 
Now this is correct but I am interested if there exists any short procedure such that the entire problem could be done under a mint.
 [/INST] For the coefficient of $x$ to be 3, $m-n=3$ as you said, so $m>n$ and $m-n>0$ and we can factor the original product:
$$\begin{align}
(1+x)^m(1-x)^n&=(1+x)^{m-n+n}(1-x)^n
\\
&=(1+x)^{m-n}(1+x)^n(1-x)^n
\\
&=(1+x)^{m-n}\left((1+x)(1-x)\right)^n
\\
&=(1+x)^{m-n}(1-x^2)^n
\\
&=(1+x)^3(1-x^2)^n
\end{align}$$
Now, the coefficient of $x^2$ is the sum of the coefficients of $x^2$ in $(1-x^2)^n=1-nx^2+\cdots$ and $(1+x)^3=1+3x+3x^2+x^3$, so $-6=-n+3$ and $n=9$.  Since $m-n=3$, $m=12$.
</s>