<s>[INST] What particular solution should I guess for this relation? Just trying to solve a non-homogeneous recurrence relation:
$$f(n) = 2f(n-1) + n2^n$$
$$f(0) = 3$$

Characteristic equation is:
$$f(n) - 2f(n-1) = 0$$
$$a-2 = 0$$
$$a = 2$$
Homogeneous solution is:
$$f_H(n) = b_0\cdot (2)^n$$

Right-hand side is:
$$n2^n$$
What is the particular guess I should be taking based on this?
 [/INST] Just solve the bugger by using generating functions. Define $F(z) = \sum_{n \ge 0} f(n) z^n$, adjust indices so there aren't subtractions:
$$
f(n + 1) = 2 f(n) + (n + 1) 2^{n + 1}
$$
Multiply by $z^n$, sum over $n \ge 0$, recognize:
\begin{align}
\sum_{n \ge 0} f(n + 1) z^n    &= \frac{F(z) - f(0)}{z} \\
\sum_{n \ge 0} (2 z)^n         &= \frac{1}{1 - 2 z} \\
\sum_{n \ge 0} n 2^n z^{n - 1} &= \frac{\mathrm{d}}{\mathrm{d} z} \frac{1}{1 - 2 z} \\
\sum_{n \ge 0} (n + 1) 2^{n + 1} z^n
                               &= \frac{2}{(1 - 2 z)^2}
\end{align}
This gives:
$$
\frac{F(z) - 3}{z} = 2 F(z) + \frac{2}{(1 - 2 z)^2}
$$
Solving for $F(z)$, as partial fractions:
$$
F(z) = \frac{3}{1 - 2 z} - \frac{1}{(1 - 2 z)^2} + \frac{1}{(1 - 2 z)^3}
$$
Using the generalized binomial theorem:
\begin{align}
f(n) &= 3 \binom{-1}{n} (-2)^n - \binom{-2}{n} (-2)^n + \binom{-3}{n} (-2)^n \\
     &= 3 \cdot 2^n - (n + 1) 2^n + \frac{(n + 2) (n + 1)}{2} 2^n \\
     &= (n^2 + n + 6) \cdot 2^{n - 1}
\end{align}
At first glance, this checks, as $f(0) = 3$.
</s>