Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ClearAll[p, b];
- $Assumptions = {b > 0};
- p[m_, n_] := p[n, m] = If[ m < 1 || n < 1 || n > m + 1, 0 # &,
- Module[{s}, Integrate[Exp[(# - s) b n]
- (KroneckerDelta[m, 1] KroneckerDelta[n, 2] b
- + b n p[m, n + 1][s] + If[m < 2, 0,
- b n (n - 1) (p[m - 1, n - 2][s] + p[m - 1, n - 1][s]
- +p[m - 1, n][s])]),
- {s, 0, #}] &]];
- In[5]:= p[5, 6][t] // AbsoluteTiming
- Out[5]= {83.3974,
- 15 + 86 E^(b t) - 47350 E^(5 b t) + 5034 E^(6 b t) +
- 3240 E^(3 b t) (34 + 15 b t) + 10 E^(2 b t) (361 + 30 b t) +
- 5 E^(4 b t) (-14311 + 21216 b t)}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement