Differential Equations Notes

Math 243 - Fall 2025

Jump to: Math 243 homepage, Week 1, Week 2, Week 3, Week 4, Week 5, Week 6, Week 7, Week 8, Week 9, Week 10, Week 11, Week 12, Week 13, Week 14

Week 1 Notes

Day Section Topic
Mon, Aug 25 1.1 Modeling with Differential Equations
Wed, Aug 27 1.2 Separable Differential Equations
Fri, Aug 29 1.3 Geometric and Quantitative Analysis

Mon, Aug 25

We talked about some examples of differential equations.

  1. Exponential Growth/Decay. The rate of change in a variable yy with respect to time tt is proportional to yy itself. dydt=ky.\dfrac{dy}{dt} = k y.
    1. Check that y(t)=Cekty(t) = Ce^{kt} is a solution.
    2. Find the constant CC which satisfies the initial value problem with initial condition y(0)=1000y(0) = 1000.

We talked about dependent and independent variables, the order of a differential equation and how to tell if a function is a solution of a differential equation. We also talked about initial conditions.

  1. Spring-Mass Model. The force FF of a mass mm at the end of a spring can be modeled by Hooke’s Law which says F=kxF = -k x where xx is the displacement of the spring from its rest position. md2xdt2=kx.m\dfrac{d^2 x}{dt^2} = -kx.

    1. Show that x=sintx = \sin t and x=costx = \cos t are two different solutions of the spring equation when m=k=1m = k = 1.
    2. How would the solutions change if mm and kk were not both equal to 1? How would the oscillation of the spring change if the mass was twice as heavy?
    3. How would the spring equation change if there was also a linear drag force F=bdxdtF = -b \frac{dx}{dt}? What if there is a non-linear drag force F=b(dxdt)2F = -b \left(\frac{dx}{dt}\right)^2?

The last question led to a discussion of linear versus non-linear differential equations. It’s usually much harder to solve non-linear equations! We will also study systems of differential equations, like the following.

  1. Rabbits and Foxes. Suppose there are RR rabbits and FF foxes in an ecosystem. The rabbit population would grow exponentially, except for the foxes which prey on the rabbits. The fox population would decay exponentially if there wasn’t food to eat, but as long as they can catch enough rabbits, it will grow. The number of rabbits that are eaten by foxes is proportional to the product RFRF.
    dRdt=aRbRFdFdt=cR+dRF\begin{align*} \dfrac{dR}{dt} &= a R - b RF \\ \dfrac{dF}{dt} &= -c R + d RF \end{align*}

Here is a graph showing these equations as a vector field (with constants a=3,b=4,c=1,d=2a = 3, b = 4, c = 1, d= 2).

  1. Logistic Growth. dPdt=kP(1PN)\dfrac{dP}{dt} = kP \left( 1 - \dfrac{P}{N} \right) where kk is a proportionality constant and NN is the carrying capacity.

    1. Under what circumstances does the population PP stop changing in this model?
    2. What are the units for the constants kk and NN?
    3. Suppose that we use the logistic growth equation to model a population of rabbits in a region. What if we introduce a predator that always consumes bb rabbits per year. How would that change the differential equation above?

Wed, Aug 27

Today we talked about separable equations. We solved the following examples.

  1. Solve dydx=x2y\dfrac{dy}{dx} = - x^2 y.

  2. Solve xy2y=x+1xy^2 y' = x+1. (https://youtu.be/1_Q4kndQrtk)

Not every differential equation is separable. For example: dydx=xy\frac{dy}{dx} = x-y is not separable.

  1. Which of the following differential equations are separable? (https://youtu.be/6vUjGgI8Dso)

    1. xy+y=3xy' + y = 3
    2. 2x+2y+2y1=02x + 2y + 2y' - 1 = 0
    3. y=(x2+x)(y2+y)y' = (x^2+x)(y^2+y)
    4. xdydx+ydydx=xx \dfrac{dy}{dx} + y \dfrac{dy}{dx} = x

We finished with this example:

  1. Newton’s Law of Cooling. The temperature of a small object changes at a rate proportional to the difference between the object’s temperature and its surroundings.

    1. Express Newton’s Law of Cooling as a differential equation.
    2. Is that differential equation separable?
  1. Mixing Problem. Salty water containing 0.02 kg of salt per liter is flowing into a mixing tank at a rate of 10 L/min. At the same time, water is draining from the tank at 10 L/min.

    1. Write a differential equation to model how the amount of salt in the tank changes with respect to time.
    2. Solve the differential equation if the amound of salt in the tank is initially 15 kg. (https://youtu.be/aFfAz9wnoyY)

We didn’t get to this last example in class, but it is a good practice problem.

  1. dydx=4sinx3y2\dfrac{dy}{dx} = \dfrac{4 \sin x}{3 y^2} with initial condition y(0)=2y(0) = 2. (https://youtu.be/cc3qtMBdQlE)

Fri, Aug 29

Today we talked about slope fields.

  1. Sketch the slope field for dydx=xy\dfrac{dy}{dx} = x - y. (https://youtu.be/24pxJ1DuWR8)

Here is a slope field grapher tool that I made a few years ago. You can also use Sage to plot slope fields. Here is an example from the book, with color added.

t, y = var('t, y')
f(t, y) = y^2/2 - t
plot_slope_field(f, (t, -1, 5), (y, -5, 10), headaxislength=3, headlength=3, 
    axes_labels=['$t$','$y(t)$'], color = "blue")
Open example in SageCell
  1. Consider the logistic equation with harvesting. dPdt=kP(1PN)h\dfrac{dP}{dt} = k P \left(1 - \dfrac{P}{N} \right) - h where hh is a number of rabbits that are harvested each year.

    1. If k=1k = 1, N=8N = 8, and h=1.5h = 1.5, then what are the values of PP where dPdt=0\dfrac{dP}{dt} = 0? Slope field
    2. Graph the function y=kx(1xN)h.y =k x \left(1 - \dfrac{x}{N} \right) - h. Where does the graph cross the x-axis? Is the slope positive or negative at those crossing points?

The logistic equation (with or without harvesting) is autonomous which means that the rate of change dPdt\dfrac{dP}{dt} does not depend on time, just on PP. An equilibrium solution for an autonomous differential equation is a solution where y(t)=0y'(t) = 0 for all tt.

  1. In the logistic equation above, what happens to the equilibrium solutions when the rate of harvesting is increased to h=2h = 2 and then to h=2.5h = 2.5? What happens to the slope field? What does that mean about the population of rabbits?

Week 2 Notes

Day Section Topic
Mon, Sep 1 Labor day - no class
Wed, Sep 3 1.7 Bifurcations
Fri, Sep 5 1.6 Existence and Uniqueness of Solutions

Wed, Sep 3

Last time we talked about equilibrium solutions of autonomous equations. An equilibrium y0y_0 for y=f(y)y' = f(y) is stable (also known as a sink or attactor) if any solution with initial value close to y0y_0 converges to y0y_0 as tt \rightarrow \infty. An equilibrium is unstable (also known as a source or repeller) if all solutions move away from y0y_0 as tt \rightarrow \infty.

  1. Consider the ODE y=y(y2)(y+3)y' = y(y-2)(y+3). What are the equilibria for this ODE? Which are stable and which are unstable?
One way to quickly analyze whether equilibria are stable or unstable is to graph f(y)f(y). If y0y_0 is an equilibrium solution and f(y0)<0f'(y_0) < 0, then y0y_0 is stable, and if f(y0)>0f'(y_0) > 0, then y0y_0 is unstable.
  1. What would happen to the number of equilibrium solutions if we replaced y(y2)(y+3)y(y-2)(y+3) by y(y2)(y+3)+5y(y-2)(y+3) + 5?

We talked about the phase line for an autonomous ODE.

  1. Draw different phase lines for the logistic equation with harvesting parameters h=0,1.5,2,2.5h = 0, 1.5, 2, 2.5 y=y(1y8)hy' = y \left( 1 - \frac{y}{8} \right) - h

Suppose that y=fλ(y)y' = f_\lambda(y) is a family of differential equations that depends on a parameter λ\lambda. A bifurcation point is a value of the parameter where the number of equilibrium solutions changes. A bifurcation diagram is a graph that shows how the phase lines change as the value of a parameter changes.

  1. Draw a bifurcation diagram for the differential equation y=λyy2y' = \lambda y - y^2 showing the phase lines when λ=1,0,\lambda = -1, 0, and 11.

You can use Desmos to help with the previous problem. Using xx to represent λ\lambda, you can graph the region where dy/dtdy/dt is positive in blue and the region where dy/dtdy/dt is negative in red. Then it is easier to draw the phase lines in the bifurcation diagram.

Fri, Sep 5

Today we talked about two important theorems in differential equations.

Existence Theorem. Suppose that y=f(t,y)y' = f(t,y) where ff is a continuous function in an open rectangle {(t,y):a<t<b,c<y<d}\{(t,y) : a < t < b, c < y < d \}. For any (t0,y0)(t_0, y_0) inside the rectangle, there exists a solution y(t)y(t) defined on an open interval around t0t_0 such that y(t0)=y0y(t_0) = y_0.

This theorem guarantees that in most circumstances, we are guarantee to have solutions to differential equations. But there are things to watch out for. Solutions might blow up in finite time, so they might not be defined on the whole interval (a,b)(a,b).

  1. Solve the IVP y=y2y' = y^2 with initial condition y(0)=1y(0) = 1. Notice that the function f(t,y)=y2f(t,y) = y^2 is continuous everywhere. But the solution is not.

Uniqueness Theorem. Suppose that y=f(t,y)y' = f(t,y) where both ff and its partial derivative fyf_y are continuous in an open rectangle {(t,y):a<t<b,c<y<d}\{(t,y) : a < t < b, c < y < d \}. Then for any (t0,y0)(t_0,y_0), there exists a unique solution y(t)y(t) defined on an open interval around t0t_0 such that y(t0)=y0y(t_0) = y_0.

If the partial derivative fyf_y is not continuous, then we might not get unique solutions. Here is an example.

  1. Solve the IVP y=y1/3y' = y^{1/3}, with y(0)=0y(0) = 0 using separation of variables. Then show that y(t)=(23t)3/2y(t) = -(\tfrac{2}{3} t)^{3/2} and y(t)=0y(t) = 0 are also valid solutions of this IVP.

One very nice consequence of the uniqueness theorem is this important concept:

No Crossing Rule. If ff and fyf_y are both continuous, then solution curves for the differential equation y=f(t,y)y' = f(t,y) cannot cross.

  1. In our first homework we solved the IVP xy=1y2xy' = \sqrt{1-y^2}, with y(1)=0y(1) = 0. The solution was y=sin(ln(t))y = \sin(\ln(t)). But if you graph the solution with the slope field, there is something wrong! SageCell Plot

This illustrates that a formula for a solution to y=f(t,y)y' = f(t,y) might not apply after we reach a point where fyf_y is no longer continuous.


Week 3 Notes

Day Section Topic
Mon, Sep 8 1.4 Analyzing Equations Numerically
Wed, Sep 10 1.4 Analyzing Equations Numerically - con’d
Fri, Sep 12 1.5 First-Order Linear Equations

Mon, Sep 8

Many ODEs cannot be solved analytically. That means there is no formula you can write down using standard functions for the solution. This is true even when the existence and uniqueness theorems apply. So there might be a solution that doesn’t have a solution you can write down. But you can still approximate the solution using numerical techniques.

Today we introduced Euler’s method which is the simplest method to numerically approximate the solution of a first order differential equation. We used it to approximate the solution to dydt=y22t with initial condition y(1)=0.\dfrac{dy}{dt} = \dfrac{y^2}{2} - t \text{ with initial condition } y(-1) = 0.

from numpy import *
import matplotlib.pyplot as plt

def EulersMethod(f,a,b,h,y0):
    ''' 
    Approximates the solution of y' = f(t, y) on the interval a < t < b with initial 
    condition y(a) = y0 and step size h. 
    Returns two lists, one of t-values and the other of y-values. 
    '''
    t, y = a, y0
    ts, ys = [a], [y0]
    while t < b:
        y = y + f(t,y)*h
        t = t + h
        ts.append(t)
        ys.append(y)
    return ts, ys

f = lambda t,y: y**2 / 2 - t

# h = 1
ts, ys = EulersMethod(f, -1, 5, 1, 0)
plt.plot(ts,ys)
# h = 0.1
ts, ys = EulersMethod(f, -1, 5, 0.1, 0)
plt.plot(ts,ys)
# h = 0.01
ts, ys = EulersMethod(f, -1, 5, 0.01, 0)
plt.plot(ts,ys)
plt.show()

Here’s the output for this code and here is a version with the slope field added.

After demonstrating how to implement Euler’s method in code, we talked about some simpler questions that we can answer with pencil & paper.

  1. Suppose that we want to solve dydx=xy\dfrac{dy}{dx} = x - y with initial condition y(0)=2y(0) = 2. Make a table showing the first three steps using Euler’s method with step size h=1h = 1.

Euler’s method is only an approximation, so there is a gap between the actual y-value at t=bt = b and the Euler’s method approximation. That gap is the error in Euler’s method. There are two sources of error.

As hh gets smaller, the discretization error gets smaller, but the rounding error gets worse.
A worst case upper bound for the error is: ErroreL(ba)1L(Mh2+δh)\text{Error} \le \dfrac{e^{L(b-a)} - 1}{L} \left( \dfrac{Mh}{2} + \dfrac{\delta}{h} \right) where L=max|f(t,y)y|L = \max \left| \frac{\partial f(t,y)}{\partial y} \right|, M=max|y(t)|M = \max |y''(t)|, and δ\delta is the smallest floating point number our computer can accurately represent. Using the standard base-64 floating point numbers, δ1016\delta \approx 10^{-16}. In practice, Euler’s method tends to get more accurate as hh gets smaller until around h107h \approx 10^{-7}. After that point the rounding error gets worse and there is no advantage to shrinking hh further.

Wed, Sep 10

Today I announced Project 1 which is due next Wednesday. I’ve been posting Python & Sage code examples, but if you would rather use Octave/Matlab, here are some Octave code examples.

Runge-Kutta methods are a family of methods to solve ODEs numerically. Euler’s method is a first order Runge-Kutta method, which means that the discretization error for Euler’s method is O(h1)O(h^1) which means that the error is less than a constant times hh to the first power.

Better Runge-Kutta methods have higher order error bounds. For example, RK4 is a popular method with fourth order error O(h4)O(h^4). Another Runge-Kutta method is the midpoint method also known as RK2 which has second order error.

Midpoint Method (RK2). Algorithm to approximate the solution of the initial value problem y(t)=f(t,y)y'(t) = f(t, y) on the interval [a,b][a, b] with initial condition y(a)=y0y(a) = y_0.

  1. Choose a step size hh and initialize variables t=at = a and y=y0y = y_0.
  2. Repeat the following two steps while t<bt < b:
    1. Update y=y+f(t+12h,y+12hf(t,y))y = y + f(t + \tfrac{1}{2}h, y + \tfrac{1}{2} h f(t,y)),
    2. Update t=t+ht = t + h.

In RK2 the slope used to calculate the next point from a point P1P_1 is the slope at the midpoint between P1P_1 and the Euler’s method next step. In RK4, the slope used is a weighted average of the slopes at P1P_1, P2P_2, P3P_3, and P4P_4 shown in the diagram above. Specifically, it is 1/6 of the slopes at P1P_1 and P4P_4 plus 1/3 of the slopes at P2P_2 and P3P_3.

There are even higher order Runge-Kutta methods, but there is a trade-off between increasing the order and increasing complexity.

After we talked about Runge-Kutta methods, we introduced the integrating factors method for solving first order linear ODEs y(t)+f(t)y=g(t).y'(t) + f(t) y = g(t). The key idea is that if F(t)F(t) is an antiderivative of f(t)f(t), then eF(t)e^{F(t)} is an integrating factor for the ODE. Since ddt(eF(t)y(t))=eF(t)y(t)+eF(t)f(t)y(t)\dfrac{d}{dt} \left( e^{F(t)} y(t) \right) = e^{F(t)} y'(t) + e^{F(t)} f(t) y(t) by the product rule, we can re-write the ODE as: ddt(eF(t)y(t))=eF(t)g(t).\dfrac{d}{dt} \left( e^{F(t)} y(t) \right) = e^{F(t)} g(t). Then just integrate both sides to find the solution.

  1. dydt+yt=3t\dfrac{dy}{dt} + \dfrac{y}{t} = 3t

  2. dydx+2y=3\dfrac{dy}{dx} + 2y = 3

Fri, Sep 12

Today we looked at more examples of linear first order ODEs.

  1. Suppose that a 200 gallon tank initially contains a 100 gallons of a saltwater solution at a concentration of 1 gram of salt per gallon. We start adding 5 gallons of saltwater per minute with a concentration of 2 grams per gallon. Meanwhile we let out 3 gallons per minute of well-mixed water from the tank.
  1. Write down an IVP to model this situation using yy to represent the amount of salt in the tank.

  2. Use integrating factors to solve the IVP. (https://youtu.be/b5QWC2DA5l4)

Sometimes it can be faster to use a guess-and-check method instead of integrating factors to solve linear ODEs. Here is an example. Consider the first order linear ODE: dydx+4y=ex.\dfrac{dy}{dx} + 4y = e^{-x}. You might guess that there is a constant AA such that y(t)=Aexy(t) = Ae^{-x} is a solution of this differential equation. This is true!

  1. Find the constant AA by substituting y=Aexy = Ae^{-x} into the differential equation y+4y=exy' + 4y = e^{-x}.

So y(t)=13exy(t) = \tfrac{1}{3} e^{-x} is one particular solution for this ODE. To get all of the solutions, we need some theory:

A first order linear differential equation is homogeneous if it can be put into the form dydt+f(t)y=0.\dfrac{dy}{dt} + f(t) y = 0. Any inhomogeneous equation dydt+f(t)y=g(t)\dfrac{dy}{dt} + f(t) y = g(t) has a general solution y(t)=yp(t)+Cyh(t)y(t) = y_p(t) + C y_h(t) where

  1. Solve the homogeneous ODE y+4y=0y' + 4y = 0, then find the general solution of y+4y=exy' + 4y = e^{-x} by combining the homogeneous solutions with the particular solution we found above.

Week 4 Notes

Day Section Topic
Mon, Sep 15 2.1 Modeling with Systems
Wed, Sep 17 2.2 The Geometry of Systems
Fri, Sep 19 2.4 Solving Systems Analytically

Mon, Sep 15

Consider the inhomogeneous linear ODE: dydt+2y=cost.\dfrac{dy}{dt} + 2y = \cos t. If you know that waves can be modeled by equations of the form Asint+BcostA \sin t + B \cos t, then you might guess that the solution y(t)y(t) might have this form. Then substituting into the equation, we get AcostBsinty+2Asint+2Bcost2y=cost.\underbrace{A \cos t - B \sin t}_{y'} + \underbrace{2A \sin t + 2B \cos t}_{2y} = \cos t.
By combining like terms, we get a system of equations A+2B=12AB=0.\begin{align*} A + 2B &= 1 \\ 2A - B &= 0. \end{align*} The solution is A=15A = \tfrac{1}{5}, B=25B = \tfrac{2}{5} which means that y(t)=15sint+25costy(t) = \tfrac{1}{5} \sin t + \tfrac{2}{5} \cos t is one solution to the ODE.

  1. What is the corresponding homogeneous equation, and what is its solution?

  2. What is the general solution to y+2y=costy' + 2y = \cos t?

  3. Why is the method of integrating factors harder here?

After that, we introduced systems of differential equations. We started with this simple model of a predator-prey system with rabbits RR and foxes FF:

dRdt=2RRFdFdt=5F+RF\begin{align*} \dfrac{dR}{dt} &= 2R - RF \\ \dfrac{dF}{dt} &= -5F + RF \end{align*}

  1. Find an equilibrium solution where both dR/dtdR/dt and dF/dtdF/dt are zero.

A graph of the vector field defined by a system of two differential equations is called a phase plane. Solution curves are parametric functions R(t)R(t) and F(t)F(t) that follow the vector field in the phase plane.

Figure: Example phase plane (Python, Octave)

Converting a 2nd order equation to a system of equations

According to Hooke’s law the force of a spring is md2xdt2=kxm \dfrac{d^2 x}{dt^2} = - k x or equivalently d2xdt2+kmx=0.\dfrac{d^2 x}{dt^2} + \dfrac{k}{m} x = 0. This is a homogeneous 2nd order linear differential equation.

We can convert a second order ODE to a first order system of equations by using an extra variable equal to the first derivative v=xv = x'. Then x=vx'' = v', so we get the system:

dvdt+kmx=0dxdtv=0.\begin{align*} \dfrac{dv}{dt} + \dfrac{k}{m} x &= 0 \\ \dfrac{dx}{dt} - v &= 0. \end{align*}

  1. Convert the 2nd order equation y+y+4y=sinty'' + y' + 4y = \sin t into a 1st order system of equations.

Wed, Sep 17

Today we looked at more examples of systems of ODEs.

Suppose that we have two species that compete for resources and their populations xx and yy satisfy

dxdt=x(1x)αxydydt=y(1y)αxy\begin{align*} \dfrac{dx}{dt} = x(1-x) - \alpha xy \\ \dfrac{dy}{dt} = y(1-y) - \alpha xy \\ \end{align*}

  1. Plot the phase plane for this system when α=2\alpha = 2 and when α=12\alpha = \tfrac{1}{2} (Python). Describe the difference between the equilibrium solutions of the two systems.

Later in chapter 3 we will learn how to classify different types of equilibrium solutions on the phase plane using linear algebra. For now, here is a preview of some of the types of equilibria.

Figure: Types of equilibria for 2D-systems. (Source: Wikipedia)

A simple model used to understand epidemics is the SIR-model, which stands for Susceptible-Infected-Recovered. The idea is that a disease will spread from people who are infected to people who are still susceptible. After infected people recover, they are usually immune to the disease, at least for a little while. In the system below, S(t)S(t) is the percent of the population that is still susceptible, I(t)I(t) is the percent that are currently infected, and R(t)R(t) is the percent of the population that are recovered. The constants α\alpha and β\beta are the transmission rate and recovery rate, respectively.

dSdt=αSIdIdt=αSIβIdRdt=βI\begin{align*} \dfrac{dS}{dt} &= -\alpha SI \\ \dfrac{dI}{dt} &= \alpha SI - \beta I \\ \dfrac{dR}{dt} &= \beta I \end{align*}

  1. Under what circumstances is the number of infected people increasing?

  2. If we introduce a vaccine, what effect might that have on the model?

  3. What if the disease is fatal for some people? How would you change the model to account for that? Hint: You could have a constant γ\gamma that represents the fatality rate, i.e., the proportion of the infected population that die each day.

  4. If you divide dI/dtdI/dt by dS/dtdS/dt, you get the differential equation dIdS=1+βα1S.\dfrac{dI}{dS} = -1 + \dfrac{\beta}{\alpha} \dfrac{1}{S}. Solve this differential equation with initial condition S=1S = 1 and I=0I = 0.

Here is a plot showing the solution superimposed on the direction field (for SS and II only).

Fri, Sep 19

Today we talked about decoupled systems and partially coupled systems.

A system of equations dxdt=f(x)dydt=g(y)\begin{align*} \dfrac{dx}{dt} &= f(x) \\ \dfrac{dy}{dt} &= g(y) \\ \end{align*} is called decoupled since the xx-variable doesn’t depend on yy, and the yy-variable doesn’t depend on xx. You can solve the differential equations in a decouple system separately.

A system of equations dxdt=f(x,y)dydt=g(y)\begin{align*} \dfrac{dx}{dt} &= f(x, y) \\ \dfrac{dy}{dt} &= g(y) \\ \end{align*} is partially coupled. You can solve for y(t)y(t) first, and then substitute into the first equation to create a single variable differential equation for x(t)x(t).

  1. Solve the system x=xyy=3y\begin{align*} x' &= -x - y \\ y' &= -3y \\ \end{align*}

  2. Solve the system x=2x+y2y=y\begin{align*} x' &= 2x + y^2 \\ y' &= -y \\ \end{align*} with initial conditions x(0)=3x(0) = 3 and y(0)=2y(0) = 2. (https://youtu.be/sJ3CuM-QmOk)

Here is a Desmos graph showing the solutions to the last problem as different parametric curves.


Week 5 Notes

Day Section Topic
Mon, Sep 22 2.3 Numerical Techniques for Systems
Wed, Sep 24 C1 Complex Numbers and Differential Equations
Fri, Sep 26 C2 Solving System Analytically - con’d

Mon, Sep 22

Today we introduced Euler’s method for systems of differential equations equations.

  1. We started by implementing Euler’s method for the system of rabbits and foxes: dRdt=2RRFdFdt=5F+RF\begin{align*} \dfrac{dR}{dt} &= 2R - RF \\ \dfrac{dF}{dt} &= -5F + RF \end{align*}
We started with an initial condition (R0,F0)=(2,1)(R_0, F_0) = (2,1).
Figure: Two-dimensional Euler’s method example (Python)
  1. A more realistic model for the rabbits & foxes might be if the rabbits growth was constrained by a carrying capacity of 10 thousand rabbits (logistic growth), in the absence of foxes. How would this change the differential equation above?

  2. Now use Euler’s method to investigate the long-run behavior of the rabbits & foxes with this new model. What changes?

Now talk about the equation for a pendulum: d2θdt2=gLsinθ.\dfrac{d^2 \theta}{d t^2} = - \dfrac{g}{L} \sin \theta.

  1. Re-write this 2nd order ODE as a system of 1st order equations.

Typically in introductory physics, you find an approximate solution of this equation by assuming that the angle θ\theta stays small and so sinθθ\sin \theta \approx \theta. But we can use Euler’s method instead to generate solutions numerically (Python).

Wed, Sep 24

Today we introduced complex numbers and talked about how they can arise in differential equations.

A complex number is an expression z=a+biz = a + b i where a,ba, b are real numbers and ii has the property that i2=1i^2 = -1.

  1. Calculate (2+2i)(3+2i)(-2 + 2i)(3+2i).

  2. Show that for any complex number zz¯=|z|2z \cdot \overline{z} = |z|^2.

Euler’s Formula. eit=cost+isinte^{i t } = \cos t + i \sin t

A complex-valued function is a function z(t)=x(t)+iy(t)z(t) = x(t) + i y(t) where both x(t)x(t) and y(t)y(t) are real-valued functions. You can integrate and differentiate complex-valued functions by integrating/differentiating the real and imaginary parts.

  1. Show that z(t)=cost+isintz(t) = \cos t + i \sin t is a solution of the differential equation dzdt=iz\dfrac{dz}{dt} = i z.

Polar Form. Any complex number zz can be expressed as z=reiθz = re^{i \theta}, where r=|z|r = |z| and θ\theta is an angle called the argument of zz.

Figure: Polar form. (Source: Wikipedia)
  1. Convert 2+2i\sqrt{2} + \sqrt{2}i and 1+3i1 + \sqrt{3} i to polar form, then multiply them by applying the formula eiαeiβ=ei(α+β).e^{i \alpha} e^{i \beta} = e^{i (\alpha + \beta)}.

  2. Solve the differential equation z+z=iz' + z = i.

  3. Show that eite^{it} is a solution for the differential equation y+y=0y'' + y = 0. Hint: The chain rule applies to complex-valued functions, so ddteit=ieit\frac{d}{dt} e^{it} = i e^{it}.

Fri, Sep 26

Today we talked about homogeneous second order linear differential equations with constant coefficients.

ay+by+c=0. ay'' + b y' + c = 0.

These equations are used to model simple harmonic oscillators such as a spring where the total force depends on a spring force kx-k x and a friction or damping force bx-b x':

md2xdt2=bdxdtkx.m \dfrac{d^2 x}{dt^2} = - b \dfrac{dx}{dt} - k x.

  1. Show that eλte^{\lambda t} is a solution of ay+by+cyay'' + by' + cy if and only if λ\lambda is a root of the characteristic polynomial ax2+bx+cax^2 + bx + c.

General Solution of a 2nd Order Homogeneous Linear Differential Equation.

Theorem. If f(t)f(t) and g(t)g(t) are linearly independent solutions of ay+by+c=0,a y'' + by' + c = 0, then the general solution is y(t)=C1f(t)+C2g(t).y(t) = C_1 f(t) + C_2 g(t).

Using the language of linear algebra, we can describe the result above several ways:

We applied the theorem above to the following two examples:

  1. Find the general solution to y+3y+2y=0y'' + 3y' + 2y = 0. (https://youtu.be/Pxc7VIgr5kc?t=241)

  2. Find the general solution of y+2y+2y=0y'' + 2 y' + 2 y = 0. Hint: Use the quadratic formula.


Week 6 Notes

Day Section Topic
Mon, Sep 29 Review
Wed, Oct 1 Midterm 1
Fri, Oct 3 3.1 Linear Algebra in a Nutshell

Mon, Sep 29

We talked about the midterm 1 review problems. We also looked at this example:

  1. Find the general solution of the differential equation y+3y=t+1y' + 3y = t + 1 using the guess & check method. Hint: A good guess for the particular solution is that yy is a linear function, so y(t)=At+By(t) = A t + B for some constants AA and BB.

Fri, Oct 3

Today we talked about homogeneous linear systems of differential equations. These can be expressed using a matrix. For example, if 𝐱=[x1x2]\mathbf{x} = \begin{bmatrix} x_1 \\ x_2 \end{bmatrix}, then the system of differential equations dx1dt=ax1+bx2\dfrac{dx_1}{dt} = a x_1 + b x_2 dx2dt=cx1+dx2\dfrac{dx_2}{dt} = c x_1 + d x_2 can be re-written as d𝐱dt=A𝐱 where A=[abcd].\dfrac{d \mathbf{x}}{dt} = A \mathbf{x} \text{ where } A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}. It turns out that the eigenvectors and eigenvalues of AA tell you a lot about the solutions of the system. We did these exercises in class.

  1. Find the characteristic polynomial and eigenvalues of the matrix A=[3526].A = \begin{bmatrix} 3 & 5 \\ 2 & 6 \end{bmatrix}.

  2. Show that [11]\begin{bmatrix} 1 \\ 1 \end{bmatrix} is an eigenvector for AA. What is its eigenvalue?

  3. Find an eigenvector for AA corresponding to the eigenvalue λ=1\lambda = 1 by finding the null space of AλIA - \lambda I.

After those examples, we did a workshop.

We also talked about how to calculate the eigenvectors of a matrix using a computer. In Python, the sympy library lets you calculate the eigenvectors of a matrix exactly when possible. You can also do this in Octave if you load the symbolic package.

from sympy import *

A = Matrix([[3,5],[2,6]])
'''
The .eigenvects() method returns a list of tuples containing: 
1. an eigenvalue, 
2. its multiplicity (how many times it is a root), and
3. a list of corresponding eigenvectors. 
'''
pretty_print(A.eigenvects())
Figure: Finding exact eigenpairs. (Octave, Python)

Week 7 Notes

Day Section Topic
Mon, Oct 6 3.2 Planar Systems
Wed, Oct 8 3.2 Planar Systems - con’d
Fri, Oct 10 3.3 Phase Plane Analysis of Linear Systems

Mon, Oct 6

Today we talked about how to solve a homogeneous linear system dxdt=Ax\dfrac{dx}{dt} = Ax using the eigenvectors and eigenvalues of AA when the eigenvalues are all real with no repeats. We did the following examples:

  1. Show that x(t)=e8t[11]x(t) = e^{8t} \begin{bmatrix} 1 \\ 1 \end{bmatrix} is a solution to the linear system dxdt=[3526]x\dfrac{dx}{dt} = \begin{bmatrix} 3 & 5 \\ 2 & 6 \end{bmatrix} x.

Fact. If 𝐯\mathbf{v} is an eigenvector of AA with eigenvalue λ\lambda, then 𝐱(t)=eλt𝐯\mathbf{x}(t) = e^{\lambda t} \mathbf{v} is a solution of the linear system 𝐱=A𝐱\mathbf{x}' = A\mathbf{x}.

Fact 2. The general solution of a planar system 𝐱=A𝐱\mathbf{x}' = A \mathbf{x} with distinct real eigenvalues λ1,λ2\lambda_1, \lambda_2 and corresponding eigenvectors 𝐯1,𝐯2\mathbf{v}_1, \mathbf{v}_2 is C1eλ1t𝐯1+C2eλ2t𝐯2.C_1 e^{\lambda_1 t} \mathbf{v}_1 + C_2 e^{\lambda_2 t} \mathbf{v}_2.

We used these facts to find the general solutions for the following systems.

  1. dxdt=[3526]x\dfrac{dx}{dt} = \begin{bmatrix} 3 & 5 \\ 2 & 6 \end{bmatrix} x.

  2. dxdt=[1243]x\dfrac{dx}{dt} = \begin{bmatrix} 1 & 2 \\ 4 & 3 \end{bmatrix} x. (https://youtu.be/DWzq_jMPRgc)

We also talked about how to graph the solutions.

Figure: Straight-line solutions for dxdt=[3526]x\dfrac{dx}{dt} = \begin{bmatrix} 3 & 5 \\ 2 & 6 \end{bmatrix} x. (Python)

We finished with the following question:

  1. The zero vector is always an equilibrium solution of x=Axx' = Ax. Under what conditions will there be other equilibrium solutions?

Week 8 Notes

Day Section Topic
Mon, Oct 13 Fall break - no class
Wed, Oct 15 3.4 Complex Eigenvalues
Fri, Oct 17 3.5 Repeated Eigenvalues

Week 9 Notes

Day Section Topic
Mon, Oct 20 3.6 Changing Coordinates
Wed, Oct 22 3.7 The Trace-Determinant Plane
Fri, Oct 24 3.7 The Trace-Determinant Plane - con’d

Week 10 Notes

Day Section Topic
Mon, Oct 27 Review
Wed, Oct 29 Midterm 2
Fri, Oct 31 3.8 Linear Systems in Higher Dimensions

Week 11 Notes

Day Section Topic
Mon, Nov 3 3.9 The Matrix Exponential
Wed, Nov 5 4.1 Homogeneous Linear Equations
Fri, Nov 7 4.2 Forcing

Week 12 Notes

Day Section Topic
Mon, Nov 10 4.3 Sinusoidal Forcing
Wed, Nov 12 4.4 Forcing and Resonance
Fri, Nov 14 5.1 Linearization

Week 13 Notes

Day Section Topic
Mon, Nov 17 5.1 Linearization - con’d
Wed, Nov 19 Review
Fri, Nov 21 Midterm 3
Mon, Nov 23 6.1 The Laplace Transform

Week 14 Notes

Day Section Topic
Mon, Dec 1 6.1 The Laplace Transform - con’d
Wed, Dec 3 6.2 Solving Initial Value Problems
Fri, Dec 5 6.2 Solving Initial Value Problems - con’d
Mon, Dec 8 Recap & review