Math 383 Lecture Notes

A First Course in Differential Equations

Transcribed with minor modifications from my handwritten lecture notes made during Spring 2026 at the University of North Carolina. Because of this, they are not complete course notes. Many things that would have been said out loud during lectures are not repeated here.

Lecture 1

Introduction

What is a differential equation?

Defn. A differential equation is an equation involving the derivatives of an unknown function. Its solutions are the functions satisfying the equation.
Ex \(y'(x)=1\)
Solutions: \(y(x)=x+c\).
Ex \(y'(x)=y(x)\)
Solutions: \(y(x)=c e^{x}\).
Defn. The order of a differential equation is the highest number of derivatives appearing.
Ex
\[y'(x)=y(x)^2+1 \qquad x\,y''(x)+y'(x)=x^2,\qquad y'''(x)=x\,y(x)\]
are respectively equations of first, second, and third order.
Rmk. Most differential equations arising in applications are of first or second order, but higher order equations also play some role.
Defn. An ordinary differential equation (ODE) is a differential equation involving derivatives in a single variable. A partial differential equation (PDE) involves partial derivatives in several variables.
Abbreviations. ODE and PDE (used for both the singular and plural).
Ex The equation \(u'''(x)=u(x)+1\) is an ODE. The equation \(u_{xx}(x,y)+u_{yy}(x,y)=0\) is an example of a PDE.
This course is about ODE only. PDE are very interesting and important and are a major topic of study in pure and applied mathematics, but they have a substantially more complicated theory which will not be discussed in this course. ODE already have a rich and complicated theory which will keep us busy enough. Moreover, understanding ODE is essential for a good understanding of PDE.

Why study differential equations?

Many of the most important laws (or models) in natural sciences, engineering, and even some in social sciences are naturally expressed as differential equations. Any law involving continuous change, and many involving locality (in time or space) are expressed as differential equations.

Ex The following are modeled or governed by differential equations:

  • Newton's laws for classical mechanics, and hence the laws governing any mechanical system.
  • The movement of astronomical bodies, as well as cosmological processes.
  • The laws of hydrodynamics, electricity and magnetism, optics, quantum mechanics.
  • Population dynamics; spread of infectious diseases; concentration of substance in body.
  • Meteorological processes.
  • Reaction rates in chemistry; heat transfer.
  • Option prices; amount owed on a loan; capital accumulation.
  • Pure mathematics (e.g. in geometry); and the theory of differential equations is interesting in its own right.

Some of the above examples are more properly studied as PDE, but even in these cases ODE play an important role in understanding them.

We might say a little bit about some of these applications, but the main focus of the class will be the theory of the equations themselves and the methods of solving them. You can then apply those general methods to whatever application is relevant to you.
You spent the first ~5 years of your mathematical education learning the arithmetic of numbers. Then you learned to solve for unknown numbers standing in relations to others using algebra. Now you have spent the past ~2 years learning the calculus of functions. The theory of differential equations plays for the calculus of functions the same role as the theory of algebraic relations does for numbers.

Differential equations vs algebraic equations

Differential Equations Algebraic Equations
  1. \(y'(x) = y(x)\)
  2. Unknown: a function
  3. \(y(x)=c e^x\)
    a family of solutions
  4. Model change
  5. “Hard”
  6. Cannot generally be solved exactly; e.g. \[ y''(x)=y(x)^2+x. \]
  7. Many techniques to solve approximately: Euler's method (and better techniques)
  1. \(x^2-2x-8=0\)
  2. Unknown: a number
  3. \(x=4,-2\)
    possibly several solutions
  4. Model fixed relation
  5. “Easy”
  6. Cannot generally be solved exactly; e.g. \(x^5-x-1=0\)
  7. Many techniques to solve approximately: Newton's method
Rmk. Few differential equations can be solved analytically, even ones that look quite simple.

Lecture 2

First-order equations

Standard form: \[y'=f(x,y).\]
Ex Rewrite \[ x\,y' + y^2 - x = 0 \] as \[ y' = 1 - \frac{y^2}{x}. \]
Rmk. Sometimes it is subtle to solve for \(y'\). For example, if \[ y^2 + (y')^2 = 1, \] then one solution is \(y=\sin(x+c)\). Also, \[ (y')^2 = 1 - y^2 \quad \Rightarrow \quad y' = \pm\sqrt{1-y^2}. \]
Ex \[ y' e^{y'} + y\,y' = x \] is first order, but it is hard to solve explicitly for \(y'\) as a function of \((x,y)\).
Ex If \(y' = f(x)\), then \[ y(x) = \int_0^x f(t)\,dt + C. \]

Separable equations

Form. If \(y' = f(x)\,g(y)\), then \[ \frac{y'}{g(y)} = f(x), \] so integrating both sides gives \[ \int \frac{1}{g(y)}\,dy = \int f(x)\,dx. \]
Ex \(y' = x y\): \[ \frac{y'}{y} = x \quad\Rightarrow\quad \int \frac{1}{y}\,dy = \int x\,dx \quad\Rightarrow\quad \ln|y| = \frac{x^2}{2}+C \] hence \[ y = C e^{x^2/2}. \]
Ex \(y' = \alpha y\) gives \(y = C e^{\alpha x}\).
Ex \[ y' = y(1-y). \] Then \[ \int \frac{1}{y(1-y)}\,dy = \int 1\,dx. \] Using \[ \frac{1}{y(1-y)} = \frac{1}{y} + \frac{1}{1-y}, \] we get \[ \ln|y| - \ln|1-y| = x + C \quad\Rightarrow\quad \ln\!\left(\frac{y}{1-y}\right)=x+C. \] Exponentiating: \[ \frac{y}{1-y} = e^{x+C}. \] Solving for \(y\): \[ y(x) = \frac{e^{x+C}}{1+e^{x+C}} = \frac{1}{1+e^{-x-C}}. \] If \(y(0)=\tfrac12\), then \(C=0\) and \[ y(x)=\frac{1}{1+e^{-x}}. \]
Diagram (from notes): an S-shaped logistic curve increasing through \((0,\tfrac12)\) and approaching \(1\) as \(x\to+\infty\).

Linear equations

Standard form. \[ (*)\qquad y' + p(x)\,y = q(x). \]
“Linear” here means \(f(x,y)\) is linear as a function of \(y\).
Rmk. A first-order equation is “linear” if it can be put into this form, not necessarily if it is already written this way. For example, \(a(x) y' + b(x) y + c(x)=0\) is linear.
Ex \[ y' + \frac{1}{x}y = x^3. \] Multiply by \(x\) to get \[ x y' + y = x^4. \] Note that \((xy)' = x y' + y\), hence \[ (xy)' = x^4 \quad\Rightarrow\quad xy = \frac{x^5}{5}+C \quad\Rightarrow\quad y = \frac{x^4}{5} + \frac{C}{x}. \]
Integrating factor method. Multiply \((*)\) by a function \(m(x)\) so that the left-hand side becomes a single derivative: \[ m y' + m p y = m q. \] Since \[ (my)' = m y' + m' y, \] we want \(m' = m p\), i.e. \[ \frac{m'}{m} = p(x). \] Thus one can take \[ m(x) = e^{\int p(x)\,dx}. \] Then \[ (my)' = m q \quad\Rightarrow\quad my = \int m q\,dx \quad\Rightarrow\quad y = \frac{1}{m}\int m q\,dx. \]
Ex \[ y' - x^2 y = x e^{x^3/3}. \] Here \(p(x)=-x^2\), so \[ m(x)=e^{\int -x^2\,dx}=e^{-x^3/3}. \] Then \[ (m y)' = m q = e^{-x^3/3}\cdot x e^{x^3/3} = x, \] so \[ m y = \int x\,dx = \frac{x^2}{2}+C, \qquad y = e^{x^3/3}\left(\frac{x^2}{2}+C\right). \]
Defn. An initial value problem (IVP) is a differential equation together with a prescribed value of the unknown function at some point.

Lecture 3

Examples of initial value problems

Ex Solve \[ y'=\alpha y+\beta,\qquad y(0)=0. \] Rewrite: \[ y' - \alpha y = \beta. \] Here \(p(x)=-\alpha\), so \(m(x)=e^{\int -\alpha\,dx}=e^{-\alpha x}\). Multiply through: \[ (e^{-\alpha x}y)' = \beta e^{-\alpha x}. \] Integrate: \[ e^{-\alpha x}y = -\frac{\beta}{\alpha}e^{-\alpha x} + C \quad (\alpha\neq 0). \] Using \(y(0)=0\): \[ 0 = -\frac{\beta}{\alpha} + C \quad\Rightarrow\quad C=\frac{\beta}{\alpha}. \] Hence \[ y(x)=\frac{\beta}{\alpha}\bigl(e^{\alpha x}-1\bigr),\qquad (\alpha\neq 0). \]
Ex Solve \[ x y'=\alpha y+x^2,\quad \alpha\neq 2,\qquad y(1)=1. \] Rewrite: \[ y' - \frac{\alpha}{x}y = x. \] Then \(p(x)=-\alpha/x\), so \[ m(x)=e^{\int -\alpha/x\,dx} = e^{-\alpha\ln x}=x^{-\alpha}. \] Now \[ (m y)' = m q = x^{-\alpha}\cdot x = x^{1-\alpha}. \] Integrate: \[ m y = \int x^{1-\alpha}\,dx = \frac{x^{2-\alpha}}{2-\alpha}+C, \] so \[ y(x)=\frac{x^2}{2-\alpha}+C x^\alpha. \] Impose \(y(1)=1\): \[ 1=\frac{1}{2-\alpha}+C \quad\Rightarrow\quad C=1-\frac{1}{2-\alpha}=\frac{1-\alpha}{2-\alpha}. \] Therefore \[ y(x)=\frac{x^2}{2-\alpha}+\frac{1-\alpha}{2-\alpha}x^\alpha. \]

Slope fields and isoclines

If \(y(x)\) solves \(y'=f(x,y)\), then the graph \((x,y(x))\) has slope \[ y'(x)=f(x,y(x)) \] at the point \((x,y(x))\). This motivates drawing a slope field.
Ex \[ y'=-xy. \]
Diagram (from notes): a slope field for \(y'=-xy\) on the \(xy\)-plane, together with several integral curves drawn tangent to the short line segments.
Isoclines. Draw curves along which the slope is constant: \[ f(x,y)=c \quad\Rightarrow\quad -xy=c \quad\Rightarrow\quad y=-\frac{c}{x}. \]
Diagram (from notes): isoclines \(y=-c/x\) for several \(c\) values (including \(c=0\)), with representative slope segments and sample integral curves.
Ex Separate variables: \[ \frac{y'}{y}=-x \quad\Rightarrow\quad (\ln|y|)'=-x \quad\Rightarrow\quad \ln|y|=-\frac{x^2}{2}+C \] hence \[ y=C e^{-x^2/2}. \]
Rmk. Integral curves cannot cross: if two solutions met at a point, they would have the same slope there and hence coincide locally.

Existence and uniqueness

Thm. Existence (Cauchy–Peano). If \(f(x,y)\) is continuous near \((x_0,y_0)\), then the IVP \[ y'=f(x,y),\qquad y(x_0)=y_0 \] has some solution on some interval containing \(x_0\).
Thm.Existence & Uniqueness (Picard–Lindelöf). If \(f(x,y)\) is continuous near \((x_0,y_0)\) and \(f_y(x,y)\) is continuous near \((x_0,y_0)\), then the IVP \[ y'=f(x,y),\qquad y(x_0)=y_0 \] has one and only one solution on some interval containing \(x_0\).
(“Near” means: continuous at all points sufficiently close to \((x_0,y_0)\).)
Ex Let \(f(x,y)=y/x\). Then \[ y'=\frac{y}{x} \quad\Rightarrow\quad \frac{y'}{y}=\frac{1}{x} \quad\Rightarrow\quad \ln|y|=\ln|x|+C \quad\Rightarrow\quad y=Cx. \] For the IVP \(y(1)=y_0\), the solution is \(y(x)=y_0 x\). But the IVP \(y(0)=y_0\) has no solution if \(y_0\neq 0\).
Diagram (from notes): a pencil of straight lines through the origin representing the family \(y=Cx\).

Lecture 4

Nonuniqueness

Existence/uniqueness can fail. Continuing the example \(y' = y/x\):
  • At \(x=0\) the right-hand side \(y/x\) is not continuous (so the existence theorem does not apply).
  • If the IVP is \(y(0)=0\), then every line \(y=cx\) is a solution: existence holds but uniqueness fails.
Ex \(y' = y^{1/3}\) (uniqueness failure)
\[\frac{dy}{y^{1/3}} = dx.\]
\[\int y^{-1/3}\,dy = \int 1\,dx\;\Rightarrow\;\frac{3}{2}y^{2/3} = x + C.\]
\[y^{2/3} = \frac{2}{3}(x-a),\qquad a=-C.\]
For \(x\ge a\):
\[y(x)=\Big(\tfrac{2}{3}(x-a)\Big)^{3/2}.\]
Also \(y(x)\equiv 0\) is a solution.
For any \(a\ge 0\), another solution to the IVP \(y(0)=0\) is \[ y(x)=\begin{cases} 0, & x\le a,\\ \big(\tfrac{2}{3}(x-a)\big)^{3/2}, & x\ge a. \end{cases} \]
Diagram (from notes): several solution curves through \((0,0)\), including the zero solution and curves that peel off after a delay.
Uniqueness \(\Rightarrow\) non-crossing. If the IVP has a unique solution through each point (in a region), then integral curves cannot cross: if two solutions met at a point, they would solve the same IVP there and hence must coincide (at least locally).
Diagram (from notes): a “NO” sketch indicating solution curves cannot cross and cannot be tangent and then split.

Blow-up

Ex Finite-time blow-up
\[y' = y^2,\qquad y(0)=1.\]
\[\frac{dy}{y^2} = dx\;\Rightarrow\;-\frac{1}{y}=x+C.\]
Using \(y(0)=1\) gives \(C=-1\), so
\[y(x)=\frac{1}{1-x}.\]
This blows up as \(x\to 1^-\). The maximal interval of existence is \(( -\infty, 1)\).
Moral. For sufficiently nice \(f(x,y)\), IVPs have (at least) local solutions, and often can be extended for a long time. With few exceptions, we will be in situations where the local existence and uniqueness theorem applies.
What does it mean to “solve” an ODE? Informally: give a formula for the solution in terms of familiar functions (polynomials, exponentials/logs, trig functions, powers/roots). Often a solution exists but no expression in elementary functions is available.
Simplest class: equations of the form \(y'=f(x)\).
Ex

Solving \(y'=f(x)\).

If \(y'=f(x)\) and \(y(x_0)=y_0\), then
\[y(x)=y_0+\int_{x_0}^{x} f(t)\,dt.\]
Even here we may not be able to compute the integral explicitly.
Example: \(y' = e^{-x^2}\) gives \(y(x)=y_0+\int_{x_0}^{x} e^{-t^2}\,dt\) (not elementary).
Similar issue for linear ODEs. For \(y' + p(x)y = q(x)\), the integrating factor method involves \(\int p(x)\,dx\). For example, if \(y' + \frac{\sin x}{x}y = 1\), an integrating factor is
\[m(x)=\exp\Big(\int \frac{\sin x}{x}\,dx\Big).\]
Reduced to quadrature. For the same example \(y' + (\sin x/x)y = 1\), a convenient choice is
\[m(x)=\exp\Big(\int_0^x \frac{\sin t}{t}\,dt\Big).\]
Then a solution can be written as
\[y(x)=\frac{1}{m(x)}\int_{x_0}^{x} m(t)\,dt\]
(with the constant fixed by the initial condition).
Ex Implicit solution (separable, but not explicitly solvable for \(y\))
\[y' = \frac{2x e^{-y}}{y+1}.\]
Separate:
\[(y+1)e^{y}\,y' = 2x.\]
Note
\[\frac{d}{dx}(y e^{y}) = (y+1)e^{y}y'.\]
Integrate:
\[y e^{y} = x^2 + C.\]
We may not be able to solve explicitly for \(y\) using elementary functions, but the implicit relation still characterizes solutions.
Other methods when no closed form exists.
  • Power series solutions: \(y(x)=\sum_{n\ge 0} c_n x^n\) (solve for coefficients).
  • Numerical methods (Euler / Runge–Kutta, etc.).
  • Qualitative slope-field / phase-line analysis.

Autonomous equations

Defn. An autonomous first-order ODE has the form \(y' = f(y)\).
  • If \(f(y)>0\) on an interval, solutions are increasing there.
  • If \(f(y)<0\) on an interval, solutions are decreasing there.
  • Constant solutions occur at equilibria \(y=y_*\) where \(f(y_*)=0\).
A helpful picture is either the graph of \(f(y)\) vs. \(y\), or a phase line on the \(y\)-axis.

Stability of equilibria

If \(f\) is differentiable and \(f(y_*)=0\):
  • if \(f'(y_*)>0\), the equilibrium is unstable (trajectories move away),
  • if \(f'(y_*)<0\), the equilibrium is stable (trajectories move toward).
Diagram (from notes): a sketch of \(f(y)\) crossing the axis, with arrows on a phase line indicating flow toward/away from equilibria.

Lecture 5

Note. The first handwritten page of Lecture 5 is a repeat of the last page of Lecture 4 (autonomous equations). That content is included only once (in Lecture 4).

First-order ODEs solvable exactly.
  • Separable: \(y' = f(x)g(y)\).
  • Linear: \(y' = p(x)y + q(x)\).

Substitutions

Ex Substitution \(u=y+x\)
\[y'=(x+y)^2.\]
Set \(u=y+x\). Then \(u'=y'+1=(x+y)^2+1=u^2+1\), so
\[\tan^{-1}(u)=x-x_0\quad\Rightarrow\quad u=\tan(x-x_0).\]
Hence
\[y=-x+\tan(x-x_0).\]

Homogeneous equations

Defn. A homogeneous first-order ODE has the form \(y'=F(y/x)\). Let \(u=y/x\) (so \(y=ux\)). Then \(y'=u'x+u\), and
\[u'x+u=F(u)\quad\Rightarrow\quad u'=\frac{F(u)-u}{x}.\]
This is separable: \(\displaystyle \frac{du}{F(u)-u}=\frac{dx}{x}\).
Ex Solve \(x^2y'+2xy+y^2=0\), \(y(1)=1\)
\[x^2y'+2xy+y^2=0\quad\Rightarrow\quad y'=-2\frac{y}{x}-\left(\frac{y}{x}\right)^2.\]
Set \(y=ux\), so \(y'=u'x+u\). Then
\[xu'+3u+u^2=0.\]
Separate and integrate:
\[\frac{du}{u^2+3u}=-\frac{dx}{x},\qquad \frac{1}{u(u+3)}=\frac{1}{3}\left(\frac{1}{u}-\frac{1}{u+3}\right).\]
With \(u(1)=1\), this gives
\[\frac{u}{u+3}=\frac{1}{4x^3}.\]
Solve for \(u\): \(u=\frac{3}{4x^3-1}\). Therefore
\[y=ux=\frac{3x}{4x^3-1}.\]

Exact equations

Defn. An equation is exact if its solutions are level curves \(F(x,y)=C\). Differentiating \(F(x,y(x))=C\) gives
\[F_x(x,y)+F_y(x,y)\,y'=0\quad\Rightarrow\quad y'=-\frac{F_x}{F_y}.\]
Often written as \(F_x\,dx+F_y\,dy=0\). In practice we are given
\[M(x,y)\,dx + N(x,y)\,dy = 0\]
and we seek \(F\) such that \(F_x=M\) and \(F_y=N\).
Ex \(2xy\,dx + (x^2+1)\,dy = 0\)
Take \(F(x,y)=x^2y+y\). Then \(F_x=2xy\) and \(F_y=x^2+1\).
Hence the solutions are
\[x^2y+y=C\quad\Rightarrow\quad (x^2+1)y=C\quad\Rightarrow\quad y=\frac{C}{x^2+1}.\]
Test for exactness. If an equation \(M(x,y)\,dx + N(x,y)\,dy = 0\) is exact (i.e. it comes from some level-set equation \(F(x,y)=C\)), then—provided the relevant partial derivatives exist and are continuous—a necessary condition is
\(M_y = N_x\).
Here \(M_y\) means \(\partial M/\partial y\) and \(N_x\) means \(\partial N/\partial x\). In practice, you compute \(M_y\) and \(N_x\) and check whether they match on a region.
Ex \(y^5+(5y^4x+2y)y'=0\)
Rewrite as \(y^5\,dx+(5y^4x+2y)\,dy=0\).