Deniz Bilman, Department of Mathematics, University of Michigan
We have seen so far that we can solve 2 types of ODEs:
Today we cover another class of ODEs that we can solve.
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:
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.
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]:
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 [ ]: