Ordinary Differential Equations/First Order Linear 2

Contents

Remember the population growth problem, where ${\displaystyle {\frac {dP}{dt}}=(B-D)P}$? Now that we can solve linear equations, we can also solve variations where a factor ${\displaystyle f(t)}$ is added in. The new equation is ${\displaystyle {\frac {dP}{dt}}=(B-D)P+f(t)}$, and can be solved by the linear methods taught in the last section.

Immigration

Lets say that 1000 people move into a city, in addition to the normal population growth. This can be interpreted by making ${\displaystyle f(x)=1000}$. This gives us a linear differential equation to solve

${\displaystyle {\frac {dP}{dt}}=kP+1000}$

${\displaystyle {\frac {dP}{dt}}-kP=1000}$

Step 1: Find ${\displaystyle e^{\int P(t)dt}}$

${\displaystyle \int kdt=kt+C}$

${\displaystyle e^{\int P(t)dt}=Ce^{kt}}$

Letting C=1, we get ${\displaystyle e^{kt}}$

Step 2: Multiply through

${\displaystyle e^{kt}P'+e^{kt}P=1000e^{kt}}$

Step 3: Recognize that the left hand is ${\displaystyle {\frac {d}{dt}}e^{\int P(t)dt}y}$

${\displaystyle {\frac {d}{dt}}e^{kt}P=1000e^{kt}}$

Step 4: Integrate

${\displaystyle \int ({\frac {d}{dt}}e^{kt}P)dt=\int 1000e^{kt}dt}$

${\displaystyle e^{kt}P={\frac {1000}{k}}e^{mt}+C}$

Step 5: Solve for y

${\displaystyle P={\frac {1000}{k}}+{\frac {C}{e^{kt}}}}$

See how the answer is a constant addition to the normal solution, as expected.

Hunting

Lets say the government allows 10 animals to be killed a year. This makes ${\displaystyle f(t)=-10t}$. How does this effect the solution?

${\displaystyle {\frac {dP}{dt}}=kP-10t}$

${\displaystyle {\frac {dP}{dt}}-kP=-10t}$

Step 1: Find ${\displaystyle e^{\int P(t)dt}}$

${\displaystyle \int kdt=kt+C}$

${\displaystyle e^{\int P(t)dt}=Ce^{kt}}$

Letting C=1, we get ${\displaystyle e^{kt}}$

Step 2: Multiply through

${\displaystyle e^{kt}P'+e^{kt}P=-10te^{kt}}$

Step 3: Recognize that the left hand is ${\displaystyle {\frac {d}{dt}}e^{\int P(t)dt}y}$

${\displaystyle {\frac {d}{dt}}e^{kt}P=-10te^{kt}}$

Step 4: Integrate

${\displaystyle \int ({\frac {d}{dt}}e^{kt}P)dt=\int -10te^{kt}dt}$

${\displaystyle e^{kt}P={\frac {-10(kx-1)e^{kx}}{k^{2}}}+C}$

Step 5: Solve for y

${\displaystyle P={\frac {-10(kx-1)}{k^{2}}}+{\frac {C}{e^{kx}}}}$

Mixture problems

Imagine we have a tank containing a solution of water and some other substance (say salt). We have water coming into the tank with a concentration ${\displaystyle C_{i}}$, at a rate of ${\displaystyle R_{i}}$. We also have water leaving the tank at a concentration ${\displaystyle C_{o}}$ and rate ${\displaystyle R_{o}}$. We therefore have a change in concentration in the tank of

${\displaystyle {\frac {dx}{dt}}=R_{i}C_{i}-R_{o}C_{o}}$

Thinking this through, ${\displaystyle R_{i}}$, ${\displaystyle C_{i}}$, and ${\displaystyle R_{o}}$ are constants, but ${\displaystyle C_{o}}$ depends on the current concentration of the tank, which is not constant. The current concentration is ${\displaystyle {\frac {x}{V}}}$ where V is the volume of water in the tank. Unfortunately, the volume is changing based on how much water is in the tank. If the tank initially has ${\displaystyle V_{0}}$ volume, the volume at time t is ${\displaystyle V(t)=V_{0}+t(r_{i}-r_{o})}$. This makes the final equation

${\displaystyle x'=R_{i}C_{i}-{\frac {R_{o}x}{V_{0}+t(R_{i}-R_{o})}}}$

which is an obvious linear equation. Lets solve it.

${\displaystyle x'+{\frac {R_{o}x}{V_{0}+t(R_{i}-R_{o})}}=R_{i}C_{i}}$

Step 1: Find ${\displaystyle e^{\int P(t)dt}}$

${\displaystyle \int {\frac {R_{o}}{V_{0}+t(R_{i}-R_{o})}}={\frac {R_{o}ln((R_{i}-R_{o})t+V_{0})}{R_{i}-R_{o}}}+C}$

${\displaystyle e^{\int P(t)dt}=Ce^{\frac {R_{o}ln((R_{i}-R_{o})t+V_{0})}{R_{i}-R_{o}}}=C((R_{i}-R_{o})t+V_{0})^{\frac {R_{o}}{R_{i}-R_{o}}}}$

Letting C=1, we get ${\displaystyle ((R_{i}-R_{o})t+V_{0})^{\frac {R_{o}}{R_{i}-R_{o}}}}$

Step 2: Multiply through

${\displaystyle ((R_{i}-R_{o})t+V_{0})^{\frac {R_{o}}{R_{i}-R_{o}}}x'+((R_{i}-R_{o})t+V_{0})^{\frac {R_{o}}{R_{i}-R_{o}}}{\frac {R_{o}x}{V_{0}+t(R_{i}-R_{o})}}=((R_{i}-R_{o})t+V_{0})^{\frac {R_{o}}{R_{i}-R_{o}}}R_{i}C_{i}}$

Step 3: Recognize that the left hand is ${\displaystyle {\frac {d}{dt}}e^{\int P(t)dt}x}$

${\displaystyle {\frac {d}{dt}}((R_{i}-R_{o})t+V_{0})^{\frac {R_{o}}{R_{i}-R_{o}}}x=((R_{i}-R_{o})t+V_{0})^{\frac {R_{o}}{R_{i}-R_{o}}}R_{i}C_{i}}$

Step 4: Integrate

${\displaystyle \int (((R_{i}-R_{o})t+V_{0})^{\frac {R_{o}}{R_{i}-R_{o}}}x)dt=\int (R_{i}-R_{o})t+V_{0})^{\frac {R_{o}}{R_{i}-R_{o}}}R_{i}C_{i}dt}$

${\displaystyle ((R_{i}-R_{o})t+V_{0})^{\frac {R_{o}}{R_{i}-R_{o}}}x={\frac {C_{i}V_{0}((R_{i}-R_{o})t+V_{0})^{\frac {R_{i}}{V_{0}}}}{(R_{i}-R_{o})}}}$

Step 5: Solve for y

${\displaystyle x={\frac {C_{i}V_{0}((R_{i}-R_{o})t+V_{0})^{\frac {R_{i}}{V_{0}}}}{(R_{i}-R_{o})((R_{i}-R_{o})t+V_{0})^{\frac {R_{o}}{R_{i}-R_{o}}}}}}$

Ugly, isn't it. Most of the time when dealing with real world mixture problems, you'll plug in much earlier and use numbers, which makes it easier to deal with.