# Definite Integral technique for Differential Equation

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$$

$$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}

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$$

$$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.

• 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. Apr 30 at 12:06
• 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 Apr 30 at 12:13
• 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! Apr 30 at 16:05
• Ahhh okay that's very interesting that you made it work with the debt model. I will try a bit harder then! Apr 30 at 16:05
• Do you think the method would always work? Apr 30 at 16:07

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.

• 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! Apr 30 at 16:16
• 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 Apr 30 at 16:27
• 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. Apr 30 at 16:28
• 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} Apr 30 at 16:33