1  Introduction to Differential Equations

Learning objectives \(\,\) After this chapter you should be able to

  • classify a differential equation by type (ODE or PDE), \(\,\)order and linearity
  • verify that a function, \(\,\)explicit or implicit, \(\,\)is a solution on an interval, \(\,\)and recognize families of solutions
  • state the conditions under which a first-order initial-value problem has a unique solution
  • translate a physical situation, \(\,\)such as radioactive decay or a draining tank, \(\,\)into a differential equation

1.1 Definitions and Terminology

  • A differential equation (DE) is an equation containing the derivatives of one or more dependent variables with respect to one or more independent variables

  • Notation

    • Leibniz notation \(~\displaystyle\color{blue}{\frac{d^2y}{dx^2}}\)

    • Prime notation \(~\color{blue}{y''}\)

    • Newton’s dot notation \(~\color{blue}{\ddot{y}}\)

    • Subscript notation \(~\color{blue}{u_{xx} + u_{yy} = 0}\)

1.1.1 Classification by Type

  • Ordinary differential equation (ODE): \(\,\) Derivatives are with respect to a single independent variable

    \[\frac{dx}{d\color{blue}{t}} + \frac{dy}{d\color{blue}{t}} = 3x + 2y\]

  • Partial differential equation (PDE): \(\,\) Derivatives are with respect to two or more independent variables

    \[\frac{\partial u}{\partial \color{blue}{y}} = -\frac{\partial u}{\partial \color{blue}{x}}\]

1.1.2 Classification by Order

  • The order of an ODE or PDE is the order of the highest derivative in the equation

    \[\underbrace{\color{blue}{\frac{d^2y}{dx^2}}}_{\mathrm{highest\; order}} +5\left ( \frac{dy}{dx} \right )^3 - 4y = e^x\]

    \[\underbrace{2\color{blue}{\frac{\partial^4 u}{\partial x^4}}}_{\mathrm{highest\; order}} +\frac{\partial^2 u}{\partial t^2} = 0\]

1.1.3 Classification by Linearity

  • An \(n\)-th order ODE, \(F\left( x, y, y', \cdots, y^{(n)} \right) = 0\), \(\,\)is linear in the variable \(y\,\) if \(\,F\) is linear in \(y, y',\cdots,y^{(n)}\)

  • An ODE is nonlinear if

    • The coefficients of \(y, y',\cdots,y^{(n)}\) contain the dependent variable \(y\) or its derivatives
    • Powers of \(y, y',\cdots,y^{(n)}\) appear in the equation or
    • Nonlinear functions of the dependent variable or its derivatives (e.g., \(\sin y\) or \(e^{y'}\)) appear in the equation

1.1.4 Solution of an ODE

  • Any function \(\phi\), defined on an interval \(I\) and possessing at least \(n\) derivatives that are continuous on \(I\), which when substituted into an ODE reduces the equation to an identity, is a solution
  • Interval \(I\) can be an open interval \((a,b)\), a closed interval \([a,b]\), an infinite interval \((a,\infty)\), etc.
  • A solution of a differential equation that is identically zero on an interval \(I\) is a trivial solution
  • The graph of a solution \(\phi\) of an ODE is a solution curve and it is continuous on its interval \(I\) while the domain of \(\phi\) may differ from the interval \(I\)
  • An explicit solution is one in which the dependent variable is expressed solely in terms of the independent variable and constants
  • \(G(x,y)=0\,\) is an implicit solution, if at least one function \(\phi\) exists, that satisfies the relation \(G\) and the ODE on \(I\)

1.1.5 Families of Solutions

  • Similar to integration, we obtain a solution to a first-order differential equation containing an arbitrary constant \(c\)

  • A solution with a constant \(c\) represents a set \(G(x,y,c)=0\) of solutions, called a one-parameter family of solutions

  • An \(n\)-parameter family of solutions \[ G(x,y,c_1,c_2,\cdots,c_n)=0 \]

    solves an \(n\)-th order differential equation

1.1.6 Systems of Differential Equations

  • Two or more equations involving the derivatives of two or more unknown functions of a single independent variable are called a system of differential equations

    \[ \begin{aligned} \frac{dx}{dt} &= f(t,x,y) \\ \frac{dy}{dt} &= g(t,x,y) \end{aligned}\]

  • A solution of a system is a set of functions defined on a common interval \(I\) that satisfies each equation of the system on this interval

1.2 Initial-Value Problems - IVP

In an IVP, we seek a solution \(y(x)\) of a differential equation so that \(y(x)\) satisfies initial conditions at \(x_0\)

  • \(n\)-th order differential equation and Initial conditions

    \[ \begin{aligned} \frac{d^ny}{dx^n} &= f \left ( x,y,y',\cdots,y^{(n-1)} \right ) \\ y(x_0) &= y_0, \;y'(x_0) = y_1, \cdots, \;y^{(n-1)}(x_0) = y_{n-1} \\ \\ &\Downarrow \\ \\ \frac{d\mathbf{y}}{dx} &= \mathbf{f}(x, \mathbf{y}), \;\;\mathbf{y}(x_0)=\mathbf{y}_0 \end{aligned}\]

When solving an IVP, consider whether a solution exists and whether the solution is unique

  • Existence: \(\,\) Does the differential equation possess solutions and do any of the solution curves pass through the initial point \((x_0, y_0)\)?
  • Uniqueness: \(\,\) When can we be certain there is precisely one solution curve passing through the initial point \((x_0, y_0)\)?

Theorem 1.1 gives conditions that are sufficient to guarantee the existence and uniqueness of a solution \(y(x)\) to a first-order IVP

Let \(R\) be a rectangular region in the \(xy\)-plane defined by \(a\le x\le b\), \(c\le y\le d\) that contains the point \((x_0,y_0)\) in its interior. If \(f(x,y)\) and \(\partial f/\partial y\) are continuous on \(R\), then there exists some interval \(I_0\): \((x_0-h,\,x_0+h)\), \(h>0\), contained in \([a,b]\), and a unique function \(y(x)\), defined on \(I_0\), that is a solution of the IVP \(\;dy/dx=f(x,y)\), \(y(x_0)=y_0\)

Example \(\,\) First-order IVP

  • \(y(x)=ce^x\) is a one-parameter family of solutions of the first-order DE \(~y'=y\)

  • Find a solution of the first-order IVP with initial condition \(y(0)=3\)

Solution

  • From the initial condition, we obtain \(3=ce^0\)

  • Solving, we find \(c=3\)

  • The solution of the IVP is \(y=3e^x\)

Example \(\,\) Second-order IVP

  • \(x(t) = c_1 \cos 4t +c_2 \sin 4t\) \(\,\)is a two-parameter family of solutions of the second-order DE \(~x''+16x=0\)

  • Find a solution of the second-order IVP with initial conditions \(~x\left( \frac{\pi}{2} \right) =-2, \;x'\left (\frac{\pi}{2} \right)=1\)

Solution

  • Substituting for initial conditions and solving for constants, we find \(c_1=-2\) and \(c_2=1/4\)
  • The solution of the IVP is \(~x(t)=-2\cos 4t +\frac{1}{4}\sin 4t\)

Try it in Python: Solve initial-value problems symbolically with sympy.dsolve(..., ics=...): Section 22.3

1.3 Differential Equations as Mathematical Models

  • A mathematical model is a description of a system or a phenomenon
  • Differential equation models are used to describe behavior in various fields
    • Biology
    • Chemistry
    • Physics
  • Steps of the modeling process

Example \(\,\) Radioactive Decay

  • In modeling the phenomenon, it is assumed that the rate \(\displaystyle\frac{dA}{dt}\) at which the nuclei of a substance decay is proportional to the amount \(A(t)\) remaining at time \(t\) given an initial amount of radioactive substance on hand \(A_0\)

    \[\frac{dA}{dt} = -kA, \;A(0)=A_0\]

  • This differential equation also describes a first-order chemical reaction

Example \(\,\) Draining Tank

  • Torricelli’s law states that the exit speed \(v\) of water through a sharp-edged hole at the bottom of a tank filled to a depth \(h\) is the same as the speed it would acquire falling from a height \(h\), \(\,\)\(v=\sqrt{2gh}\)

  • The volume \(V\) of water leaving the tank per second is the area of the hole \(A_h\) times the exit speed \[\frac{dV}{dt}=-A_h\sqrt{2gh}\]

  • The volume in the tank at \(t\) \(\,\)is\(\,\) \(V(t)=A_w h\), \(\,\) in which \(\,\) \(A_w\) is the constant area of the upper water surface

  • Combining expressions gives the differential equation for the height of water at time \(t\) \[\frac{dh}{dt}=-\frac{A_h}{A_w}\sqrt{2gh}\]

Summary

Concept Key point
Order order of the highest derivative in the equation
Linear ODE \(a_n(x)y^{(n)}+\cdots+a_1(x)y'+a_0(x)y=g(x)\): \(\,\)linear in \(y, y', \cdots, y^{(n)}\)
Solution a function \(\phi\) on an interval \(I\) that reduces the ODE to an identity; \(\,\)explicit \(y=\phi(x)\) or implicit \(G(x,y)=0\)
\(n\)-parameter family \(G(x,y,c_1,\cdots,c_n)=0\) solves an \(n\)-th order ODE
Initial-value problem ODE with \(y(x_0)=y_0,\ y'(x_0)=y_1,\ \cdots,\ y^{(n-1)}(x_0)=y_{n-1}\)
Existence and uniqueness \(y'=f(x,y)\), \(\,y(x_0)=y_0\): \(\,\)if \(f\) and \(\partial f/\partial y\) are continuous on a rectangle containing \((x_0,y_0)\), \(\,\)there is exactly one solution near \(x_0\)
Models radioactive decay \(\dfrac{dA}{dt}=-kA\); \(\quad\) draining tank \(\dfrac{dh}{dt}=-\dfrac{A_h}{A_w}\sqrt{2gh}\)

\(~\)

Worked Exercises

1.2: 1. \(~y=1/(1 +c_1 e^{-x})\) is a one-parameter family of solutions of the first-order DE \(y'=y -y^2\). \(\,\) Find a solution of the first-order IVP consisting of this differential equation and the given initial condition:

\[y(0)=-\frac{1}{3}\]

Solution

\[ \begin{aligned} y &= \frac{1}{1 +c_1 e^{-x}}\\ &\Downarrow {\scriptstyle \text{at } x = 0}\\ -\frac{1}{3} &= \frac{1}{1 +c_1} \\ &\Downarrow \\ c_1 &= -4 \\ &\Downarrow \\ y &= \frac{1}{1 -4 e^{-x}} \end{aligned}\]

1.2: 3. \(~y=1/(x^2 +c)\) is a one-parameter family of solutions of the first-order DE \(y' +2xy^2=0\). Find a solution of the first-order IVP consisting of this differential equation and the given initial condition. Give the largest interval \(I\) over which the solution is defined

\[y(2)=\frac{1}{3}\]

Solution

\[ \begin{aligned} y &= \frac{1}{x^2 +c}\\ &\Downarrow {\scriptstyle \text{at } x = 2}\\ \frac{1}{3} &= \frac{1}{4 +c} \\ &\Downarrow \\ c = -1 \, &, \;\; I =(1,\infty) \\ &\Downarrow \\ y &= \frac{1}{x^2 -1} \end{aligned}\]

import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(-5, 5, 200)
y = 1.0 /(x**2 -1)

threshold = 20
y[y > threshold] = np.inf
y[y <-threshold] = np.inf

plt.plot(x,y)
plt.scatter(2, 1/3, color='red')

plt.title(r'$y=\frac{1}{x^2 -1}$')
plt.xlabel('$x$')
plt.ylabel('$y$')
plt.grid()

plt.show()

Exercises 1.2: 3

1.2: 7. \(\,x(t)=c_1\cos t +c_2\sin t\) is a two-parameter family of solutions of the second-order DE \(x''+x=0\). Find a solution of the second-order IVP consisting of this differential equation and the given initial conditions

\[x(0)=-1, \; x'(0)=8\]

Solution

\[ \begin{aligned} x(t) &= c_1\cos t +c_2\sin t \\ &\Downarrow \;{\scriptstyle x(0)=-1, \; x'(0)=8}\\ -1 &= c_1 \\ 8 &= c_2 \\ &\Downarrow \\ x(t) &= -\cos t +8\sin t \end{aligned}\]

1.2: 17. \(\,\) Determine a region of the xy-plane for which the given differential equation would have a unique solution whose graph passes through a point \((x_0, y_0)\) in the region.

\[\frac{dy}{dx}=y^{2/3}\]

Solution

Step 1: \(~\)Identify the Function and Its Partial Derivative

Let:

\[f(x, y) = y^{2/3}\]

Then the partial derivative with respect to \(y\) is:

\[\frac{\partial f}{\partial y} = \frac{2}{3} y^{-1/3}\]

Step 2: \(~\)Analyze Continuity

  • \(f(x, y) = y^{2/3}\) is continuous for all real values of \(x\) and \(y\)

  • However, \(\frac{\partial f}{\partial y} = \frac{2}{3} y^{-1/3}\) is undefined at \(y = 0\), since \(y^{-1/3}\) is not defined at \(y = 0\)

Step 3: \(~\)Apply the Existence and Uniqueness Theorem

  • Both \(f\) and \(\partial f/\partial y\) are continuous in the half-plane \(y>0\) and in the half-plane \(y<0\)
  • Hence the theorem guarantees a unique solution through every point \((x_0, y_0)\) with \(y_0\neq 0\): \(\,\)the region can be taken as either half-plane \(y>0\) or \(y<0\)
  • The theorem gives only a sufficient condition, so it says nothing at \(y_0=0\). \(\,\)There uniqueness actually fails: \(\,\)both \(y=0\) and \(y=(x-x_0)^3/27\) satisfy \(y'=y^{2/3}\) and \(y(x_0)=0\)

\(~\)

1.2: 29.

  1. By inspection, find a one-parameter family of solutions of the differential equation \(xy'=y\). Verify that each member of the family is a solution of the initial value problem \(xy'=y, \,y(0)=0\)

  2. Explain part 1. by determining a region \(R\) in the \(xy\)-plane for which the differential equation \(xy'=y\) would have a unique solution through a point \((x_0, y_0)\) in \(R\)

  3. Verify that the piecewise-defined function

    \[y= \begin{cases} 0, & x < 0 \\ x, & x \ge 0 \end{cases}\]

    satisfies the condition \(y(0)=0\). Determine whether this function is also a solution of the initial-value problem in part 1

Solution

  1. By inspection, \(\,y=cx\) satisfies \(xy'=x\cdot c=y\) for every constant \(c\). \(\,\)Every member satisfies \(y(0)=c\cdot 0=0\), \(\,\)so the IVP \(xy'=y\), \(y(0)=0\) has infinitely many solutions

  2. In normal form \(\,y'=f(x,y)=y/x\), \(\,\)and \(f\) and \(\partial f/\partial y=1/x\) are continuous wherever \(x\neq 0\). \(\,\)So a region \(R\) is either half-plane \(x>0\) or \(x<0\); \(\,\)through any point \((x_0,y_0)\) with \(x_0\neq 0\) there is a unique solution. \(\,\)The initial point \((0,0)\) lies in no such region, \(\,\)so the theorem does not apply there, \(\,\)which is consistent with part 1

  3. The piecewise function satisfies \(y(0)=0\), \(\,\)and it satisfies \(xy'=y\) for \(x<0\) (\(0=0\)) and for \(x>0\) (\(x\cdot 1=x\)). \(\,\)However, \(\,\)its left derivative at \(x=0\) is \(0\) and its right derivative is \(1\), \(\,\)so \(y'(0)\) does not exist. \(\,\)Therefore it is not a solution of the IVP on any interval containing \(x=0\)

\(~\)

1.3: 5. \(\,\) A cup of coffee cools according to Newton’s law of cooling. Use data from the graph of the temperature \(T(t)\) in figure to estimate the constants \(T_m\), \(T_0\), and \(k\) in a model of the form of the first-order initial-value problem

\[ \frac{dT}{dt}=k(T -T_m), \;\;T(0)=T_0 \]

Solution

  • The solution of the IVP is \(\,T(t)=T_m+(T_0-T_m)e^{kt}\)

  • \(T_0=T(0)\) is read at \(t=0\): \(\,T_0\approx 175\)

  • \(T_m=\lim_{t\to\infty}T(t)\) is the level the curve approaches: \(\,T_m\approx 75\)

  • \(k\) follows from one more point on the curve. \(\,\)The curve reaches \(T\approx 100\) at \(t\approx 17\) min, \(\,\)so

    \[ k=\frac{1}{t}\ln\frac{T-T_m}{T_0-T_m}\approx \frac{1}{17}\ln\frac{100-75}{175-75}=\frac{\ln 0.25}{17}\approx -0.08\ \text{min}^{-1} \]

    (equivalently, \(\,k\) is the slope of \(\ln\left[(T-T_m)/(T_0-T_m)\right]\) plotted against \(t\))

1.3: 19. After a mass \(m\) is attached to a spring, it stretches \(s\) units and then hangs at rest in the equilibrium position as shown in Figure (b). After the spring/mass system has been set in motion, let \(x(t)\) denote the directed distance of the mass beyond the equilibrium position. As indicated in Figure (c), assume that the downward direction is positive, that the motion takes place in a vertical straight line through the center of gravity of the mass, and that the only forces acting on the system are the weight of the mass and the restoring force of the stretched spring. Use Hooke’s law: The restoring force of a spring is proportional to its total elongation. Determine a differential equation for the displacement \(x(t)\) at time \(t\)

Solution

  • Equilibrium (Figure (b)): \(\,\)the spring is stretched by \(s\) and the weight is balanced by the spring force (Hooke’s law, spring constant \(k\))

    \[ mg=ks \]

  • In motion (Figure (c)): \(\,\)the total elongation is \(s+x\) (downward positive), \(\,\)so the forces on the mass are the weight \(mg\) (down) and the restoring force \(-k(s+x)\). \(\,\)Newton’s second law gives

    \[ m\frac{d^2x}{dt^2}=mg-k(s+x)=\underbrace{mg-ks}_{0}-kx \]

  • Hence

    \[ m\frac{d^2x}{dt^2}+kx=0 \]

    Measuring \(x\) from the equilibrium position removes the weight from the equation