<s>[INST] $\sum(-1)^{k}k^{2}C_{n}^{k}$ I'm asked to compute $\sum^{n}_{k=1}(-1)^{k}k^{2}C_{n}^{k}$ for $n\geqslant 1$. I tried to use generating functions to solve the problem: $A(x):=\sum^{n}_{k=1}k^{2}C_{n}^{k}x^{k}$. So, I need to compute $A(-1)$. 
For $n=1$ $A(-1)=-1$, for $n=2$ $A(-1)=2$, for $n=2$ $A(-1)=2$, for $n=3,4,5,6,7,...(?)$ $A(-1)=0$. It seems that the answer is $0$ for $n\geqslant 3$...
Thank you in advance!
 [/INST] First note that
\begin{align}
\sum_{k=1}^\infty k^2 x^k
&=x^2\sum_{k=1}^\infty k(k-1) x^{k-2} + x\sum_{k=1}^\infty k x^{k-1}\\
&=x^2\frac{d^2}{dx^2}\sum_{k=0}^\infty x^k + x\frac{d}{dx} \sum_{k=0}^\infty x^k\\
&=x^2\frac{d^2}{dx^2}\frac{1}{1-x} + x\frac{d}{dx} \frac{1}{1-x}\\
&=x^2\frac{2}{(1-x)^3}+x\frac{1}{(1-x)^2}\\
&=\frac{x(1+x)}{(1-x)^3}. \tag1
\end{align}
Now
\begin{align}
\sum_{n=1}^\infty \sum_{k=1}^n (-1)^k k^2 \binom{n}{k} z^n
&=\sum_{k=1}^\infty (-1)^k k^2 \sum_{n=k}^\infty \binom{n}{k} z^n\\
&=\sum_{k=1}^\infty (-1)^k k^2 \frac{z^k}{(1-z)^{k+1}}\\
&=\frac{1}{1-z}\sum_{k=1}^\infty k^2 \left(\frac{-z}{1-z}\right)^k\\
&=\frac{1}{1-z}\frac{\frac{-z}{1-z}\left(1+\frac{-z}{1-z}\right)}{\left(1-\frac{-z}{1-z}\right)^3} &&\text{by $(1)$ with $x=\frac{-z}{1-z}$}\\
&=-z+2z^2.
\end{align}
Hence
$$\sum_{k=1}^n (-1)^k k^2 \binom{n}{k}=
\begin{cases}
-1 &\text{if $n=1$}\\
2 &\text{if $n=2$}\\
0 &\text{otherwise}
\end{cases}$$

Alternatively, @Phicar's approach yields
\begin{align}
\sum_{k=1}^n (-1)^k k^2 \binom{n}{k}
&=\sum_{k=1}^n (-1)^k \left(2\binom{k}{2}+\binom{k}{1}\right) \binom{n}{k} \\
&=2\sum_{k=2}^n (-1)^k \binom{k}{2} \binom{n}{k} +\sum_{k=1}^n (-1)^k \binom{k}{1} \binom{n}{k} \\
&=2\sum_{k=2}^n (-1)^k \binom{n}{2} \binom{n-2}{k-2} +\sum_{k=1}^n (-1)^k \binom{n}{1} \binom{n-1}{k-1} \\
&=2\binom{n}{2} \sum_{k=2}^n (-1)^{k-2} \binom{n-2}{k-2} -\binom{n}{1}\sum_{k=1}^n (-1)^{k-1} \binom{n-1}{k-1} \\
&=2\binom{n}{2} \sum_{k=0}^{n-2} (-1)^k \binom{n-2}{k} -\binom{n}{1}\sum_{k=0}^{n-1} (-1)^k \binom{n-1}{k} \\
&=2\binom{n}{2} (1-1)^{n-2} - \binom{n}{1}(1-1)^{n-1} \\
&=2\binom{n}{2} [n=2] - \binom{n}{1}[n=1] \\
&=
\begin{cases}
-1 &\text{if $n=1$}\\
2 &\text{if $n=2$}\\
0 &\text{otherwise}
\end{cases}
\end{align}
</s>