First-Order Differential Equations

Page

Consider the first-order ODE, which is when the highest derivative appearing in the equation is a first derivative.

$y’=f(t,y)$, $y(t_{0})=y_{0}$

  1. Does $y’=f(t,y)$, $y(t_{0})=y_{0}$ have a solution?

  2. If so, can we find a formula for the solution?

The first question is easily addressed:

Existence and Uniqueness Theorem

Suppose that $f(t,y)$ and $\frac{\partial f(t,y)}{\partial y}$ are continumous on a closed rectangle $R$ of the $ty$-plane. If $(t_{0},y_{0}) \in R$, then the IVP, an ODE along with a specified initial condition, $$ y’=f(t,y), \quad y(t_{0})=y_{0} $$ has a unique solution $y(t)$ on some $t$-interval containing $t_{0}$.

The second question is much more difficult, and often we need to resort to numerical methods. However, in this tutorial we review four of the most commonly-used analytic solution methods for first-order ODES.

Separating the Variables

If an ODE can be written in the form $$ \frac{\partial y}{\partial t}=\frac{g(t)}{h(y)}, $$ then the ODE is said to be separable. In this case, a simple solution technique can be derived as follows:

Suppose $y=f(t)$ solves the ODE. Rewriting the ODE as $h(y)y’=g(t)$,

$$\begin{array}{rcl} h(f(t))f'(t) &= &g(t) \\ \int h(f(t))f'(t)dt &= &\int g(t)dt +C \\ \int h(y)dy & = & \int g(t)dt +C. \end{array}$$

Since $y=f(t)$, $y’=f'(t)$.

Integrating with respect to $t$ on each side.

Since $dy=f'(t)dt$.

Upon integrating, we have our implicitly-defined general solution of the ODE, which we can often solve explicitly for y(t). A solution of an ODE is said to be written implicitly if it has the form $H(xy)=C$, rather than being solved for y in terms of x.

Example

Let’s solve the separable ODE $y’ = \frac{4y}{t}$. Separating the variables and integrating,

$$\begin{array}{rcl} \int \frac{dy}{4y} &= &\int \frac{dt}{t} +C_{1}, \\ \frac{1}{4} \ln |y| &= &\ln |t| +C_{1}, \\ \frac{1}{4} \ln |y| – \ln |t| &= &C_{1} \\ \ln \left| \frac{y^{1/4}}{t} \right| & = & C_{1} \\ e^{\ln \left| \frac{y^{1/4}}{t} \right|} & = & e^{C_{1}} \\ \left| \frac{y^{1/4}}{t} \right| & = & C_{2} \\ y^{1/4} & = & C_{2}t & \\ y & = & Ct^{4}. \end{array}$$

Recall that
$r\ln a = \ln a^{r} \mathrm{~and~}$
$\ln a – \ln b = \ln \frac{a}{b}.$

$e^{\ln a}= a$.
Relabel $e^{C_{1}}$ as $C_{2}$.

Relabel $C_{2}^{4}$ as $C$.

The general solution, $y=Ct^4$, defines a family of solution cuves corresponding to various initial conditions.

Follow the image link for a complete description of the image

Using an Integrating Factor to solve a Linear ODE

If a first-order ODE can be written in the normal linear form $$ y’+p(t)y= q(t), $$ the ODE can be solved using an integrating factor $\mu (t)= e^{\int p(t)dt}$:

Multiplying both sides of the ODE by $\mu (t)$.

$\left( \mu (t)y \right) ‘ = \mu (t)y’ + \mu ‘(t)y$ and $\mu ‘(t) = p(t) \mu (t)$ using the chain rule to differentiate $\mu (t)= e^{\int p(t)dt}$.

Integrating each side with respect to $t$.

Dividing through by $\mu (t)$, we have the general solution of the linear ODE.

Example

We can solve the linear ODE $y’-2ty=t$ using an integrating facter. Here, $p(t)=-2t$ and $q(t)=1$, so $$ \mu (t) = e^{\int -2t dt}=e^{-t^{2}} $$ Multiplying both sides of the ODE by $\mu (t)$,

$\begin{array}{rcl} e^{-t^{2}}(y’-2ty) & = & te^{-t^{2}} \\ (e^{-t^{2}}y)’ & = & te^{-t^{2}} \\ e^{-t^{2}}y & = & -\frac{1}{2}e^{-t^{2}}+C \\ y & = & Ce^{t^{2}}-\frac{1}{2}. \end{array}$

You can verify that $(e^{-t^{2}}y)’=e^{-t^{2}}(y’-2ty)$ by using the Chain Rule to differentiate $e^{-t^{2}}y$

Integrating each side with respect to $t$.

Dividing through by $e^{-t^{2}}$.

So the general solution of $y’-2ty=t$ is $y(t)=Ce^{t^{2}}-\frac{1}{2}$.

For practice, solve $y’ = \frac{4y}{t}$ by putting it in normal linear form and using an integrating factor. Verify that you get the same result as we did by separating the variables.

Follow the image link for a complete description of the image

Using a Change of Variables

Often, a first-order ODE that is neither separable nor linear can be simplified to one of these types by making a change of variables. Here are some important examples:

Homogeneous Equation of Order 0: $\frac{dy}{dx} = f(x,y)$ where $f(kx,ky)= f(x,y)$. Use the change of variables $z=\frac{y}{x}$ to convert the ODE to $x\frac{dz}{dx} = f(1,z)-z$, which is separable.

Let $z=y/x$. Then $y=xz$, and

$$\frac{dy}{dx}=x\frac{dz}{dx}+z.$$ By the Chain Rule.

Substituting into the original equation,

\begin{eqnarray*}
x\frac{dz}{dx}+z & =& f(x,xz) \
x\frac{dz}{dx}+z &= & f(1,z)\
x\frac{dz}{dx} & = & f(1,z) -z.
\end{eqnarray*}


Since $f(kx,ky)=f(x,y)$ for all $k$.

We recommend understanding the change of variables procedure, rather
than memorizing the equation that results! After solving this separable equation, use $z=y/x$ to return to the original variables.


Bernoulli Equation: $\frac{dy}{dt}+p(t)y= q(t)y^{b} \quad
(b \not= 0,1)$. Use the change of variables $z=y^{1-b}$ to convert the ODE to $\frac{dz}{dt} + (1-b)p(t)z=(1-b)q(t)$, which is linear.

Let $z=y^{1-b}$. Then $y=z^{\frac{1}{1-b}}$, so by the Chain Rule,
$$
\frac{dy}{dt}= \frac{1}{1-b}z^{\frac{1}{1-b}-1}\frac{dz}{dt}=\frac{1}{1-b}z^{\frac{b}{1-b}}\frac{dz}{dt}.
$$
Substituting into the original equation,

\begin{eqnarray} \frac{1}{1-b} z^{\frac{b}{1-b}}\frac{dz}{dt} + p(t)z^{\frac{1}{1-b}} & = & q(t)z^{\frac{b}{1-b}} \ \frac{1}{1-b}\frac{dz}{dt} + p(t)z & = & q(t)\ \frac{dz}{dt} + (1-b)p(t)z & = & (1-b)q(t) . \end{eqnarray}
Dividing through by $z^{\frac{b}{1-b}}.

After solving this linear equation, use $z= y^{1-b}$ to return to the
original variables.


Riccati Equation: $\frac{dy}{dt}=a(t)y+b(t)y^{2}+ F(t)$. If one particular solution $g(t)$ is known, use the change of variables $z=\frac{1}{y-g}$ to convert the ODE to $\frac{dz}{dt}+ (a+2bg)z=-b$, which is linear.

Suppose that $y=g(t)$ solves the ODE.

Let $z=\frac{1}{y-g}$. Then $y=g(t) + \frac{1}{z}$, and
$$
\frac{dy}{dt}=g'(t) -\frac{1}{z^{2}}\frac{dz}{dt}.
$$

Substituting into the original ODE,

\begin{eqnarray} g'(t) -\frac{1}{z^{2}}\frac{dz}{dt} & = & a(t)\left[ g(t)+\frac{1}{z} \right] + b(t)\left[ g(t)+\frac{1}{z} \right] ^{2} + F(t)\ g'(t) -\frac{1}{z^{2}}\frac{dz}{dt} & = & a(t)g(t) + a(t)\frac{1}{z} + b(t)\left( g(t) \right) ^{2} + 2b(t)g(t)\frac{1}{z} + b(t)\frac{1}{z^{2}}+ F(t) \ -\frac{1}{z^{2}}\frac{dz}{dt} & = & \left[ a(t)g(t) + b(t)\left( g(t) \right) ^{2} + F(t) -g'(t) \right] + \left( a(t) + 2b(t)g(t) \right) \frac{1}{z} + b(t)\frac{1}{z^{2}} \ -\frac{1}{z^{2}}\frac{dz}{dt} & = & (a+2bg)\frac{1}{z} + \frac{b}{z^{2}} \ \frac{dz}{dt} & = & -(a+2bg)z – b \ \frac{dz}{dt} + (a+2bg)z & = & -b . \end{eqnarray}

$g'(t) = ag+ bg^{2} + F(t)$, since $g(t)$ solves
the original ODE.

After solving this linear equation, use $y=g(t) + \frac{1}{z}$ to
return to the original variables.


When using a change of variables, solve the transformed ODE and then return to the original variables to obtain the general solution of the original ODE. Often, you will have to leave your solution in implicit form.

Example

Let’s solve the ODE $\frac{dy}{dx}=\frac{y-x}{x-4y}$. To see that it is homogeneous of order 0, note that $$ f(kx,ky)= \frac{ky-kx}{kx-4ky}=\frac{y-x}{x-4y}=f(x,y). $$

Let $z=\frac{y}{x}$. Then $y=xz$, so $\frac{dy}{dx}=x\frac{dz}{dx}+z$. The ODE becomes \begin{eqnarray*} x\frac{dz}{dx}+z &= & \frac{xz-x}{x-4xz} \\ x\frac{dz}{dx}+z &= & \frac{z-1}{1-4z}\\ x\frac{dz}{dx} & = & \frac{4z^{2}-1}{1-4z}, \end{eqnarray*} which is separable. Separating the variables and integrating,

\begin{eqnarray*} \int \frac{4z^{2}-1}{1-4z}dz &= & \int \frac{1}{x}dx \\ \int \left( \frac{-3/2}{2z+1} + \frac{-1/2}{2z-1} \right) dz & = & \int \frac{1}{x}dx \\ -\frac{3}{4} \ln |2z+1| – \frac{1}{4} \ln |2z-1| & = & \ln |x| + C_{1}\\ 3 \ln |2z+1| + \ln |2z-1| & = & -4\ln |x| + C_{2}\\ \ln \left| (2z+1)^{3}(2z-1)x^{4} \right| & = & C_{2}\\ e^{\ln \left| (2z+1)^{3}(2z-1)x^{4} \right|} & = & e^{C_{2}}\\ \left| (2z+1)^{3}(2z-1)x^{4} \right| & = & C\\ \left( 2\frac{y}{x}+1 \right) ^{3} \left( 2\frac{y}{x}-1 \right)x^{4} & = & C\\ (2y+x)^{3}(2y-x) & = & C. \end{eqnarray*}

Using partial fractions.

Multiplying through by $-4$ and relabelling $-4C_{1}$ as $C_{2}$.

Returning to the original variables using $z=y/x$.

The general solution, $(2y+x)^{3}(2y-x) = C$, is written implicitly.

Follow the image link for a complete description of the image

Finding an Integral for an Exact Equation

An ODE $N(x,y)y’ + M(x,y) = 0$ is an exact equation if $\frac{\partial N}{\partial x} = \frac{\partial M}{\partial y}$ in a region of the $xy$-plane. If we can find a function $H(x,y)$ for which $\frac{\partial H}{\partial x}= M$ and $\frac{\partial H}{\partial y}= N$, then $H(x,y)$ is called an integral of the ODE and $H(x,y) = C$ is the general solution of the original ODE.

To find $H(x,y)$, note that $$ H(x,y) = \int M(x,y)dx + g(y) $$ for some $g(y)$ since $\frac{\partial H}{\partial x}= M(x,y)$. To find $g(y)$, calculate $$ \frac{\partial H}{\partial y}=\frac{\partial}{\partial y} \left[ \int M(x,y)dx \right] + g'(y) $$ and set it equal to $N(x,y)$. Solve for $g'(x,y)$ ,which will be independent of $ x $, and integrate with respect to $y$ to obtain $g(y)$, and so $H(x,y)$, explicitly. Notice that our solution $H(x,y) = C$ is written in implicit form. Alternatively, we can start with $H(x,y) = \int N(x,y)dy + h(x)$ for some $h(x)$ and proceed accordingly.

Example

The ODE $\left( 2yx^{2} + 4 \right) \frac{dy}{dx} + \left( 2y^{2}x -3 \right) = 0$ is exact, since for $N(x,y) = 2yx^{2} + 4$ and $M(x,y) = 2y^{2}x -3$, $$ \frac{\partial N}{\partial x}=4xy=\frac{\partial M}{\partial y}. $$ Thus, there exists an integral $H(x,y)$ for which $$ \frac{\partial H}{\partial x}= 2y^{2}x-3 \mathrm{~and~} \frac{\partial H}{\partial y}= 2yx^{2}+4. $$ From the first of these, \begin{eqnarray*} H(x,y) &= & \int \left( 2y^{2}x -3 \right) dx + g(y) \\ H(x,y) &= & y^{2}x^{2}-3x+g(y) . \end{eqnarray*} Then $\frac{\partial H}{\partial y}=2yx^{2} + g'(y)=2yx^{2}+4$, so $g'(y)=4$.

Integrating, $g(y)= 4y$, so $H(x,y)= y^{2}x^{2}-3x+4y$.

The general solution is given implicitly by $$ y^{2}x^{2}-3x+4y =C. $$

Follow the image link for a complete description of the image

Key Concepts


[I’m ready to take the quiz.] [I need to review more.]