<blockquote>
<p>Given the following debt model, first order linear ODE.</p>
<ul>
<li><span class="math-container">$\frac{dD}{dt} - rD = -A$</span></li>
</ul>
<p>We had to show that the solution looked like:</p>
<ul>
<li><span class="math-container">$D(t) = D(0)e^{rt} + \frac{A}{r}(1 - e^{rt})$</span></li>
</ul>
</blockquote>
<p>let us solve the differential equation in this problem without using definite integrals:
<span class="math-container">$$\begin{eqnarray}
\frac{dD}{dt}=rD-A\\
\int\frac{dD}{rD-A}=\int dt \tag{1}\\
\frac{\ln|rD-A|}{r}=t+k \quad&amp; \text{where k is the integration constant}\\
\ln|rD-A|=rt+kr \\
D(t)=\frac{Ce^{rt}+A}{r} \quad &amp; \text{where }C\text{ is a constant}\\
\end{eqnarray}$$</span></p>
<p>solving for <span class="math-container">$C$</span> using the initial value condition <span class="math-container">$D=D(0)$</span>:<span class="math-container">$\quad C=rD(0)-A$</span>.</p>
<p>Thus, <span class="math-container">$$D(t)=D(0)e^{rt}+\frac{A}{r}(1-e^{rt})$$</span></p>
<p>Now let me modify <span class="math-container">$(1)$</span> to include definite integrals:
<span class="math-container">$$\begin{eqnarray}
&amp; \int_{D(0)}^{D(T)}\frac{dD}{rD-A}=\int_{t=0}^{t=T}dt \tag{2}\\
&amp; D(T)=D(0)e^{rT}+\frac{A}{r}\left(1-e^{rT}\right)
\end{eqnarray}$$</span></p>
<p>We see that method prescribed by your test solutions works for the Debt model as well. Let us see why.</p>
<p>The LHS of <span class="math-container">$(2)$</span> shows us the difference between the total debts from <span class="math-container">$t=0$</span> to <span class="math-container">$t=T$</span>. On the other hand, the RHS shows us the change in time, which is just equal to <span class="math-container">$T$</span>. In other words, <span class="math-container">$(2)$</span> gives us a relationship between the total time that has elapsed and the total debt at time <span class="math-container">$t=T$</span> (i.e., <span class="math-container">$D(T)$</span>) given the initial debt <span class="math-container">$D(0)$</span>. This is exactly what we have found when we used the technique without definite integrals.</p>

CC BY-SA 4.0
2023-04-30T16:16:12.690Z
Wow thanks for writing all this! I will finish reviewing later. I realised I actually solved the first indefinite integral as a linear equation with the integrating factor $e^{-rt}$ this would also have ben valid right? I'm not sue why I didn't spot it was separable!
CormJack
CC BY-SA 4.0
2023-04-30T16:27:55.340Z
Yes, it can also be solved in the way you suggested, although variable separable is simpler to solve. If you are studying ODE you can check out Differential Equations by S.L. Ross, but I don't think it contains many(if at all) economic applications
mynameparv
CC BY-SA 4.0
2023-04-30T16:28:58.730Z
Something interesting that I've spotted is that because you solved this as a separable equation, you'll note your general solution is a bit different, and so your arbitrary constant is written differently to mine. But then because the arbitrary constant and the initial solution are written a bit different. When you put them back together you do in fact get the same general solution in terms of D(0). This I suppose is good validation that both methods work as intended. And after all the constant is arbitrary.
CormJack
CC BY-SA 4.0
2023-04-30T16:33:13.027Z
I've also discovered why I couldn't get the debt model to work. Because I was solving it using the integrating factor method I was trying to calculate: $\begin{align}\int_{D(0)}^{D(T)}- Ae^{-rt}dt\end{align}$
CormJack
CC BY-SA 4.0
2023-04-30T16:35:11.987Z
Your answer is actually so helpful thank you!!!!
CormJack
CC BY-SA 4.0
2023-04-30T16:39:47.243Z
Glad I was able to help you :)
mynameparv
CC BY-SA 4.0
2023-04-30T16:40:30.217Z
I looked at some of your other questions too, interesting stuff. What are you self studying for if you don't mind me asking?
CormJack
CC BY-SA 4.0
2023-04-30T16:48:20.160Z
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/145700/discussion-between-mynameparv-and-cormjack).
mynameparv
CC BY-SA 4.0
2023-04-30T16:11:51.003Z
2023-04-30T16:11:51.003Z
mynameparv
<p><em>Update. I'm reordering this post to make the core question more clear.</em></p>
<p>Given the following problem:</p>
<blockquote>
<p><strong>Infection model:</strong> The number of people <span class="math-container">$N(t)$</span> affected by a pandemic at time <span class="math-container">$t$</span> is modelled by the differential equation. Where <span class="math-container">$r$</span> and <span class="math-container">$c$</span> are positive constants.</p>
<p><span class="math-container">$\frac{dN}{dt} = r(1-c^{-1}N)N$</span></p>
<p>Which we had to show had a solution such that:</p>
<p><span class="math-container">$e^{-rt} = \frac{N(t)^{-1} - c^{-1}}{N(0)^{-1} - c^{-1}}$</span></p>
</blockquote>
<p>Why is the approach below using a definite Integral valid? The partial fractions and actual integration mechanics is fine. I just mean the method of turning this into a definite integral.</p>
<p><span class="math-container">$\begin{align}\int_{N(0)}^{N(T)}\frac{c^{-1}}{1-c^{-1}N}dN + \int_{N(0)}^{N(T)}\frac{1}{N} dN = \int_0^Trdt \end{align}$</span></p>
<p><strong>Additional Context</strong></p>
<p>Using the example question above, and one other example, both taken from past exam papers. I show they can be solved using a method that seemed more obvious.</p>
<p>However i believe the definite integral method shown above, only seems to make sense for the infection model example. Therefore i want to understand:</p>
<ol>
<li>Under what conditions it makes sense to do this definite integral method, why it works, and what the intuition of knowing to do this would be? Particularly  concerning the range of integration.</li>
<li>I don't think this would have worked for the first example below (debt model)? If that's the case why is it applicable to one scenario and not the other.</li>
</ol>
<p><strong>Example 1: Debt model</strong></p>
<blockquote>
<p>Given the following debt model, first order linear ODE.</p>
<ul>
<li><span class="math-container">$\frac{dD}{dt} - rD = -A$</span></li>
</ul>
<p>We had to show that the solution looked like:</p>
<ul>
<li><span class="math-container">$D(t) = D(0)e^{rt} + \frac{A}{r}(1 - e^{rt})$</span></li>
</ul>
</blockquote>
<p>We solve for the general solution using our integrating factor then solve for the arbitrary constant <span class="math-container">$C$</span> which gives <span class="math-container">$C = D(0) - \frac{A}{r}$</span>, plug this in and rearrange giving the desired result.</p>
<ul>
<li><em>Brief experimentation suggested it wasn't obvious that the definite integral approach would have work here? Would it?</em></li>
</ul>
<p><strong>Example 2: (Infection model)</strong></p>
<p><em>This is the question where the solution used a definite integral</em></p>
<blockquote>
<p>The number of people <span class="math-container">$N(t)$</span> affected by a pandemic at time <span class="math-container">$t$</span> is modelled by the differential equation. Where <span class="math-container">$r$</span> and <span class="math-container">$c$</span> are positive constants.</p>
<p><span class="math-container">$\frac{dN}{dt} = r(1-c^{-1}N)N$</span></p>
<p>Which we had to show had a solution such that:</p>
<p><span class="math-container">$e^{-rt} = \frac{N(t)^{-1} - c^{-1}}{N(0)^{-1} - c^{-1}}$</span></p>
</blockquote>
<p>Now this can be solved the same method as the debt model  in example 1 (with a decent amount of algebra), in this case integrating the separable differential equation using partial fractions. The arbitrary constant we get is <span class="math-container">$C' = \frac{-N(0)}{N(0)-c}$</span></p>
<p>Plugging back in and rearranging gives the desired result.</p>

CC BY-SA 4.0
2023-04-30T12:06:04.210Z
From what I can understand the method prescribed by your test solutions automatically gives you the solution to the initial value problem, this is why there are indefinite integrals involved. Also, the method works for the debt model, I was able to show what is required using the method.
mynameparv
CC BY-SA 4.0
2023-04-30T12:13:00.183Z
I'll try to think of an intuitive explanation of why and how we can use indefinite integration to directly solve for the initial value problem
mynameparv
CC BY-SA 4.0
2023-04-30T16:05:08.937Z
I would love that, I too was able to show the answer once I started with the definite integral, but I don't think I would have thought to start with the definite internal. that initial step is what I would love your intuitive answer on!
CormJack
CC BY-SA 4.0
2023-04-30T16:05:55.303Z
Ahhh okay that's very interesting that you made it work with the debt model. I will try a bit harder then!
CormJack
CC BY-SA 4.0
2023-04-30T16:07:52.510Z
Do you think the method would always work?
CormJack
CC BY-SA 4.0
2023-04-30T16:15:20.890Z
I have posted an answer showing how it worked for the debt model and the intuition behind it. My explanation might not be clear and can have some mistakes, so feel free to point out any fallacies you encounter in my answers.
mynameparv
CC BY-SA 4.0
2023-04-30T16:20:32.770Z
Honestly, I'm not sure if it would always work with certainty as I lack the mathematical expertise required to make that claim. But I feel like for simple ODE models like these it should work.
mynameparv
<macroeconomics><mathematical-economics>
Definite Integral technique for Differential Equation
CormJack
# Definite Integral technique for Differential Equation

(Asked by: username_0 on 2023-04-29)

*Update. I'm reordering this post to make the core question more clear.*

Given the following problem:

> **Infection model:** The number of people $N(t)$ affected by a pandemic at time $t$ is modelled by the differential equation. Where $r$ and $c$ are positive constants.
>
> $\frac{dN}{dt} = r(1-c^{-1}N)N$
>
> Which we had to show had a solution such that:
>
> $e^{-rt} = \frac{N(t)^{-1} - c^{-1}}{N(0)^{-1} - c^{-1}}$

Why is the approach below using a definite Integral valid? The partial fractions and actual integration mechanics is fine. I just mean the method of turning this into a definite integral.

$\begin{align}\int\_{N(0)}^{N(T)}\frac{c^{-1}}{1-c^{-1}N}dN + \int\_{N(0)}^{N(T)}\frac{1}{N} dN = \int\_0^Trdt \end{align}$

**Additional Context**

Using the example question above, and one other example, both taken from past exam papers. I show they can be solved using a method that seemed more obvious.

However i believe the definite integral method shown above, only seems to make sense for the infection model example. Therefore i want to understand:

1. Under what conditions it makes sense to do this definite integral method, why it works, and what the intuition of knowing to do this would be? Particularly concerning the range of integration.
2. I don't think this would have worked for the first example below (debt model)? If that's the case why is it applicable to one scenario and not the other.

**Example 1: Debt model**

> Given the following debt model, first order linear ODE.
>
> * $\frac{dD}{dt} - rD = -A$
>
> We had to show that the solution looked like:
>
> * $D(t) = D(0)e^{rt} + \frac{A}{r}(1 - e^{rt})$

We solve for the general solution using our integrating factor then solve for the arbitrary constant $C$ which gives $C = D(0) - \frac{A}{r}$, plug this in and rearrange giving the desired result.

* *Brief experimentation suggested it wasn't obvious that the definite integral approach would have work here? Would it?*

**Example 2: (Infection model)**

*This is the question where the solution used a definite integral*

> The number of people $N(t)$ affected by a pandemic at time $t$ is modelled by the differential equation. Where $r$ and $c$ are positive constants.
>
> $\frac{dN}{dt} = r(1-c^{-1}N)N$
>
> Which we had to show had a solution such that:
>
> $e^{-rt} = \frac{N(t)^{-1} - c^{-1}}{N(0)^{-1} - c^{-1}}$

Now this can be solved the same method as the debt model in example 1 (with a decent amount of algebra), in this case integrating the separable differential equation using partial fractions. The arbitrary constant we get is $C' = \frac{-N(0)}{N(0)-c}$

Plugging back in and rearranging gives the desired result.

**Tags:** macroeconomics, mathematical-economics
> **Comments:**
> **username_1**: From what I can understand the method prescribed by your test solutions automatically gives you the solution to the initial value problem, this is why there are indefinite integrals involved. Also, the method works for the debt model, I was able to show what is required using the method.  
> **username_1**: I'll try to think of an intuitive explanation of why and how we can use indefinite integration to directly solve for the initial value problem  
> **username_0**: I would love that, I too was able to show the answer once I started with the definite integral, but I don't think I would have thought to start with the definite internal. that initial step is what I would love your intuitive answer on!  
> **username_0**: Ahhh okay that's very interesting that you made it work with the debt model. I will try a bit harder then!  
> **username_0**: Do you think the method would always work?  
> **username_1**: I have posted an answer showing how it worked for the debt model and the intuition behind it. My explanation might not be clear and can have some mistakes, so feel free to point out any fallacies you encounter in my answers.  
> **username_1**: Honestly, I'm not sure if it would always work with certainty as I lack the mathematical expertise required to make that claim. But I feel like for simple ODE models like these it should work.  

---

## 1 answers

### Answer by username_1 on 2023-04-30. Score: 1 | Accepted answer

> Given the following debt model, first order linear ODE.
>
> * $\frac{dD}{dt} - rD = -A$
>
> We had to show that the solution looked like:
>
> * $D(t) = D(0)e^{rt} + \frac{A}{r}(1 - e^{rt})$

let us solve the differential equation in this problem without using definite integrals:
$$\begin{eqnarray}
\frac{dD}{dt}=rD-A\\
\int\frac{dD}{rD-A}=\int dt \tag{1}\\
\frac{\ln|rD-A|}{r}=t+k \quad& \text{where k is the integration constant}\\
\ln|rD-A|=rt+kr \\
D(t)=\frac{Ce^{rt}+A}{r} \quad & \text{where }C\text{ is a constant}\\
\end{eqnarray}$$

solving for $C$ using the initial value condition $D=D(0)$:$\quad C=rD(0)-A$.

Thus, $$D(t)=D(0)e^{rt}+\frac{A}{r}(1-e^{rt})$$

Now let me modify $(1)$ to include definite integrals:
$$\begin{eqnarray}
& \int\_{D(0)}^{D(T)}\frac{dD}{rD-A}=\int\_{t=0}^{t=T}dt \tag{2}\\
& D(T)=D(0)e^{rT}+\frac{A}{r}\left(1-e^{rT}\right)
\end{eqnarray}$$

We see that method prescribed by your test solutions works for the Debt model as well. Let us see why.

The LHS of $(2)$ shows us the difference between the total debts from $t=0$ to $t=T$. On the other hand, the RHS shows us the change in time, which is just equal to $T$. In other words, $(2)$ gives us a relationship between the total time that has elapsed and the total debt at time $t=T$ (i.e., $D(T)$) given the initial debt $D(0)$. This is exactly what we have found when we used the technique without definite integrals.

> **Comments:**
> **username_0**: Wow thanks for writing all this! I will finish reviewing later. I realised I actually solved the first indefinite integral as a linear equation with the integrating factor $e^{-rt}$ this would also have ben valid right? I'm not sue why I didn't spot it was separable!  
> **username_1**: Yes, it can also be solved in the way you suggested, although variable separable is simpler to solve. If you are studying ODE you can check out Differential Equations by S.L. Ross, but I don't think it contains many(if at all) economic applications  
> **username_0**: Something interesting that I've spotted is that because you solved this as a separable equation, you'll note your general solution is a bit different, and so your arbitrary constant is written differently to mine. But then because the arbitrary constant and the initial solution are written a bit different. When you put them back together you do in fact get the same general solution in terms of D(0). This I suppose is good validation that both methods work as intended. And after all the constant is arbitrary.  
> **username_0**: I've also discovered why I couldn't get the debt model to work. Because I was solving it using the integrating factor method I was trying to calculate: $\begin{align}\int_{D(0)}^{D(T)}- Ae^{-rt}dt\end{align}$  
> **username_0**: Your answer is actually so helpful thank you!!!!  
> **username_1**: Glad I was able to help you :)  
> **username_0**: I looked at some of your other questions too, interesting stuff. What are you self studying for if you don't mind me asking?  
> **username_1**: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/145700/discussion-between-mynameparv-and-cormjack).  

---

