3
$\begingroup$

I am curious and confused about the solution of this integral. $$\int_{t}^{T}(1-e^{\alpha(s-T)})e^{\alpha(t-s)}ds$$

When I use Mathematica with this code

ClearAll["Global`*"]
Integrate[(1 - Exp[α (s - T)])*Exp[α (t - s)], {s, t, 
  T}, Assumptions -> 0 <= t <= T, Assumptions -> α > 0]  

the output is

(1 + E^((t - T) α) (-1 + t α - T α))/α

but apparently the solution to the integral should be $$\frac{1}{\alpha}(1-e^{\alpha(t-T)})^2$$ What am I doing wrong?

$\endgroup$
4
  • 4
    $\begingroup$ Mathematica's result is correct. $\endgroup$
    – Nasser
    Commented Jun 15, 2022 at 12:28
  • $\begingroup$ Thank you but I don't understand the difference with this question. Could you please help? $\endgroup$
    – user86971
    Commented Jun 15, 2022 at 12:32
  • 2
    $\begingroup$ I'm pretty sure that the answer to the linked question on Math.SE is the solution for the recursion relation $f_n(t)=\int_{t}^{T}f_{n-1}(\color{red}{t})e^{\alpha(t-s)}ds$, not $f_n(t)=\int_{t}^{T}f_{n-1}(\color{red}{s})e^{\alpha(t-s)}ds$ as requested. $\endgroup$ Commented Jun 15, 2022 at 14:50
  • $\begingroup$ @MichaelSeifert Oh now I see where the mismatch is coming from. Thank you very much for pointing this out. $\endgroup$
    – user86971
    Commented Jun 15, 2022 at 14:53

2 Answers 2

7
$\begingroup$

To check the Mma result (which is not absolutely straightforwardly here) let us first get the indefinite integral:

Integrate[(1 - Exp[α (s - T)])*Exp[α (t - s)], s, 
  Assumptions -> {α > 0, 0 <= t <= T, T > 0, t > 0}] // 
 Simplify[#, {α > 0, 0 <= t <= T, T > 0, t > 0}] &

(*  -((E^((-s + t) α) + E^((t - T) α) s α)/α)   *)

To better visualize it I show also the image:

enter image description here

Let us make sure that it is right:

D[-((E^((-s + t) α) + 
    E^((t - T) α) s α)/α), s] // 
 Simplify[#, {α > 0, 0 <= t <= T, T > 0, t > 0}] &

(*  E^((-s + t) α) - E^((t - T) α)  *)

enter image description here

which is equal to your original function:

(1 - Exp[α (s - T)])*Exp[α (t - s)] // 
 Simplify[#, {α > 0, 0 <= t <= T, T > 0, t > 0}] &

(*  E^((-s + t) α) - E^((t - T) α)  *)

Now, let us apply the Newton-Leibnitz theorem directly:

(-((E^((-s + t) α) + 
      E^((t - T) α) s α)/α) /. 
    s -> T) - (-((
     E^((-s + t) α) + 
      E^((t - T) α) s α)/α) /. s -> t) // 
 Simplify[#, {α > 0, 0 <= t <= T, T > 0, t > 0}] &

(* (1 + E^((t - T) α) (-1 + t α - T α))/α  *)

enter image description here

You can make sure that the result is equal to that obtained by Mma for the definite integral

Integrate[(1 - Exp[α (s - T)])*Exp[α (t - s)], {s, t, 
   T}, Assumptions -> {α > 0, 0 <= t <= T, T > 0, t > 0}] // 
 Simplify[#, {α > 0, 0 <= t <= T, T > 0, t > 0}] &

(*  (1 + E^((t - T) α) (-1 + t α - T α))/α  *)

Thus, as @Nasser wrote in his comment, Mma gives the right result.

Have fun!

$\endgroup$
2
  • $\begingroup$ By the Newton-Leibniz theorem do you mean the Barrow Theorem? $\endgroup$
    – Michael E2
    Commented Jun 15, 2022 at 14:00
  • $\begingroup$ @MichaelE2 I mean this: ru.wikipedia.org/wiki/… $\endgroup$ Commented Jun 15, 2022 at 15:33
3
$\begingroup$

Rewrite: Initial post had a blunder.

This appears to be the answer:

f[n_] := α^(1-n) - (α^(1-n) Gamma[n, (T-t) α]) / Gamma[n];

It agrees with the first sixteen terms:

assum = (0 <= t <= s <= T) && α > 0 && n > 0 && 
   n ∈ Integers;
foo = NestList[
    Integrate[(# /. t -> s)*Exp[α (t - s)], {s, t, T}, 
      Assumptions -> assum] &,
    (1 - Exp[α (t - T)]),
    15]; // AbsoluteTiming
(*  {127.602, Null}  *)

foo - Table[f[n], {n, Length@foo}] // FunctionExpand // 
 FullSimplify[#, assum] &
(*  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}  *)

Proof left as an exercise.

$\endgroup$
0

Your Answer

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