Introduction to Differential Equations

We now come to one of the most widely-used areas in all of mathematics: differential equations. Of course, you may go on to take an entire course (or several) in differential equations, but we've gotten to the point where we can discuss them, and I believe that the more you see of these before going into those courses, the more prepared you'll be. The natural first question, of course, is: what is a differential equation? As the name suggests, it's an equation involving a derivative. For instance, y=yy' = y is a differential equation.

We can use this simple example to get an idea of our goal. Notice, first of all, that the equation involves yy and its derivative, so yy must be a function. Therefore, there's an implied independent variable (usually xx or tt). Also, notice that all we're given is a relationship between this function and its derivative; we're not told explicitly what the function is. This brings us to our goal: our goal is to figure out what this function is. In Calc I, we were given a function and asked to find its derivative. In Calc II, much of our effort has been spent in reversing this process; given a derivative, we integrate to find the function. A differential equation is related, but it's different than either: here we're not given the function or its derivative, but rather a relationship between them, and we want to find the function y.y.

I should warn you of a common rookie mistake: you might be tempted to do the following: y=yy dy=y dyy=12y2+C{\color{red} \begin{aligned} y' &= y\ \int y' \ dy &= \int y \ dy\ y &= \dfrac{1}{2}y^2 + C \end{aligned}}

Although this actually looks similar to a method that we'll see later for solving differential equations, it's not valid. Can you spot the error? Notice that in doing this, we tried to integrate with respect to y,y, which of course is wrong, since yy is an unknown function of xx (or possibly t,t, but what we name the independent variable is irrelevant). Thus, we cannot integrate with respect to y,y, making this integral meaningless. I caution you to avoid this mistake.

Solution to this example

What, then, is this function yy? You may have spotted the answer already, but if not, let me rephrase the problem: what function y(x)y(x) is equal to its derivative? The answer should be clear now; the only function that works is the exponential function. If y=ex,y=e^x, then y=ex,y'=e^x, so y=yy'=y. In fact, the general solution (we'll get to specific solutions later) to this problem is y=Cex.y = Ce^x.

When we get to actually solving differential equations later, we want to take advantage of the fact that we can (as we did here) check our answer by plugging it back into the differential equation and verifying it.

Applications

In general, we don't study differential equations for their own sake (although I must confess that I find them to be very fun), but rather because they are tremendously applicable. Whenever you study something that you'd like to model, and you find something out about how it is changing over time, there's a differential equation buried there. To illustrate this, I'll go through a few examples, showing differential equations that are associated with different applications. I'll give you the solutions for some, but for others we'll simply make a few observations. Don't worry if this isn't perfectly clear at the moment; if you'd like, you can come back and reread this section after you've gotten more comfortable with differential equations. No doubt it will be clearer then.

Population Models

Suppose we want to measure some population over time. This could be the population of a city, a country, the world, or the population of deer in a forest. Let's call this unknown function P(t).P(t). One simple observation we can make is that the rate of change of the population depends on the size of the population, because a larger population will have more offspring and thus grow faster.

Simple Model

A simple model assumes that the rate of change of the population is simply proportional to the size of the population (thus, it equals a constant multiple of the population size): P=kPP' = kP

Clearly, if kk is positive, the rate of change is positive, so the population is increasing; if kk is negative, the population is shrinking. Without going into how to solve this one (that will come in later sections), I'll tell you that the solution is P(t)=CektP(t) = Ce^{kt}

We can check this: P(t)=CektP=kCekt=kPP(t) = Ce^{kt} \longrightarrow P' = kCe^{kt} = kP

Exponential population model

This model is a good place to start, but it's far too simplistic to be of long-term use; looking at the graph above, it is clear that this model predicts that the population will increase without bound, which ingnores the presence of limiting factors. In reality, limited resources will lead to a slowing in the growth of the population.

Better (more complicated) Model

Let's take a look at a slightly more complicated model of population growth. This one will take these limitations into account: P=aP(1kP)P' = aP(1-kP) for some positive constants aa and k.k.

We won't see the details of the solution to this one, for sake of simplicity at this stage, but we can make one observation: we can see when the population will be growing and when it will be shrinking. Since a,a, k,k, and PP are all positive, PP' will be positive as long as 1kP1−kP is positive, and PP' will be negative when 1kP1−kP is negative. Rearranging terms to solve for PP: 1kP>01>kPP<1k1-kP > 0 \longrightarrow 1 > kP \longrightarrow P < \dfrac{1}{k}

Therefore, whenever the population is below a certain point (1/k1/k to be precise), the population is growing, but if the population is higher than that point, it will shrink. If the population is exactly equal to that value, PP' will equal 00, so the population will remain unchanged.

Logistic population model

For example, in the graph above, this limiting value is 100.100. If the population starts below this value, it increases toward it; if the population starts above it, it decreases to this limit. In other words, this is the natural population level for this habitat.

Newton's Law of Cooling

Suppose you leave a hot cup of coffee on a counter; you know that the cup will cool down, but it will only cool to the temperature of its surroundings (we'll call this Tm,T_m, where mm stands for the medium, another word for surroundings). This represents the limiting value, similar to the limiting population value in the model above. Specifically, Newton's Law of Cooling looks like T=k(TTm),T'=−k(T−T_m), where kk is some positive constant (note: some people write this model without the negative sign, and let kk be a negative constant).

Here again, I'll show you the solution without describing how we find it (that'll have to wait until we have some methods for solving diff eq). The solution is T(t)=Tm+(T0Tm)ekt,T(t)=T_m+(T_0−T_m)e^{−kt}, where T0T_0 is the initial temperature. Let's check the solution; this can be hard to keep track of algebraically, but we'll do so by finding TT' and k(TTm),−k(T−T_m), and showing that these are equal. T=k(T0Tm)ektk(TTm)=k[(Tm+(T0Tm)ektTm]=k(T0Tm)ekt    T=k(TTm)\begin{aligned} T' &= −k(T_0−T_m)e^{−kt}\ −k(T−T_m) &= −k[(T_m+(T_0−T_m)e^{−kt}−T_m]=−k(T_0−T_m)e^{−kt}\ \implies T' &= −k(T-T_m) \end{aligned}

Spread of Epidemics

One model for measuring the spread of epidemics tracks the members of the population who are infected and those who are susceptible (including the infected). Obviously, there are many complexities that can be added, from whether someone who survives can be re-infected or develops an immunity to whether or not a vaccine exists. However, our simple model assumes that the number of infected changes in proportion to the product of those who are and those who aren't but could be: I=rI(SI),I'=rI(S−I), where rr is the rate of infection.

Newton's Second Law of Motion

Recall: Newton's Second Law of Motion states that the force on an object is proportional to the acceleration of that body, where the constant of proportionality is its mass (as long as mass is constant): F=maF = ma

Consider a simple vibration model (like a car's suspension). There are three basic components to this model: a mass, a spring, and a damper. The damper (a shock) behaves like a simple bicycle pump: if you've ever used one, it shouldn't be surprising that the force on the damper is proportional to the speed with which it is traveling (xx'). And we've already seen that the spring force is proportional to the displacement x.x. Therefore, according to Newton's Second Law, the sum of the damper force, spring force, and possibly some external force equal the mass times acceleration: cxkx+f(t)=mx.−cx'−kx+f(t)=mx''.

Note that the spring and damper forces are both negative, since they both act in opposition to the motion.

Rearranging the terms: mx+cx+kx=f(t).mx''+cx'+kx=f(t).

This is the first example we've seen of a second-order differential equation; this one involves the second derivative of x.x. At the end of this unit, we'll learn how to solve second-order equations like this one.

Mass-spring-damper system

General Features

In general, a differential equation involves an unknown function (or several) and its (or their) derivative(s). The highest-order derivative in the equation gives the order of the diff eq (meaning that all of the examples in this section except for the last were first order). Although we'll learn some methods to solve simple diff eq, you should know that the majority of these equations do not yield to these analytical methods. We'll shortly get to other ways of analyzing differential equations that we can't explicitly solve.

Our goal is to find this unknown function, or if that isn't possible, to analyze it more qualitatively.

Initial Value Problems

Let's go back to the simple population growth model: P=kPP(t)=Cekt.P'=kP \longrightarrow P(t)=Ce^{kt}.

I pointed out that this solution is the general solution. So what's a specific solution? This general solution is really a family of solutions, where different values of CC give different specific solutions. The key is that the value of this constant can be found if we know the initial value. If the population when t=0t=0 is P(0)=P0P(0) = P_0 then P0=Cek0=C,P_0=Ce^{k \cdot 0}=C, so the specific solution is P(t)=P0ekt.P(t) = P_0e^{kt}.

This is an example of an initial value problem. In general, when we solve a differential equation, we'll find the general solution, which will contain one or more arbitrary constants (specifically, a second order diff eq will have two constants, etc.), and to find a specific solution, we'll need an initial condition like this.