Differential Equations Primer

Topics Overview

Unlike calculus problems the more involved nature of most differential equations problems greatly narrows the range of such problems than can appear on a timed test.  The more common classes of differential equations questions that can be answered quickly include

Separable first order differential equations (which can be solved with a single integration, often followed by the use of initial conditions to find the value of unknown constants)

Specific well-known applications (exponential growth/decay, Newton’s Law of Cooling, mixing problems, logistic population growth (with or without thresholds), mass/spring systems, etc.)

Linear differential equations with constant coefficients

Problems where the properties or general forms of solutions can be determined quickly without knowing the specific solutions

Separable First Order Equations

A first order (i.e. involving only the 1st derivative) separable differential equation is one that can be rewritten in the form F(y) dy=G(x)dx (treating the derivative y'=(dy/dx) as a fraction whose numerator and denominator can be separated).  The solution technique for such an equation is to integrate both sides (using a constant “+C” on only one side). The value of the introduced constant C is usually found by taking a given initial condition, substituting in its x- and y-values, and solving for C.  For example consider the initial value problem y'=(x^2)((y^2)+4), y(0)=2:

({{({{(dy/dx)=(x^2)((y^2)+4)}, {(dy/((y^2)+4))=(x^2)dx}, {∫(1/((y^2)+4))dy=∫(x^2)dx}, {(1/2)(tan^(-1))((y/2))=((x^3)/3)+C}, {x=0, y=2 ⟹  (1/2)(tan^(-1))(2/2)=((0^3)/3)+C}, {C=(1/2)(tan^(-1))(1)=(π/8)}, {(1/2)(tan^(-1))((y/2))=((x^3)/3)+(π/8)}, {(tan^(-1))((y/2))=((2(x^3))/3)+(π/4)}, {(y/2)=tan(((2(x^3))/3)+(π/4))}, {y=2 tan(((x^3)/3)+(π/4))}})}})

Note that when solving a differential equation it may not be easy (or even possible) to solve for y - in these cases typically you would just find the constant C and just leave the equation as-is (an “implicitly defined” solution).

Specific Applications

Exponential growth or decay

Exponential growth or decay happens when the growth (if a quantity increases) or decay (if it decreases) at a rate proportional to the amount present.  This means it satisfies (dy/dt)=k y, with k>0 indicating growth and k<0 indicating decay.  If (Subscript[y, 0]) is the amount present at time 0, then the general solution looks like y=(Subscript[y, 0])(e^(k t)).  Exponential growth exhibits a well-defined “doubling time” (the time interval it takes to grow from any positive value to twice that value; this is independent of the amounts) given by t=((ln(2))/k).  ln(2)≈0.693, so this is the source of the commonly known “rule of 70” in finance (the time it takes an investment to double in size is 70 divided by the interest rate as a percentage; a 2% interest rate doubles in 35 years, etc. -this is as .693≈70%).  If k<0 there is a well defined “half-life” (time it takes for half the material vanish) - this is given by t=((ln(1/2))/k)=-((ln(2))/k).  There is nothing special about doubling/halving - there are well-defined tripling times, quintupling times, etc. (all with their own corresponding formulas).

Newton’s Law of Cooling

Newton’s Law of Cooling states that in common circumstances the heat flow from an object is directly proportional to the temperature difference between the object and its environment.  If y is the temperature and B is the background temperature this becomes the differential equation (dy/dt)=-k(y-B) (the - sign is to ensure heat flows away from hotter objects and towards cooler ones).  This is a separable differential equation and has a general solution type of y=B+c (e^(-k t)), where c is a constant determined by the initial temperature.  Note that as t->∞ we have that y->B, which makes sense (in the long run the object’s temperature becomes that of its environment).

Mixing Problems

A mixing problem is one where you are measuring the amount of something in a solution with a fixed volume.  A new solution enters, is thoroughly mixed, and the mixed solution leaves the container at the same rate (so the overall volume remains unchanged).  The differential equation for a mixing problem has the general form (dy/dt)=IN-OUT, where IN is the amount of material in the incoming solution (per unit time) and OUT is the amount of material leaving per unit time (this is typically a constant times y, as a constant amount of the thoroughly-mixed solution leaves per unit time).  For example if you had a 100L container of fresh water, with an incoming solution of 2 L/min of saline solution of .1kg/L concentration, and an outgoing solution at 2 L/min, the differential equation for the amount y of salt (in kilograms) at any time would be (dy/dt)=IN-OUT=(2L/min)(.1 kg/L)-((2L/min out of tank)/(100L in tank total))y=.2-(1/50)y,y(0)=0.  The differential equation for a mixing problem is always separable and similar to the Newton’s Law of Cooling problem has the property that as t->∞ we have the concentration of the solution in the tank goes to the “incoming” concentration.

Logistic Equations

The logistic differential equation is a population model in which rather than the population blowing up over time there is a natural “carrying capacity” C that the environment can support.  The differential equation is (dy/dt)=k y(C-y), where k>0 (sometimes this is written as (dy/dt)=k y (1-(y/C)), where the carrying capacity C is just factored out of the second term and combined with the constant out front).  This is separable (with general solution for the first form and initial population (Subscript[y, 0]) given by y=((C (Subscript[y, 0]))/((Subscript[y, 0])+(c-(Subscript[y, 0]))(e^(-C k t)))), although it is not worth memorizing this). For any positive initial population (Subscript[y, 0]), the population y->C as t->∞ (always growing but leveling off to C if (Subscript[y, 0])<C and always decaying but leveling off to C if (Subscript[y, 0])>C).

A modified version of the logistic equation includes a population threshold T<C below which the population will die out.  This has the form (dy/dt)=-k y(C-y)(T-y)=k y (C-y)(y-T), where k>0.  This is separable but typically not easily solvable for y after integrating.  For a given positive starting population (Subscript[y, 0]) the long term behavior is that as t->∞, y->({{{, ({{C, (Subscript[y, 0])>T}, {T, (Subscript[y, 0])=T}, {0, (Subscript[y, 0])<T}})}}) .

Mass-Spring Systems

A common application of higher-order differential equations is to model the position of a mass on a spring (typically the position is measured relative to the “rest” position of the mass, where it would hang from the spring if it was not moving).  If the mass is m>0, the experienced friction constant is δ≥0, the spring constant k>0 (which is a measure of how much the spring pulls back when stretched), the initial position and velocity are (Subscript[y, 0]) and (Subscript[v, 0]), and there is no external force, then the position y obeys the initial value problem m y''+δ y'+k y=0, y(0)=0, y'(0)=(Subscript[v, 0]).  This is a linear equation with constant coefficients, and is best solved using the techniques for such equations rather than listing a general formula.  Note that the value for k is not always given explicitly; sometimes it is given by saying the spring stretches a given amount when a given force is applied.  In this case Hooke’s law for an ideal spring states that Force=k×stretch, allowing you to solve for k.

Depending on the relative values of m, δ, and k the position y of the mass over time will fall into one of three general behaviors:

Under-damped - the mass oscillates around its rest point (with the bounces decaying if δ>0).  The solution in this case use terms of the form (e^(-a t))sin(b t) and (e^(-a t))cos(b t), where a > 0.  This happens when the spring is relatively “loose”.

Over-damped - the mass does not exhibit any oscillatory behavior, quickly returning to its rest position.  The solution in this case use terms of the form (e^(-(Subscript[a, 1]) t)) and (e^(-(Subscript[a, 2])t)) where (Subscript[a, 1]),(Subscript[a, 2])>0.  This happens when the spring is relatively “tight”.

Critically damped - the mass does not exhibit oscillatory behavior but its movement is  initially more extreme than in the over-damped case.  In this case the solutions use terms of the form (e^(-a t)) and t (e^(-a t)), where a>0.  Critically damped behavior requires a very specific calibration of the spring constant relative to the mass and friction constants (corresponding to an equation having a double root).

It is worth noting that simple closed electrical circuits containing a capacitor (with capacitance C), a resistance (with value R), and inductor (with inductance L) satisfy a similar equation.  If q is the charge in the capacitor at time t, then L q''+R q'+(1/C)q=0 (this is Kirchhoff’s Loop Law).  However the value ranges for the capacitance C tend to be quite small in practice (on the order of (10^(-6))) so you are less likely to see these on exams where you can’t use a calculator.

Autonomous Differential Equations

A first order differential equation is called autonomous if it can be written in the form (dy/dt)=f(y) - that is, the formula for the derivative only involves the dependent variable and not the independent variable.  So y'=-3y, (dx/dt)=.1x(3-x), and P'=sin(2P+1)+(P^2) are all autonomous equations.  All autonomous equations are separable as (dy/dt)=f(y) can be rewritten as (dy/(f(y)))=dt.  In many cases though the resulting integral will be too difficult to do, particularly on a timed test.  Note that the exponential growth/decay, Newton’s Law of Cooling, mixing problems, and logistic growth differential equations are all autonomous.

Even if an autonomous differential equation can’t be solved exactly sometimes you can figure out some of the properties of the solution.  One of the most important properties is that of equilibrium values - values (Subscript[y, 0]) for which the constant function y=(Subscript[y, 0]) is a solution to the differential equation.  For the equation (dy/dt)=f(y) the equilibrium values are simply those for which f(y)=0 (as the derivative is 0 at those values so there is no change).  So in the differential equation y'=y(2-y)(((y-4))^2), the values 0, 2, and 4 are all equilibrium values.

Equilibrium values can be classified as stable, unstable, and semi-stable:

An equilibrium point y=(Subscript[y, 0]) is called stable if y-values close to (Subscript[y, 0]) (both above and below) get pushed back to (Subscript[y, 0]) by the differential equation (like a marble at the bottom of a bowl - if you push the marble slightly off the bottom, it always moves back to the bottom).

An equilibrium point y=(Subscript[y, 0]) is called unstable if y-values close to (Subscript[y, 0]) (both above and below) get pushed further away (Subscript[y, 0]) by the differential equation (think of a pencil balanced on its point - a tiny push in any direction makes it fall further and further away).

An equilibrium point y=(Subscript[y, 0]) is called unstable if y-values close to (Subscript[y, 0]) get pushed farther away from (Subscript[y, 0]) on one side of it and get pushed back towards (Subscript[y, 0]) on the other side.

The easiest way to classify equilibrium points is to draw a “sign line” for (dy/dt).  (dy/dt)>0 means y is increasing and (dy/dt)<0 means y is decreasing.  For example for  y'=y(2-y)(((y-4))^2) we have

NumberLinePlot[ {x(2-x)(x-4)^2>0,x(2-x)(x-4)^2<0,x(2-x)(x-4)^2==0, False}, {x,-2,6}, Spacings-> {2,-4,2,-1}, PlotLegends->{ "y'>0, y increasing, move to right", "y'<0, y decreasing, move to left","Equilibrium point",""}, PlotStyle->{Directive[Black, Dotted], Directive[Black, Dashed], Directive[Black,PointSize[.03]] , Opacity[0]}, PlotRangePadding-> .1]

Here note that points just below 0 are decreasing/move left/move away from 0 and points just above 0 are increasing/move right/move away from 0 - so 0 is an unstable equilibrium point.   Values just above 2 are decreasing/move left/move back to 2, and values just below 2 are are increasing/move right/move back to 0 - so 2 is a stable equilibrium point.    Values just below 4 are decreasing decreasing/move left/move away from 4, but values just above 4 are decreasing/move left/move back to 4.  So 4 is a semi-stable equilibrium point. 

Note that in the logistic growth with threshold model the carrying capacity C is a stable equilibrium point and the threshold T is an unstable equilibrium point - this helps explain the long-term behavior of y in the model.

Linear Differential Equations with Constant Coefficients

For higher-order equations the type you are most likely to see on an exam are linear equations with constant coefficients.  It is fairly likely that these will be homogeneous as well (right hand side 0), although non-homogeneous ones can show up in relation to mass-spring systems and similar applications (as these related to the idea of resonance).

The Homogeneous Case

An (n^th) order homogeneous linear system with constant coefficients looks like

({{({{(Subscript[a, n])(y^((n)))+(Subscript[a, n-1])(y^((n-1)))}})+...+(Subscript[a, 1])y'+(Subscript[a, 0])y=0}})

where the (Subscript[a, k]) are constants.  These are solved by first finding the related “characteristic equation”, which is the algebraic equation you get by replacing the (k^th) derivative of y with (r^k).  Solving the characteristic equation for r (including complex solutions) tells you the terms that will be used in the solution of the differential equation.  If all of the roots have multiplicity 1 (i.e. no repeated roots), then all of the terms used in the solution directly correspond to the roots via:

({{({{real root r ⟶ (e^(r t))  (r=0 is (e^(0t))=1)}, {conjugate pair a±b i ⟶ (e^(a t))sin(b t) and (e^(a t))cos(b t)  (if a=0, these are just sines/cosines)  }})}})

If a real root r or a complex pair a±b i is repeated, you include both these “base solutions” together with extra ones you form by multiplying them by increasing whole number powers of t (an extra power of t for each time the root is repeated).  So if r=7 is a root of multiplicity 3 then the terms are (e^(7t)), t (e^(7t)), and (t^2)(e^(7t)).  If 2±3i is a root pair with multiplicity 2, the solutions would be (e^(2t))sin(3t), (e^(2t))cos(3t), t (e^(2t))sin(3t), and t (e^(2t))cos(3t).  If r=0 is a root of multiplicity 4, the corresponding terms are 1, t, (t^2), and (t^3).

The full solution for the homogeneous equation is then the general linear combination of the terms produced from the characteristic equation.  For example consider the differential equation (y^((7)))-5(y^((5)))-36(y^((3)))=0.  This is homogenous, 7th order, and has constant coefficients.  Its characteristic equation is (r^7)-3(r^4)-4(r^3)=0.  This factors as (r^3)((r^2)+4)((r^2)-9)=0, so the roots are r=0,0,0,±2i, 3, and -3.  So the solution terms are 1, t, (t^2), sin(2t), cos(2t), (e^(3t)), and (e^(-3t)).  So the general solution is y=(Subscript[c, 1])+(Subscript[c, 2])t+(Subscript[c, 3])(t^2)+(Subscript[c, 4])sin(2t)+(Subscript[c, 5])cos(2t)+(Subscript[c, 6])(e^(3t))+(Subscript[c, 7])(e^(-3t)).  If you have enough initial conditions you could use them to find the values of the unknowns (Subscript[c, k]).

Another example is 2y''+3y'+7y=0.  In this case the characteristic equation is just 2(r^2)+3r+7=0, which has roots -(3/4)±((Sqrt[47])/4)i.  So skipping to the general solution it would be y=(Subscript[c, 1])(e^(-3t/4))sin(((Sqrt[47])/4)t)+(Subscript[c, 2])(e^(-3t/4))cos(((Sqrt[47])/4)t).  Note that the differential equation is one corresponding to a mass-spring system (with mass 2, friction constant 3, and spring constant 7) and our solution corresponds to the underdamped case.   For a homogeneous mass-spring system like this the under/over/critically damped case is determined by the nature of the roots of the quadratic characteristic equation (non-real, distinct real, repeated).

The Non-homogenous Case

It is less likely (but possible) that the equations you see on a timed exam are linear with constant coefficients but not homogeneous (the right-hand side is not 0).  In this case the general form looks like y=(Subscript[y, h])+(Subscript[y, p]), where (Subscript[y, h]) is the general solution to the corresponding homogenous equation (with general coefficients (Subscript[c, 1]), (Subscript[c, 2]), etc.) and (Subscript[y, p]) is a “particular” solution - one that is distinct from the homogenous solution and has specific known coefficients.   If you know the basic form of (Subscript[y, p]), you typically find the values of the coefficients by dumping that form into the differential equation.  You will often get a system of equations in the coefficients you can solve for.  On a timed exam the scope of the particular solution would have to be pretty small (maybe 1 or 2 terms).
 
In general you will only be able to find the form for (Subscript[y, p]) if all of the non-homogenous terms in the equation are those that you would get from solving a homogenous-type problem - powers of t, exponentials (possibly multiplied by powers of t), and exponentials multiplied by sines/cosines (possibly multiplied by powers of t).  In this case the terms of (Subscript[y, p]) are found by:

Step 1: Find the roots of the characteristic equation for the corresponding homogeneous equation (ignoring the right-hand side).
Step 2: Looking at the terms in (Subscript[y, p]), find the roots you would need from a characteristic equation to get them (including multiplicity - so (t^2)(e^(3t)) would need roots 3,3,3).
Step 3: The terms involved in (Subscript[y, p]) are built from the roots in Step 2.  However if there are common roots between Steps 1 and 2, the terms for (Subscript[y, p]) have to be multiplied by a high enough power of t so there is no repetition between the terms of (Subscript[y, h]) and (Subscript[y, p]).

As an example consider the equation y''-7y'+12y=3+t (e^(3t))+sin(2t).  The roots of the characteristic equation (r^2)-7r+12=0 are r=3,4.  So the homogenous solution is (Subscript[y, h])=(Subscript[c, 1])(e^(3t))+(Subscript[c, 2])(e^(4t)).  Looking at the non-homogeneous terms they would have come from the roots 0, 3, 3, and ±2i.  The root 3 shows up in the homogenous and non-homogenous parts, so the non-homogenous terms have to start with t (e^(3t)) to avoid a conflict. So the terms in (Subscript[y, p]) are 1, t (e^(3t)), (t^2)(e^(3t)), sin(2t), and cos(2t).  So the full solution looks like

({{({{y=(Subscript[c, 1])(e^(3t))+(Subscript[c, 2])(e^(4t))+A+B t (e^(3t))}})+C (t^2)(e^(3t))+D sin(2t)+E cos(2t)}})

where A,B, C, D,and E are specific values we have yet to find.  To find them we would dump A+B t (e^(3t))+C (t^2)(e^(3t))+D sin(2t)+E cos(2t) into y''-7y'+12y=3+t (e^(3t))+sin(2t); this would give us a set of 5 equations in 5 unknowns which we could solve.  This would take too long on a timed test, which is why it is unlikely to see a problem of this sort unless it is very small (maybe if the right-hand side was just (e^(2t))) or if the question is about the form of (Subscript[y, p]) rather than needing to know all the specific numbers.

One way these problems might show up is in the case of resonance in a mass-spring problem.  If you apply a variable force F(t) to the mass over time, the mass-spring equation looks like m y''+δ y'+k y=F(t).  If the external forcing function F(t) is chosen in such a way as to make (Subscript[y, h]) and (Subscript[y, p]) have common roots, the extra power(s) of t involved in (Subscript[y, p]) may make the graph of the solution get very large (arbitrarily so if δ=0), which can stretch the spring so far it breaks.