It's obvious that there is a strong relation between linear recursions of sequences and linear differential equations. The common methods for solving them are nearly identical. For example, the general solution to
$$ a_{n+2} = 5 a_{n+1} - 6 a_n + 2^n (4n - 2) $$
is
$$a_n = 3^n A - 2^n (n^2 + 2n + B)$$
with arbitrary constants $A$ and $B$; if $a_0 = 1$ and $a_1 = 2$ were given,
$$a_n = 6 \cdot 3^n - 2^n (n^2 + 2n + 5)$$
would be the only solution. In terms of differential equations, the general solution to
$$ \frac{d^2y}{dx^2} - 5 \frac{dy}{dx} + 6 y = e^{2x} (4x - 2) $$
is
$$y(x) = e^{3x} A - e^{2x} (2x^2 + 2x + B),$$
or, if $y(0) = 1$ and $y'(0) = 2$ are given,
$$y(x) = 2 \cdot e^{3x} - e^{2x} (2x^2 + 2x + 1).$$
There are some major parallels, but there are also differences. While I know why this basically works, i.e., that raising $n$ by one does the same thing to $n^3$ as differentiating with respect to $x$ does to $e^{3x}$, my question is: Is there an underlying connection between these two equations, something I missed? Or is it just that, that they have some similar properties?