If I have a linear recurrence relation
$$Q_{n+1}(X) = \int_0^X Q_n (x) e^{k (X-x)} \ \mathrm{d} x,$$
knowing $Q_0(x)=e^{kx}$ and $k$ is a constant. It is easy to show the general form of the solution is
$$Q_n(x) = e^{kx} \sum_{i=0}^n \alpha_{i,n} x^i,$$
and we can establish a recurrence relation for the coefficients $\alpha_{i,n}$.
The aim is to write a code in Wolfram Language that can find the recurrence relation for the coefficients $\alpha_{i, n}$ in this scenario, and in slightly more general scenarios (linear recurrence relation involving a single integral and similar solution form).
With ReplaceAll
and properly defined Rule
s, I am able to insert the general solution form into the original recurrence relation, but I am unable to simplify further. For instance, Mathematica doesn't pull the sum out of the integral in the RHS.
Update 1
The coefficients $\alpha_{i,n}$ should also have an $n$ index.
Update 2
Indeed we know how to solve this recurrence equation explicitly but that is not the goal here. For human beings, it is rather simple to insert the general form of the solution, then exchange the sum and the integral in the RHS, also pulling out the coefficients $\alpha_{i,n}$ of the integral as they have no $x$ dependence. What I want to achieve is to write a code in Wolfram Language that does it in the way human beings would do.
Q[n,x]
? $\endgroup$NestList
does in my answer. But it doesn't give the sum-formula you're expecting I think! $\endgroup$