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.

Solutions of Homogeneous Linear Systems.

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 straight-line solution for 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?

Wed, Oct 8

Last time we talked about how to find general solutions for linear systems. Today we talked about how to find specific solutions that satisfy an initial condition. Before that, we answered this question:

  1. Under what circumstances does x=Axx' = A x have more than one equilibrium solution?

    Any time that zero is an eigenvalue of AA (i.e., the null space of AA is non-trivial), all of the eigenvectors corresponding to zero (i.e., the vectors in the null space) will be equilibrium points. It helps to know following theorem:

    Invertible Matrix Theorem. For an n-by-n matrix AA, the following are equivalent.

    1. AA is invertible.
    2. detA0\det A \ne 0.
    3. The columns of AA are linearly independent.
    4. The rows of AA are linearly independent.
    5. The null space of AA is {0}\{0\}.
    6. Zero is not an eigenvalue of AA.

After that, we talked about the classification of equilibria for linear systems.

Types of Equilibria for Planar Systems with Real Eigenvalues.

  1. If both eigenvalues are positive, then the origin is a source (unstable).
  2. If both eigenvalues are negative, then the origin is a sink (stable).
  3. If one eigenvalue is positive and the other is negative, the origin is a saddle equilibrium.

Then we solved the following initial value problems.

  1. Find the solution to dxdt=[3526]x\dfrac{dx}{dt} = \begin{bmatrix} 3 & 5 \\ 2 & 6 \end{bmatrix} x that satisfies x(0)=[70].x(0) = \begin{bmatrix} 7 \\ 0 \end{bmatrix}.

  2. Find the solution to dxdt=[1243]x\dfrac{dx}{dt} = \begin{bmatrix} 1 & 2 \\ 4 & 3 \end{bmatrix} x that satisfies x(0)=[54].x(0) = \begin{bmatrix} 5 \\ 4 \end{bmatrix}.

We used row reduction to solve these initial value problems. Here’s a video with a similar exercise (https://youtu.be/Mnz-S-RvpDw) if you want a different take. Octave makes this kind of matrix computation very easy.

pkg load symbolic
A = sym([3 5; 2 6])

# The columns of V are the eigenvectors and the diagonal entries of D are the eigenvalues.
[V, D] = eig(A)

# The backslash operator A \ b solves the matrix equation Ax = b. 
V \ [7;0]

Fri, Oct 10

Today we talked about systems with complex eigenvalues. We started by looking at three different direction fields for the following three matrices:

A=[0232]B=[2312]C=[2542]A= \begin{bmatrix} 0 & 2 \\ -3 & 2 \end{bmatrix} ~~~~~~ B = \begin{bmatrix} -2 & 3 \\ -1 & -2 \end{bmatrix} ~~~~~~ C = \begin{bmatrix} 2 & 5 \\ -4 & -2 \end{bmatrix}

Figure: Spiral sources, spiral sinks, and centers.

Types of Equilibria for Planar Systems with Complex Eigenvalues.

Suppose x=Axx' = Ax is a planar system with complex eigenvalues α±βi\alpha \pm \beta i.

  1. If α\alpha is positive, then the origin is a spiral source (unstable).
  2. If α\alpha is negative, then the origin is a spiral sink (stable).
  3. If α\alpha is zero, then the origin is a center equilibrium and the solutions are periodic.

We talked about why this is true using Euler’s formula eαt±iβt=eαt(cos(βt)±isin(βt)).e^{\alpha t \pm i \beta t} = e^{\alpha t} ( \cos (\beta t) \pm i \sin (\beta t) ).

It is still true that the general solution is x(t)=C1eλ1tv1+C2eλ2tv2x(t) = C_1 e^{\lambda_1 t} v_1 + C_2 e^{\lambda_2 t} v_2 but the coefficients are typically complex numbers and we only want real solutions. Next time we’ll discuss a better way to find the real-valued 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.7 The Trace-Determinant Plane

Wed, Oct 15

Last time we talked about planar systems with complex eigenvalues. We haven’t seen how to find nice solutions for those systems yet. Here is the key idea we need:

Solutions for Systems with Complex Eigenvalues.

Fact. If x(t)x(t) is a complex solution to a real linear system x=Axx' = Ax, then both the real and imaginary parts of x(t)x(t) are real solutions for the system.

Fact 2. If x(t)x(t) is a complex solution of a planar system x=Axx' = Ax where the real-part xreal(t)x_{\text{real}}(t) and the imaginary-part ximag(t)x_\text{imag}(t) are linearly independent when t=0t=0, then the general solution is C1xreal(t)+C2ximag(t).C_1 x_\text{real}(t) + C_2 x_\text{imag}(t).

Here’s how to use these facts to find the general real-valued solution:

We used this approach to find the general (real) solutions for the following planar systems.

  1. dxdt=[2312]x\dfrac{dx}{dt} = \begin{bmatrix} -2 & 3 \\ -1 & -2 \end{bmatrix} x

  2. Suppose a planar system x=Axx' = Ax has an eigenvector [143i]\begin{bmatrix} 1 \\ 4 - 3i \end{bmatrix} with corresponding eigenvalue 14i1 - 4i. What is the general solution for the system?

  3. Find a solution for the previous example with initial condition x(0)=[26]x(0) = \begin{bmatrix} 2 \\ -6 \end{bmatrix}.

  4. dxdt=[1141]x\dfrac{dx}{dt} = \begin{bmatrix} 1 & -1 \\ 4 & 1 \end{bmatrix} x (https://youtu.be/j-qvdT8nSnw)

Fri, Oct 17

In homework 6 we showed that the characteristic polynomial of a 2-by-2 matrix AA is: λ2trAλ+detA.\lambda^2 - \operatorname{tr}A \lambda + \det A. This implies that trA=λ1+λ2 and detA=λ1λ2\operatorname{tr}A = \lambda_1 + \lambda_2 \text{ and } \det A = \lambda_1 \lambda_2 where λ1,λ2\lambda_1, \lambda_2 are the eigenvalues of AA. You can also turn this around to say that λ=trA±(trA)24detA2.\lambda = \frac{\operatorname{tr}A \pm \sqrt{(\operatorname{tr}A)^2 - 4 \det A}}{2}. This explains this picture:
Figure: Types of equilibria for 2D-systems. (Source: Wikipedia)

If you change the parameters of a system of differential equations, a bifurcation happens when the type or number of equilibria changes. For planar systems, that happens when detA=0\det A = 0, trA=0\operatorname{tr}A = 0, or when (trA)2=4detA(\operatorname{tr}A)^2 = 4 \det A.

  1. Consider the 1-parameter family d𝐱dt=[aa2a1a]𝐱\dfrac{d\mathbf{x}}{dt} = \begin{bmatrix} a & a^2 - a \\ 1 & a \end{bmatrix} \mathbf{x}. For what values of aa do you get bifurcations?

  2. Consider the harmonic oscillator md2xdt2+bdxdt+kx=0m \dfrac{d^2 x}{dt^2} + b \dfrac{dx}{dt} + k x = 0.

    1. Re-write this as a linear system.
    2. Express the trace and determinant of the system as functions of m,b,m, b, and kk.
    3. Describe how the type of the equilibrium in phase space changes depending on m,b,km, b, k.

Here are two more examples that we didn’t have time for in class.

  1. Consider the 1-parameter family d𝐘dt=[aa1a]𝐘\dfrac{d\mathbf{Y}}{dt} = \begin{bmatrix} a & a \\ 1 & a \end{bmatrix} \mathbf{Y}. For what values of aa do you get bifurcations? (https://youtu.be/F2ew7_dD5Zg)

  2. Consider the 2-parameter family d𝐲dt=[0ab0]𝐲\dfrac{d\mathbf{y}}{dt} = \begin{bmatrix} 0 & a \\ b & 0 \end{bmatrix} \mathbf{y}. Describe how the type of equilibrium depends on the parameters aa and bb.


Week 9 Notes

Day Section Topic
Mon, Oct 20 3.9 The Matrix Exponential
Wed, Oct 22 3.8 Linear Systems in Higher Dimensions
Fri, Oct 24 3.5 Repeated Eigenvalues

Mon, Oct 20

Today we talked about the matrix exponential and how it solves any homogeneous linear system!

The Matrix Exponential.

Definition. For any nn-by-nn matrix AA, eA=I+A+A22!+A33!+.e^A = I + A + \frac{A^2}{2!} + \frac{A^3}{3!} + \ldots.

Fact. 𝐱(t)=etA𝐱0\mathbf{x}(t) = e^{tA} \mathbf{x}_0 is the solution of the system d𝐱dt=A𝐱\dfrac{d\mathbf{x}}{dt} = A \mathbf{x} with initial condition 𝐱(0)=𝐱0\mathbf{x}(0) = \mathbf{x}_0.

To calculate a matrix exponential, start by diagonalizing the matrix, if possible.

Diagonalization Theorem.

If an nn-by-nn matrix AA has linearly independent eigenvectors 𝐯1,𝐯2,,𝐯n\mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_n with corresponding eigenvalues λ1,λ2,,λn\lambda_1, \lambda_2, \ldots, \lambda_n, then A=VDV1A = V D V^{-1} where V=[|||𝐯1𝐯2𝐯n|||] and D=[λ100λn].V = \begin{bmatrix} | & | & & | \\ \mathbf{v}_1 & \mathbf{v}_2 & \cdots & \mathbf{v}_n \\ | & | & & | \end{bmatrix} \text{ and } D = \begin{bmatrix} \lambda_1 & & 0 \\ & \ddots & \\ 0 & & \lambda_n \end{bmatrix}.

Furthermore, the matrix exponential etAe^{tA} for a diagonalizable matrix is: etA=VetDV1=V[etλ100etλn]V1.e^{tA} = V e^{tD} V^{-1} = V \begin{bmatrix} e^{t\lambda_1} & & 0 \\ & \ddots & \\ 0 & & e^{t\lambda_n} \end{bmatrix}V^{-1}.

  1. Diagonalize the matrix A=[1124]A = \begin{bmatrix} 1 & -1 \\ 2 & 4 \end{bmatrix} and then use the diagonalization to compute A100A^{100}. (https://www.youtube.com/watch?v=uHW2zThZDEw)

To solve the last problem, it helps to know the following formula.

Inverse of a 2-by-2 Matrix. [abcd]1=1adbc[dbca].\begin{bmatrix} a & b \\ c & d \end{bmatrix}^{-1} = \dfrac{1}{ad - bc} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}.

  1. Use the diagonalization of A=[1124]A = \begin{bmatrix} 1 & -1 \\ 2 & 4 \end{bmatrix} to solve the initial value problem d𝐱dt=[1124]𝐱,𝐱(0)=[12].\frac{d \mathbf{x}}{dt} = \begin{bmatrix} 1 & -1 \\ 2 & 4 \end{bmatrix} \mathbf{x}, ~ \mathbf{x}(0) = \begin{bmatrix} 1 \\ 2 \end{bmatrix}.

  2. Calculate etAe^{tA} for A=[3443]A = \begin{bmatrix} 3 & 4 \\ -4 & 3 \end{bmatrix} and use it to find the general solution to 𝐱=A𝐱\mathbf{x}' = A \mathbf{x}. Hint: the eigenvalues of AA are 3±4i3 \pm 4i with corresponding eigenvectors [1±i]\begin{bmatrix} 1 \\ \pm i \end{bmatrix}.

Since calculating a matrix exponential by hand is so tedious, we’ll usually use a computer.

Be careful computing symbolic matrix exponentials. It only works for very simple matrices.

Wed, Oct 22

Today we talked about homogeneous linear systems in 3-dimensions. We started with these examples.

  1. Use the matrix exponential function to find the solution to the initial value problem dXdt=[11001010461]X, with X(0)=[10100].\dfrac{dX}{dt} = \begin{bmatrix} 1 & 10 & 0 \\ -10 & 1 & 0 \\ -4 & 6 & -1 \end{bmatrix}X, \text{ with } X(0) = \begin{bmatrix} 1 \\ 0 \\ 100 \end{bmatrix}.

  2. Use Desmos 3D to graph the solution above.

  3. Find the straight-line solutions and the general solution for the system dYdt=[312404413]Y.\dfrac{dY}{dt} = \begin{bmatrix} -3 & 1 & 2 \\ 4 & 0 & -4 \\ -4 & 1 & 3 \end{bmatrix} Y. Hint: The matrix for this system has eigenpairs λ1=1,𝐯1=[101],λ2=0,𝐯2=[111],λ3=1,𝐯3=[140].\lambda_1 = -1, \mathbf{v}_1 = \begin{bmatrix}1 \\ 0 \\ 1 \end{bmatrix}, \lambda_2 = 0, \mathbf{v}_2 = \begin{bmatrix} 1 \\ 1\\ 1\end{bmatrix}, \lambda_3 = 1, \mathbf{v}_3 = \begin{bmatrix} 1 \\ 4 \\ 0 \end{bmatrix}.

  4. Consider the system dZdt=[020200001]Z\dfrac{dZ}{dt} = \begin{bmatrix} 0 & 2 & 0 \\ -2 & 0 & 0 \\ 0 & 0 & -1 \end{bmatrix} Z.

    1. The vector [1i0]\begin{bmatrix} 1 \\ i \\ 0 \end{bmatrix} is an eigenvector with eigenvalue 2i2i. Find the real and imaginary parts of the corresponding solution.
    2. The system above decouples since Z3Z_3 does not depend on Z1Z_1 or Z2Z_2. Find a solution for the third component of ZZ. Express that solution as a straight line solution in vector form assuming that Z1=Z2=0Z_1 = Z_2 = 0.

Fri, Oct 24

There is one other case of linear systems that we haven’t considered yet. What happens when there are repeated eigenvalues?

  1. The matrix A=[2102]A = \begin{bmatrix} 2 & 1 \\ 0 & 2 \end{bmatrix} has the eigenvalue λ=2\lambda = 2 repeated twice, but it only has one eigenvector (up to scaling).

Linear Systems with Repeated Eigenvalues.

If AA is a 2-by-2 matrix with repeated eigenvalue λ\lambda, then eAt=eλt(I+t(AλI)).e^{At} = e^{\lambda t} (I + t(A-\lambda I)).

Therefore the solution to 𝐱=A𝐱\mathbf{x}' = A\mathbf{x} with initial condition 𝐱0\mathbf{x}_0 is eλt(I+t(AλI))𝐱0.e^{\lambda t} (I + t(A-\lambda I))\mathbf{x}_0.

We applied this theorem to the following examples:

  1. Consider the system d𝐱dt=[2102]𝐱\dfrac{d\mathbf{x}}{dt} = \begin{bmatrix} 2 & 1 \\ 0 & 2 \end{bmatrix} \mathbf{x}.
    1. Find the straight-line solutions.
    2. Find the solution with initial condition 𝐱0=[01].\mathbf{x}_0 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}.

This is an example of what is called a degenerate source equilibrium at the origin. You can also have a degenerate sink if the repeated eigenvalue is negative.

  1. We also talked about Homework 8, exercise 9.

We finished by talking about what happens when both eigenvalues are zero. In that case you get uniform motion in a straight line parallel to the eigenvector, with a velocity proportional to the distance from the eigenvector.


Week 10 Notes

Day Section Topic
Mon, Oct 27 Review
Wed, Oct 29 Midterm 2
Fri, Oct 31 Inhomogeneous Linear Systems

Mon, Oct 27

Today we talked about the midterm 2 review problems. We also went over the problems on the quiz about the trace-determinant plane.

Fri, Oct 31

Today we talked about systems of linear equations that are not homogeneous, so the can be expressed in the form d𝐱dtA𝐱=𝐟(t)\dfrac{d\mathbf{x}}{dt} - A \mathbf{x} = \mathbf{f}(t) where 𝐟(t)\mathbf{f}(t) is a vector-valued forcing function. As with any linear differential equations, the general solution is a combination of any one particular solution plus the general homogeneous solution.

Solutions of Non-Homogeneous Linear Systems.

If 𝐱p(t)\mathbf{x}_p(t) is a particular solution to the inhomogeneous system d𝐱dtA𝐱=𝐟(t),\dfrac{d\mathbf{x}}{dt} - A \mathbf{x} = \mathbf{f}(t), and 𝐱h(t)\mathbf{x}_h(t) is the general solution of the homogeneous linear system d𝐱dt=A𝐱\dfrac{d\mathbf{x}}{dt} = A \mathbf{x}, then the general solution to the inhomogeneous system is: 𝐱p(t)+𝐱h(t).\mathbf{x}_p(t) + \mathbf{x}_h(t).

We solved the following examples.

  1. 𝐱=[1121]𝐱+[23]\mathbf{x}' = \begin{bmatrix} 1 & 1 \\ 2 & 1 \end{bmatrix} \mathbf{x} + \begin{bmatrix} 2 \\ 3 \end{bmatrix} (https://youtu.be/1VU8lIe6ftQ)

Here’s another similar example that we did not do in class.

  1. d𝐱dt=[2142]𝐱+[36]\dfrac{d\mathbf{x}}{dt} = \begin{bmatrix} 2 & 1 \\ 4 & 2 \end{bmatrix} \mathbf{x} + \begin{bmatrix} 3 \\ 6 \end{bmatrix} (https://youtu.be/pW1IaFkRXUg)

Here’s an example where the forcing term depends on time. You need to use the guess-and-check method (also known as the method of undetermined coefficients) to find a particular solution.

  1. d𝐱dt=[2103]𝐱+[9et12et]\dfrac{d\mathbf{x}}{dt} = \begin{bmatrix} 2 & 1 \\ 0 & 3 \end{bmatrix} \mathbf{x} + \begin{bmatrix} -9 e^{-t} \\ 12e^{-t} \end{bmatrix}

    In this case, the matrix A=[2103]A = \begin{bmatrix} 2 & 1 \\ 0 & 3 \end{bmatrix} has eigenvectors [10]\begin{bmatrix} 1 \\ 0 \end{bmatrix}, [11]\begin{bmatrix} 1 \\ 1 \end{bmatrix} with eigenvalues λ=2,3\lambda = 2, 3 respectively. So the general solution to the homogeneous equation is 𝐱h(t)=C1e2t[10]+C2e3t[11].\mathbf{x}_h(t) = C_1 e^{2t} \begin{bmatrix} 1 \\ 0 \end{bmatrix} + C_2 e^{3t} \begin{bmatrix} 1 \\ 1 \end{bmatrix}. To find a particular solution, we will guess that it has the form et𝐯e^{-t} \mathbf{v} for some vector 𝐯\mathbf{v}. Then, substituting into the equation, we need et𝐯=Aet𝐯+[9et12et].-e^{-t} \mathbf{v} = A e^{-t} \mathbf{v} + \begin{bmatrix} -9e^{-t} \\ 12 e^{-t} \end{bmatrix}. Since every term has a factor of ete^{-t}, you can cancel that out, and solve the matrix equation: (IA)𝐯=[912].(-I - A) \mathbf{v} = \begin{bmatrix} -9 \\ 12 \end{bmatrix}. Using a computer, we find that 𝐯=[43]\mathbf{v} = \begin{bmatrix} 4 \\ -3 \end{bmatrix}. So the particular solution is 𝐱p(t)=et[43].\mathbf{x}_p(t) = e^{-t} \begin{bmatrix} 4 \\ -3 \end{bmatrix}.

Here’s is another example that uses the guess-and-check method.

  1. Solve the following non-homogeneous system. (https://youtu.be/zFwwYxJSlR0) x=4x+2y+tx' = 4x + 2y + t y=3xy4y' = 3x - y - 4

Week 11 Notes

Day Section Topic
Mon, Nov 3 4.2 Forcing
Wed, Nov 5 4.3 Sinusoidal Forcing
Fri, Nov 7 4.4 Forcing and Resonance

Mon, Nov 3

Today we switched from systems back to second order differential equations, like the equation for a spring. The idea is the same: combine one particular solution to the non-homogeneous equation with the general solution of the homogeneous equation. We started with this example.

  1. y5y+6y=2x+3y'' - 5y' + 6y = 2x + 3. (https://youtu.be/tOtpqZLgxP0)

After that, we talked about what happens if the characteristic polynomial has complex roots.

Linear Differential Equations with Complex Solutions

If we have a homogeneous linear differential equation with real coefficients andnydtn++a1dydt+a0y=0a_n \dfrac{d^n y}{dt^n} + \ldots + a_1 \dfrac{dy}{dt} + a_0 y = 0 and y(t)y(t) is a complex-valued solution, then both the real and imaginary parts of y(t)y(t) are also solutions.

In particular, if λ=α+iβ\lambda = \alpha + i \beta is a complex root of the characteristic polynomial anλn++a1λ+a0a_n \lambda^n + \ldots + a_1 \lambda + a_0, then eαtcos(βt)e^{\alpha t} \cos (\beta t) and eαtsin(βt)e^{\alpha t} \sin (\beta t) are both solutions to the differential equation.

The next few examples all have a characteristic polynomial with complex roots λ=1±i\lambda = -1 \pm i.

  1. z+2z+2z=0z'' + 2z' + 2z = 0.

  2. z+2z+2z=etz'' + 2z' + 2z = e^{-t}.

  3. z+2z+2z=sintz'' + 2z' + 2z = \sin t.

Wed, Nov 5

Last time, we used the method of undetermined coefficients to find a particular solution yp(t)=Acost+Bsinty_p(t) = A \cos t + B \sin t for the differential equation z+2z+2z=sint.z'' + 2z' + 2z = \sin t.

If you are comfortable with complex numbers, then you can use a different technique called complexifying to find a particular solutions. Observe that sint\sin t is the imaginary part of eite^{it}, so if you can find a complex-valued particular solution zp(t)=Aeitz_p(t) = A e^{it} to z+2z+2z=eit,z'' + 2z' + 2z = e^{it}, then the imaginary part of that solution will be what we want.

In order to find the constant AA, you need to divide by a complex number. Here is how you do that:

Dividing by a Complex Number If z,wz, w are complex numbers, then you can simplify zw\dfrac{z}{w} by multiplying both the numerator and denominator by the complex conjugate w¯\overline{w}.

We did the following examples in class

  1. Find the particular solution by complexifying z+2z+2z=sintz'' + 2z' + 2z = \sin t.
  1. Find the general solution to x+2x+6x=cos2tx'' + 2x' + 6x = \cos 2t.

We spent a long time working out the general solution to the last problem because it does take a lot of steps. First we found one particular solution by complexifying and then we still needed to solve the homogeneous equation. We finished by graphing the solution on Desmos.

Here is a cool video from a differential equations class at MIT where they use the exact same trick to integrate

  1. excosxdx\int e^x \cos x \, dx. (https://youtu.be/CpM1jJ0lob8)

Fri, Nov 7

We started with this example, which you can solve using complexification like we did on Wednesday.

  1. z+8z=cos(ωt)z'' + 8z = \cos (\omega t). (https://youtu.be/xJz3NZap1lw)

The last example illustrates a phenomena known as resonance. When the frequency ω\omega is close to the natural frequency of the harmonic oscillator, the amplitude of the particular solution gets very large.

  1. What is the natural frequency of an undamped spring with mass mm and spring constant kk? Solve the homogeneous equation my+ky=0my'' + k y = 0 to find out.

  2. Find the solution to z+8z=cos(ωt)z'' + 8z = \cos (\omega t) that satisfies the initial conditions z(0)=1z(0) = 1 and z(0)=0z'(0) = 0 when ω=3\omega = 3.

We graphed the solution on Desmos, and talked about the concept of beats.

Here is a nice video about beats: https://youtu.be/IQ1q8XvOW6g.


Week 12 Notes

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

Mon, Nov 10

We started with this example where the forcing term ete^{-t} is a solution of the homogeneous equation.

  1. y3y4y=ety'' - 3y' - 4y = e^{-t} (https://youtu.be/RNHzfeP7HQQ)

In order to get a good guess for the particular solution, you need to multiply ete^{-t} by tt, because yp(t)=Aety_p(t) = Ae^{-t} doesn’t work, but yp(t)=Atety_p(t) = Ate^{-t} does. This trick always works if the forcing term is an exponential function (although you might need to multiply by tt more than once).

Here is a summary of the different options we’ve discussed for finding a particular solution to a non-homogeneous linear differential equation.

Forcing Term Good Guess Next Option
at+bat + b yp=At+By_p = At + B
ekte^{kt} yp=Aekty_p = Ae^{kt} Multiply your last guess by tt
sinωt\sin \omega t or cosωt\cos \omega t yp=Acosωt+Bsinωty_p = A \cos \omega t + B \sin \omega t Complexify
  1. What is the natural frequency of an undamped spring with mass m and spring constant k?

What happens when you force a spring at exactly its natural frequency? We used complexification to find a particular solution to this equation:

  1. y+16y=sin4ty'' + 16 y = \sin 4t

We have been working with differential equations, which involve the linear operator ddt\dfrac{d}{dt}. A differential equation like y3y4y=ety'' - 3y' - 4y = e^{-t} can be expressed as (d2dt23ddt4)y=et.\left(\dfrac{d^2}{dt^2} - 3 \dfrac{d}{dt} - 4 \right) y = e^{-t}. The left-hand side is a linear transformation of the function y(t)y(t). The expression (d2dt23ddt4)\left(\dfrac{d^2}{dt^2} - 3 \dfrac{d}{dt} - 4 \right) is called an operator. An operator is a function that transforms one function into another.

Definition. An operator LL is linear if it satisfies these two properties:

  1. Additivity. L(x+y)=L(x)+L(y)L(x + y) = L(x) + L(y) for all functions x(t)x(t) and y(t)y(t).
  2. Homogeneity. L(cx)=cL(x)L(cx) = cL(x) for all functions x(t)x(t) and constants cc.

An immediate consequence of linearity is the Principle of Superposition which says that a linear combination of solutions to a homogeneous linear differential equation is also a solution and you can add any homogeneous solution to the solution of a non-homogeneous equation. That’s why the general solution of a non-homogeneous linear differential equation is y(t)=yp(t)+yh(t)y(t) = y_p(t) + y_h(t) where yp(t)y_p(t) is any one particular solution and yh(t)y_h(t) is the general solution of the corresponding homogeneous equation.

Wed, Nov 12

Today we talked about how to classify the equilibrium points for nonlinear systems.

Jacobian Matrix.

The Jacobian matrix of a function F:nnF:\mathbb{R}^n \rightarrow \mathbb{R}^n is
J=[F1x1F1xnFnx1Fnxn]J = \begin{bmatrix} \frac{\partial F_1}{\partial x_1} & \cdots & \frac{\partial F_1}{\partial x_n} \\ \vdots & \ddots & \vdots \\ \frac{\partial F_n}{\partial x_1} & \cdots & \frac{\partial F_n}{\partial x_n} \end{bmatrix}

You can use the Jacobian matrix at an equilibrium point to classify the type of equilibrium. We did the following examples.

  1. Consider two species in competition with populations xx and yy that satisfy dxdt=2x(1x2)xy\dfrac{dx}{dt} = 2x \left( 1 - \dfrac{x}{2} \right) - xy dydt=3y(1x3)2xy\dfrac{dy}{dt} = 3y \left( 1 - \dfrac{x}{3} \right) - 2xy This system has four different equilibrium points: (0,0),(2,0),(0,3)(0,0), (2,0), (0,3) and (1,1)(1,1). Calculate the Jacobian matrix at (1,1)(1,1) and use it to classify the type of equilibrium there.

  2. Find the Jacobian matrix for the system dRdt=2RRF\dfrac{dR}{dt} = 2R - RF dFdt=5F+RF.\dfrac{dF}{dt} = -5F + RF. Can you tell if the equilibrium (5,2)(5,2) is stable or unstable? Why not?

  3. Find all equilibrium solutions for system below (which models a damped pendulum). dxdt=y\dfrac{dx}{dt} = y dydt=ysinx\dfrac{dy}{dt} = -y -\sin x Classify each equilibrium by type.

Fri, Nov 14

Today we introduced gradient systems which are special planar systems where there is a real valued function G(x,y)G(x,y) such that

dxdt=Gx\dfrac{dx}{dt} = \dfrac{\partial G}{\partial x} dydt=Gy\dfrac{dy}{dt} = \dfrac{\partial G}{\partial y}

Recall from multivariable calulus that the gradient of a function G(x,y)G(x,y) is G=[GxGy].\nabla G = \begin{bmatrix} \frac{\partial G}{\partial x} \\ \frac{\partial G}{\partial y} \end{bmatrix}. So in vector form, a gradient system can be expressed as: d𝐱dt=G.\dfrac{d \mathbf{x}}{dt} = \nabla G. In a gradient system, the solution curves always try to take the path of steepest ascent up to higher values of GG.

  1. Calculate the gradient of G(x,y)=9x2y2G(x,y) = 9 - x^2 - y^2. Describe the behavior and equilibrium solutions of the gradient system 𝐱=G\mathbf{x}' = \nabla G.

  2. Calculate the gradient of the function G(x,y)=cosx12y2G(x,y) = \cos x - \tfrac{1}{2} y^2.

  3. Sketch some level curves for G(x,y)G(x,y) and then sketch some of the gradient vectors. Use those to describe how different solution curves for the system 𝐱=G\mathbf{x}' = \nabla G will behave.

Countours and gradient vectors for G(x,y)=cosx12y2G(x,y) = \cos x - \tfrac{1}{2}y^2. Source: Python

The matrices L=[0110] and R=[0110]L = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} \text{ and } R = \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix} rotate vectors in 2\mathbb{R}^2 to the left and right (respectively) by 90-degrees.

  1. For G(x,y)=cosx12y2G(x,y) = \cos x - \tfrac{1}{2} y^2, what will the solutions of the system 𝐱=RG\mathbf{x}' = R \nabla G look like? How will the solutions behave if you graph them on a contour-plot for GG?

Week 13 Notes

Day Section Topic
Mon, Nov 17 5.2 Hamiltonian Systems
Wed, Nov 19 Review
Fri, Nov 21 Midterm 3
Mon, Nov 23 6.1 The Laplace Transform

Mon, Nov 17

Last time, we ended with a question: what happens if you rotate the direction vectors in a gradient system by 90-degrees to the right? You get a Hamiltonian system. A Hamiltonian system in 2-dimensions is a system of differential equations of the form dxdt=Hy\dfrac{dx}{dt} = \dfrac{\partial H}{\partial y} dydt=Hx\dfrac{dy}{dt} = -\dfrac{\partial H}{\partial x} The function HH is called the Hamiltonian function for the system. Unlike gradient systems, the solution of a Hamiltonian system move along the level curves of HH. Therefore the value of HH is constant on any solution curve. We say that HH is a conserved quantity for the system.

  1. Show that H=12y2cos(x)H = \tfrac{1}{2} y^2 - \cos(x) is a Hamiltonian for the nonlinear pendulum equation dxdt=y\dfrac{dx}{dt} = y dydt=sin(x)\dfrac{dy}{dt} = -\sin(x) We talked about how the terms of the Hamiltonian function for the nonlinear pendulum represent the kinetic energy plus the potential energy of the pendulum.

  2. Consider the system dxdt=2x3y2\dfrac{dx}{dt} = -2x - 3y^2 dydt=3x2+2y\dfrac{dy}{dt} = -3x^2 + 2y If this is a Hamiltonian system, then there is a function HH such that Hy=2x3y2\frac{\partial H}{\partial y} = -2x - 3y^2 and Hx=3x2+2y-\frac{\partial H}{\partial x} = -3x^2 + 2y. Try to integrate these two formulas to find a function HH that works.

    The integral of Hy=2x3y2\frac{\partial H}{\partial y} = -2x - 3y^2 with respect to yy is 2xyy3+C(x)-2xy - y^3 + C(x) where C(x)C(x) can be any function of xx. The integral of Hx=3x22y\frac{\partial H}{\partial x} = 3x^2 - 2y with respect to xx is 2xy+x3+C(y)-2xy + x^3 + C(y). So a combined solution that works is H=x3y32xyH = x^3 - y^3 - 2xy.

Hamiltonian system: solution curves and direction field. Source: Python
Stream plot. Source: Python
  1. If HH is the Hamiltonian function of a Hamilton system, then what is the formula for the Jacobian matrix for the system? What can you say about the trace and determinant of the Jacobian matrix?

  2. What types of equilibria are not possible for Hamiltonian systems?

  3. Show that the system dRdt=2RRFdFdt=5F+RF\begin{align*} \dfrac{dR}{dt} &= 2R - RF \\ \dfrac{dF}{dt} &= -5F + RF \end{align*} is not Hamiltonian by using the fact that fx=gyf_x = -g_y in a Hamiltonian system.

Even though this last example is not a Hamiltonian system, it does have a conserved quantity: R+F5lnR2lnFR + F - 5\ln R - 2 \ln F.

Wed, Nov 19

We went over the review problems for midterm 3.

Mon, Nov 24

Today we introduced the Laplace transform.

The Laplace transform of a function f(t)f(t) is F(s)=(f)=0f(t)estdt.F(s) = \mathcal{L}(f) = \int_0^\infty f(t) e^{-st} \, dt.

  1. We computed (et)\mathcal{L}(e^t) and talked about its domain.

  2. Show that the Laplace transform is linear, i.e.,

After that, we did the following activity about Laplace transforms.


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

Mon, Dec 1

When we work with Laplace transforms it is helpful to have a table. Here is a table of common Laplace transforms.

Original function Laplace transform s-Domain
f(t)=1(F(s))f(t) = \mathcal{L}^{-1}(F(s)) F(s)=(f(t))F(s) = \mathcal{L}(f(t))
eate^{at} 1sa\dfrac{1}{s-a} s>as > a
eattne^{at} t^n, nn \in \mathbb{N} n!(sa)n+1\dfrac{n!}{(s-a)^{n+1}} s>as>a
cos(at)\cos (at) ss2+a2\dfrac{s}{s^2 + a^2} s>0s > 0
sin(at)\sin (at) as2+a2\dfrac{a}{s^2 + a^2} s>0s > 0
H(tc)H(t - c) ecss\dfrac{e^{-cs}}{s} <s<-\infty < s < \infty
δ(tc)\delta(t - c) ecse^{-cs} <s<-\infty < s < \infty

Here are some of the important rules for the Laplace transform.

  Original function Laplace transform
Derivative rules ddtf(t)\dfrac{d}{dt} f(t) sF(s)f(0)s F(s) - f(0)
d2dt2f(t)\dfrac{d^2}{dt^2} f(t) s2F(s)sf(0)f(0)s^2 F(s) - sf(0) - f'(0)
Exponential shift rules eatf(t)e^{at} f(t) F(sa)F(s-a)
H(tc)f(tc)H(t-c) f(t-c) ecsF(s)e^{-cs} F(s)
  1. Use the Laplace transform to convert the initial value problem y+5y+6y=0,y(0)=2,y(0)=3y'' + 5y' + 6y = 0, ~ y(0) = 2, y'(0) = 3 into an algebraic equation, then solve for Y(s)Y(s). (https://youtu.be/3uYb-RhM7lU)

After that, we did a quick review of partial fraction decomposition.

  1. Use the partial fraction decomposition to find constants AA and BB such that 2s+13(s+2)(s+3)=As+2+Bs+3.\dfrac{2s+13}{(s+2)(s+3)} = \dfrac{A}{s+2} + \dfrac{B}{s+3}. Then use the inverse Laplace transform to solve the differential equation. (https://youtu.be/EdQ7Q9VoF44)

  2. Use the Laplace transform to convert the initial value problem yy=et,y(0)=1,y(0)=0y'' - y = e^{-t}, ~ y(0) = 1, y'(0) = 0 into an algebraic equation, then solve for Y(s)Y(s). (https://youtu.be/qZHseRxAWZ8?t=2203)

  1. Use a computer to find the partial fraction decomposition for s2+s+1(s+1)2(s1)\dfrac{s^2 + s + 1}{(s+1)^2 (s-1)}.

    from sympy import *
    s = symbols('s')
    
    # The apart() function in sympy computes the partial fraction decomposition.
    print(apart((s**2 + s + 1)/((s+1)**2 * (s-1))))

We finished by talking about the exponential shift rule for Laplace transforms:

  1. Show that (eatf(t))=F(sa)\mathcal{L}(e^{at} f(t)) = F(s-a).

    By definition, (eatf(t))=0e(sa)tf(t)dt=F(sa)\mathcal{L}(e^{at} f(t)) = \int_0^\infty e^{-(s-a)t} f(t) \, dt = F(s-a).

  2. Use the exponential shift rule to find the inverse Laplace transform of 1(s+1)2.\dfrac{1}{(s+1)^2}.

Wed, Dec 3

Today we introduced the Heavyside step function H(t)H(t) (also known as the unit step function). H(t)={0 if x<01 if x0.H(t) = \begin{cases} 0 & \text{ if } x < 0 \\ 1 & \text{ if } x \ge 0. \end{cases} These are useful because they let us work with differential equations that have discontinuous forcing functions.

Laplace Transform of the Heavyside Function

(H(t))=1s\mathcal{L}(H(t)) = \dfrac{1}{s}

Second Exponential Shift Formula

(H(tc)f(tc))=ecsF(s)\mathcal{L}(H(t-c) f(t-c)) = e^{-cs} F(s)

  1. A simple circuit has a resistor with resistance R=1R = 1 ohm and a capacitor with capacitance C=1C = 1 farad. At time t=0t=0, the circuit is connected to a 1 volt source and then at time t=1t = 1 second the circuit is disconnected. The voltage drop across the capacitor is a function v(t)v(t) that satisfies v+v=H(t)H(t1).v' + v = H(t) - H(t-1).
    1. Assuming that v(0)=0v(0) = 0, find the Laplace transform of this equation.

      sV(s)+V(s)=1setss V(s) + V(s) = \dfrac{1}{s} - \dfrac{e^t}{s}. So V(s)=1ets(s+1)V(s) = \dfrac{1 - e^t}{s(s+1)}.

    2. Find the inverse Laplace transform of V(s)=1ets(s+1)V(s) = \dfrac{1 - e^t}{s(s+1)}. Hint, first find the partial fraction decomposition of (1s(s+1))=As+Bs+1.\left( \dfrac{1}{s(s+1)} \right) = \dfrac{A}{s} + \dfrac{B}{s+1}.

      In the partial fraction decomposition, A=1A = 1 and B=1B = -1, so V(s)=1sets1s+1+ets+1.V(s) = \dfrac{1}{s} - \dfrac{e^t}{s} - \dfrac{1}{s+1} + \dfrac{e^t}{s+1}. So v(t)=H(t)H(t1)H(t)et+H(t1)e(t1).v(t) = H(t) - H(t-1) - H(t)e^{-t} + H(t - 1) e^{-(t-1)}.

After that example, we talked about impulse which is defined as the integral of a force F(t)F(t) with respect to time. I=abF(t)dt.I = \int_a^b F(t) \, dt. The impulse applied to an object is equal to the object’s change in momentum.

In some situations, we may apply a very large force over a very short period of time, for example, hitting something with a hammer. In a case like that, you can model the forcing term using the Dirac delta function δ(t)\delta(t). This isn’t really a function itself, but it is a limiting case of the functions 1h(H(t)H(th))\dfrac{1}{h} (H(t) - H(t-h)) as hh \rightarrow \infty. The Dirac delta function delivers a total impulse of 11 instantaneously.
Although δ(t)\delta(t) is not technically a function, it still has a nice well-defined Laplace transform.

The Dirac Delta Function

This is not actually a function, but it has the following properties.

  1. For any continuous function f(t)f(t): f(t)δ(tc)dt=f(c).\int_{-\infty}^{\infty} f(t) \delta(t-c) \, dt = f(c).

  2. Laplace transform. (δ(tc))=ecs.\mathcal{L}(\delta(t-c)) = e^{-cs}.

Intuitively, think of δ(tc)\delta(t-c) as a function that suddenly delivers an impulse of one at time t=ct=c.

  1. Solve y+y=Aδ(tπ2)y'' + y = A \delta( t - \tfrac{\pi}{2} ) with initial conditions y(0)=1y(0) = 1 and y(0)=0y'(0) = 0. (https://youtu.be/peYvLk_HZdw?t=1265)
    First we take the Laplace transform: s2Y(s)s+Y(s)=Aeπs/2s^2 Y(s) - s + Y(s) = A e^{-\pi s/2} Then we solve for Y(s)Y(s) to get Y(s)=Aeπs/2+ss2+1=Aeπs/2s2+1+ss2+1Y(s) = \dfrac{Ae^{-\pi s/ 2} + s}{s^2 + 1} = \dfrac{A e^{-\pi s / 2}}{s^2 + 1} + \dfrac{s}{s^2 + 1} Taking the inverse Laplace transform, we get y(t)=AH(tπ2)sin(tπ2)+cost.y(t) = A H(t-\tfrac{\pi}{2}) \sin(t - \tfrac{\pi}{2}) + \cos t.

We didn’t get to the next two examples in class today. But they are good practice if you want to try them on your own.

  1. What happens if we apply the impulse at time t=πt = \pi instead?
    This time Y(s)=Aeπs+ss2+1=Aeπss2+1+ss2+1Y(s) = \dfrac{Ae^{-\pi s} + s}{s^2 + 1} = \dfrac{A e^{-\pi s}}{s^2 + 1} + \dfrac{s}{s^2 + 1} Taking the inverse Laplace transform, we get y(t)=AH(tπ)sin(tπ)+cost.y(t) = A H(t-\pi) \sin(t - \pi) + \cos t.
  2. Solve dydt+6y=δ(t1)\dfrac{dy}{dt} + 6y = \delta(t - 1) with y(0)=3y(0) = 3. (https://youtu.be/0gst5RkLtOg)

Mon, Dec 8

Today we went over Homework 11 before the quiz. Then we talked about the final exam.

Originally, I didn’t put any questions about Euler’s method on the final exam review problems, so we did this example in class.

  1. Use Euler’s method with two steps to approximate the solution of this initial value problem with Δt=12\Delta t = \tfrac{1}{2}. dydt=y22y+1 with y(0)=0.\dfrac{dy}{dt} = y^2 - 2y + 1 \text{ with } y(0) = 0.

I’ve actually added that problem to the review problems now and I’ve also posted the solutions.