2
$\begingroup$

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 Rules, 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.

$\endgroup$
7
  • 1
    $\begingroup$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. $\endgroup$
    – Community Bot
    Commented Feb 17 at 4:26
  • $\begingroup$ May the bot @Community specify what sort of details are missing? $\endgroup$
    – N.D
    Commented Feb 17 at 8:53
  • $\begingroup$ How did you show the general form of the solution Q[n,x]? $\endgroup$ Commented Feb 17 at 14:35
  • $\begingroup$ @UlrichNeumann 1. $Q_0(x)=e^{kx}$ satisfies the form 2. Insert the expression in the RHS, you can pull out the $e^{kX}$ factor then you have a polynomial of degree (at most) $n$ to integrate so you obtain a polynomial of degree (at most) $n+1$ hence the form. $\endgroup$
    – N.D
    Commented Feb 17 at 14:53
  • $\begingroup$ @NathanaëlDENG Thanks. That's what NestList does in my answer. But it doesn't give the sum-formula you're expecting I think! $\endgroup$ Commented Feb 17 at 14:56

2 Answers 2

1
$\begingroup$

Regarding the integral equation

$$ Q_{n+1}(X) = \int_0^X Q_n (x) e^{k (X-x)} \ \mathrm{d} x, $$

it can be written as

$$ Q_{n+1}(x) = Q_n(x)\circledast e^{kdx} $$

and taking the Laplace transform we have

$$ Q_{n+1}(s)=\frac{1}{s+k}Q_{n}(s) $$

now considering that $Q_0(s) = \frac{1}{s+k}$ we have

$$ Q_n(s) = \left(\frac{1}{s+k}\right)^{n+1} $$

with anti-transform

$$ Q_n(x) = \frac{e^{-k x} x^n}{\Gamma (n+1)} $$

Follow two scripts which produce the same results

Clear[Q]
InverseLaplaceTransform[Q[n] /. RSolve[{Q[n + 1] == Q[n]/(s + k), Q[0] == 1/(s + k)}, Q, n][[1]], s, x]

and

Clear[Q]
n = 10;
Q = Exp[k x];
QQ = {Q};
For[i = 1, i <= n, i++,
 Q = Integrate[Q Exp[k (u - x)], {x, 0, u}] /. {u -> x};
 AppendTo[QQ, Q]
 ]

QQ
$\endgroup$
3
  • $\begingroup$ I totally agree with what you do, if the aim is to actually solve the recurrence relation. However, as I mentioned in the question description, the aim is really to find the recurrence relation for the coefficients $\alpha_{i,n}$. That is why the tag "simplifying-expressions" was added. $\endgroup$
    – N.D
    Commented Feb 17 at 9:31
  • $\begingroup$ As can be depicted in the general answer, $\alpha_{n,n}=\frac{1}{n!}$ $\endgroup$
    – Cesareo
    Commented Feb 17 at 9:39
  • $\begingroup$ Agreed and thank you for pointing that out. The goal was actually to write a code so that Mathematica can achieve what I, as human being, can manipulate. I will update the description so this is even more explicit. $\endgroup$
    – N.D
    Commented Feb 17 at 9:44
1
$\begingroup$

Try NestList

sol = NestList[
Function[X,Evaluate@Integrate[ # [x] Exp[k (X - x)  ], {x, 0, X}]] &    , 
Exp[k #] &, 5];

Qn=Through[sol[X]]
(*{E^(k X), E^(k X) X, 1/2 E^(k X) X^2, 1/6 E^(k X) X^3,1/24 E^(k X) X^4,1/120 E^(k X) X^5}*)    

It looks like your expectation might be wrong. Mathematica evaluates instead

Q[n][X]=Exp[k X] X^n/n!

This result might be confirmed with (Thanks @Mariusz Iwaniuk)

FindSequenceFunction[Qn, n] // FunctionExpand 
$\endgroup$
5
  • $\begingroup$ Well, I agree with the results you got. It also reminded me that I forgot to add the index $n$ to the coefficients. Nevertheless, what I want to achieve is really a code returning the recurrence relation for the coefficients of known solution form. $\endgroup$
    – N.D
    Commented Feb 17 at 9:27
  • $\begingroup$ Your integralequation is the recurrence equation for ` Q`, my answer gives the explicit solution. $\endgroup$ Commented Feb 17 at 9:29
  • $\begingroup$ ... alfa[i,n]=1/n! DiscreteDelta[i,n] $\endgroup$ Commented Feb 17 at 9:36
  • $\begingroup$ Indeed you gave the explicit solution. Thank you for that. Then I thought I made it clear in the description that I would love to write a code that gives the recurrence relation for the $\alpha_{i,n}$s. It is really a problem of expression simplification as far as I can see, and that is why this tag was added. Surely one can deduce the formulae in your comment once they have the explicit result. But this is human input and this is not what I am looking for. $\endgroup$
    – N.D
    Commented Feb 17 at 9:36
  • $\begingroup$ FindSequenceFunction[Qn, n] // FunctionExpand gives: (E^(k X) X^(-1 + n))/Gamma[n]. $\endgroup$ Commented Feb 17 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.