Math216 Introduction to Differential Equations

Deniz Bilman, Department of Mathematics, University of Michigan

Lecture 3

We have seen so far that we can solve 2 types of ODEs:

  • ODEs of the form $\frac{dy}{dt}= a y + b$ for real numbers $a$ and $b$,
  • Separable equations $\frac{dy}{dt}= p(t)\cdot q(y)$.

Today we cover another class of ODEs that we can solve.

First order linear ordinary differential equations

Consider the ODEs of the form

$$ \frac{dy}{dt} + p(t)y = g(t), $$

where $p(t)$ and $g(t)$ are functions of the independent variable $t$. This is a first order linear ODE: the highest derivative of $y$ that shows up is the first derivative and the rest is a linear function of the dependent variable $y$. Additionally, if the term $g(t)$ which does not involve the dependent variable is absent, the equation is called homogeneous. In case $g(t)$ is present, it is called inhomogenous. Here are some examples:

  • $y' = t^2\sin(t) y$, homogenous linear 1st order ODE.
  • $y' = \sin(y) t$, homogenous nonlinear 1st order ODE.
  • $t y' = y^2 - t$, nonhomogenous nonlinear 1st order ODE
  • $t^2 y' = e^{-t}y +2$, nonhomogenous linear 1st order ODE.

Solution strategy

The solution strategy is again to transform the ODE into the form

$$ \frac{d}{dt}\left(\dots\right) = F(t) $$

so that we can directly integrate both sides. Suppose we are given

$$ \frac{dy}{dt} + p(t)y = g(t). $$

Observe that if $H(t)$ is an antiderivative of $p(t)$, i.e.

$$ \frac{d}{dt}H(t)=p(t) $$

then by the product rule

$$ \frac{d}{dt}\left(e^{H(t)}y(t)\right)=y' \cdot e^{H(t)} + y \cdot H'(t) e^{H(t)}=y' \cdot e^{H(t)} + y \cdot p(t) e^{H(t)}=e^{H(t)}\left(y' + p(t)y\right) $$

Thus if we set $\mu(t)=e^{H(t)}$ and multiply both sides of $\frac{dy}{dt} + p(t)y = g(t)$ by $\mu(t)$, this ODE becomes

$$ \frac{d}{dt}\left(\mu(t)y \right) = \mu(t)g(t). $$

which we can integrate. $\mu(t)=e^{H(t)}=e^{\int p}$ is called the integrating factor.

Application of the integrating factor method

Consider the initial value problem (IVP) $ty'+2y = 4t^2$, $y(1)=2$.

We first divide both sides by $t$ to express the equation in standard form:

$$ y' + \frac{2}{t}y = 4t, $$

and observe that $p(t)=\frac{2}{t}$ has the antiderivative $H(t)=\log(t^2)$, hence we use the integrating factor $\mu(t) = e^{\log(t^2)}=t^2$. Then the ODE is equivalent to

\begin{aligned} y' + \frac{2}{t}y &= 4t\\ t^2 y' + t^2\cdot\frac{2}{t}y &= t^2\cdot 4t\\ t^2 y' + 2t y &= 4t^3\\ \frac{d}{dt}\left(t^2 y \right) = 4t^3. \end{aligned}

Integrating this gives the general solution to be

$$ t^2y = t^4 + c $$

or

$$ y = t^2 + \frac{c}{t^2} $$

for some arbitrary constant $c$. See below for a plot of these integral curves.


In [1]:
using Plots

import Gadfly
dpanel = Gadfly.Theme(
    line_width=2.5pt,
    guide_title_position=:center
)
Gadfly.push_theme(dpanel)
Gadfly.plot(z=(x,y) -> x^2*y - x^4,
     x=linspace(-20,20,800), y=linspace(-20,20,800), Gadfly.Geom.contour(levels=-50:5:50), Gadfly.Guide.title("Integral Curves"),Gadfly.Guide.colorkey("c"))


Out[1]:
x -20 -15 -10 -5 0 5 10 15 20 -15.0 -14.5 -14.0 -13.5 -13.0 -12.5 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 14.5 15.0 -20 -10 0 10 20 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 50 0 -50 c -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 -60 -58 -56 -54 -52 -50 -48 -46 -44 -42 -40 -38 -36 -34 -32 -30 -28 -26 -24 -22 -20 -18 -16 -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 -60 -30 0 30 60 -60 -55 -50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 35 40 45 50 55 60 y Integral Curves

Using the initial data $y(1)=2$ determines $c$ to be equal to $1$. Therefore the particular solution is

$$ y = t^2 + \frac{1}{t^2} $$

This solution exists away from $t=0$, thus its interval of existence is $(0,+\infty)$ which includes the initial point $t=1$. See below for a plot of this solution.


In [2]:
plotly()
t = linspace(0.2, 6, 2000)
y = t.^2 + 1./t.^2
plot(t, y, linewidth=4, label="y(t)",xlabel="x",ylabel="y")
scatter!([1],[2], label="y(1)=2")


Out[2]:

In [ ]: