Been trying to prove this identity and lacked the success (or luck) I've tried with induction or some algebra's tricks but ended up stuck over and over. Be happy to get an hint or algebric/combinatoric proof.
$$2n\times3^{n-1}+4n(n-1)3^{n-2}=\sum_{k=1}^{n}k^2\dbinom{n}{k}2^k$$
Thanks a lot
Start out by using the identity: $$(1 + x)^n - 1 = \sum_{1 \le k \le n}\binom{n}{k} x^k$$
Differentiate both sides with respect to $x$ to get: $$n(1 + x)^{n-1} = \sum_{1 \le k \le n}k \binom{n}{k} x^{k-1}$$. Then multiply both sides by $x$ and get: $$n x (1 + x)^{n-1} = \sum_{1 \le k \le n} k \binom{n}{k} x^k$$. Differentiate both sides again w.r.t to $x$: $$n(1 + x)^{n-1} + n(n-1)x(1 + x)^{n-2} = \sum_{1 \le k \le n} k^2 \binom{n}{k} x^{k-1}$$ Multiply both sides by $x$ again: $$ nx(1 + x)^{n-1} + n(n-1)x^2 (1 + x)^{n-2} = \sum_{1 \le k \le n} k^2 \binom{n}{k} x^k. $$ Finally, put $x = 2$ into this last equation and simplify: $$ 2n \cdot 3^{n-1} + 4n(n-1) \cdot 3^{n-2} = \text{RHS} $$
QED