I am trying to understand Duhamel's Principle by applying it to some simple problems. I am thinking of $P(t)$ as expressing a bank account balance at time $t$, to try to gain an intuition for Duhamel's Principle that doesn't depend on understanding physics.
First I considered $P'(t) - \frac{1}{10}P(t) = \pi,\ P(0) = 0$. I started by solving $Q'(\tau) - \frac{1}{10}Q(\tau) = 0,\ Q(0) = \pi$ (swapping the forcing term and initial condition) and got the answer $Q(\tau) = \pi e^{\frac{1}{10}\tau}$. It appears that I can simply integrate this and produce the correct solution as $P(t) = \int_0^t \pi e^{\frac{1}{10}\tau} d\tau = 10\pi e^{\frac{1}{10}t} - 10\pi$. In English, this seems to say, "To calculate the balance of a bank account starting with $\$0$ and continuously receiving deposits of $\$\pi$ per time unit, integrate between $0$ and $t$ the balance of a bank account starting with $\$\pi$ and continuously receiving deposits of $\$0$ per time unit." Of note is that both the real and hypothetical accounts have $10\%$ continuous compounding, but their time units are not necessarily the same ($t$ and $\tau$ are presumably two forms of time).
Since the above statement is not obvious, I decided to try a discrete version of the problem so I could then track the account balances at each time step. To consider $P[n + 1] - \frac{1}{10}P[n] = \pi,\ P[0] = 0$, I solved $Q[m + 1] - \frac{1}{10}Q[m] = 0,\ Q[0] = \pi$. The answer I got is $Q[m] = \frac{\pi}{10^m}$, and inspired by the above integration, I took a summation from $0$ to $n$ to produce the solution $\displaystyle P[n] = \sum_{m = 0}^n \frac{\pi}{10^m} = \frac{\pi (10)^{n + 1} - \pi}{9(10)^n}$. However, I believe this is slightly incorrect and the solution should be $P[n] = \frac{\pi (10)^n - \pi}{9(10)^{n - 1}}$.
Can I use Duhamel's Principle to solve difference equations? If so, what mistake have I made in the computations? Is there a nice description of Duhamel's Principle in the context of this sort of bank account model (continuous or discrete)?
If you have: $$\begin{cases} a_{n+1}-xa_n = y,\, x\neq 1 \\ a_0 = 0 \end{cases}$$ then you can easily find its general solution is $a_n = \dfrac{y(1-x^n)}{1-x}.$On the other hand, the solution to the "homogeneous" version: $$\begin{cases} b_{n+1} - xb_n = 0,\,\, x\neq 1 \\ b_0 = y \end{cases} $$ is simply $b_n = xy^n.$ Then, you can see that the following relation holds: $$a_n = b_0+b_1+b_2+\dots b_{n-1}\text{ or } a_n = a_{n-1} + b_{n-1}$$ by a simple geometric summation. Or if you like, you can prove this indirectly via induction without solving any of the above explicitly. Furthermore, you can then look at the Riemann Sum Formulation of integrals and conclude a simple, ODE version of the Duhamel Principle by taking the limit.
However, when you try to go the other direction or try to "discretize" only from the continuous version, you cannot decide where to stop the finite sum by just looking at the integral because both the Right and Left Riemann sums converge to the integral: $$\int_0^t f(x)dx = \lim\limits_{n\to\infty} \sum_{i=1}^n f(x_i)\triangle x_i=\lim\limits_{n\to\infty} \sum_{i=0}^{n-1}f(x_i)\triangle x_i,$$ where $x_0<x_1<x_2<\dots x_n$ partitions the integral $[0,t].$
If you really insist, then in the case of your simple finite-difference model, it looks like you could formulate a theorem that says the Discrete analog of Duhamel Principle holds if we look at the Left Riemann sums.