First-Order Differential Equations

Learning Outcomes

  • Write a first-order linear differential equation in standard form
  • Find an integrating factor and use it to solve a first-order linear differential equation

See the example on the introduction page for a first-order linear differential equation.

Definition


A first-order differential equation is linear if it can be written in the form

[latex]a\left(x\right){y}^{\prime }+b\left(x\right)y=c\left(x\right)[/latex],

 

where [latex]a\left(x\right),b\left(x\right)[/latex], and [latex]c\left(x\right)[/latex] are arbitrary functions of [latex]x[/latex].

Remember that the unknown function [latex]y[/latex] depends on the variable [latex]x[/latex]; that is, [latex]x[/latex] is the independent variable and [latex]y[/latex] is the dependent variable. Some examples of first-order linear differential equations are

[latex]\begin{array}{ccc}\hfill \left(3{x}^{2}-4\right)y^{\prime} +\left(x - 3\right)y& =\hfill & \sin{x}\hfill \\ \hfill \left(\sin{x}\right)y^{\prime} -\left(\cos{x}\right)y& =\hfill & \cot{x}\hfill \\ \hfill 4xy^{\prime} +\left(3\text{ln}x\right)y& =\hfill & {x}^{3}-4x.\hfill \end{array}[/latex]

 

Examples of first-order nonlinear differential equations include

[latex]\begin{array}{ccc}\hfill {\left(y^{\prime} \right)}^{4}-{\left(y^{\prime} \right)}^{3}& =\hfill & \left(3x - 2\right)\left(y+4\right)\hfill \\ \hfill 4y^{\prime} +3{y}^{3}& =\hfill & 4x - 5\hfill \\ \hfill {\left(y^{\prime} \right)}^{2}& =\hfill & \sin{y}+\cos{x}.\hfill \end{array}[/latex]

 

These equations are nonlinear because of terms like [latex]{\left({y}^{\prime }\right)}^{4},{y}^{3}[/latex], etc. Due to these terms, it is impossible to put these equations into the same form as the definition.

Standard Form

Consider the differential equation

[latex]\left(3{x}^{2}-4\right){y}^{\prime }+\left(x - 3\right)y=\sin{x}[/latex].

 

Our main goal in this section is to derive a solution method for equations of this form. It is useful to have the coefficient of [latex]{y}^{\prime }[/latex] be equal to [latex]1[/latex]. To make this happen, we divide both sides by [latex]3{x}^{2}-4[/latex].

[latex]{y}^{\prime }+\left(\frac{x - 3}{3{x}^{2}-4}\right)y=\frac{\sin{x}}{3{x}^{2}-4}[/latex]

 

This is called the standard form of the differential equation. We will use it later when finding the solution to a general first-order linear differential equation. Returning to the definition, we can divide both sides of the equation by [latex]a\left(x\right)[/latex]. This leads to the equation

[latex]{y}^{\prime }+\frac{b\left(x\right)}{a\left(x\right)}y=\frac{c\left(x\right)}{a\left(x\right)}[/latex].

 

Now define [latex]p\left(x\right)=\frac{b\left(x\right)}{a\left(x\right)}[/latex] and [latex]q\left(x\right)=\frac{c\left(x\right)}{a\left(x\right)}[/latex]. Then the definition becomes

[latex]{y}^{\prime }+p\left(x\right)y=q\left(x\right)[/latex].

 

We can write any first-order linear differential equation in this form, and this is referred to as the standard form for a first-order linear differential equation.

Example: Writing First-Order Linear Equations in Standard Form

Put each of the following first-order linear differential equations into standard form. Identify [latex]p\left(x\right)[/latex] and [latex]q\left(x\right)[/latex] for each equation.

  1. [latex]y^{\prime} =3x - 4y[/latex]
  2. [latex]\frac{3xy^{\prime} }{4y - 3}=2[/latex] (here [latex]x>0[/latex])
  3. [latex]y=3y^{\prime} -4{x}^{2}+5[/latex]

Watch the following video to see the worked solution to Example: Writing First-Order Linear Equations in Standard Form.

You can view the transcript for “4.5.1” here (opens in new window).

try it

Put the equation [latex]\frac{\left(x+3\right)y^{\prime} }{2x - 3y - 4}=5[/latex] into standard form and identify [latex]p\left(x\right)[/latex] and [latex]q\left(x\right)[/latex].

Try It

Integrating Factors

We now develop a solution technique for any first-order linear differential equation. We start with the standard form of a first-order linear differential equation:

[latex]y^{\prime} +p\left(x\right)y=q\left(x\right)[/latex].

 

The first term on the left-hand side of [latex]{y}^{\prime }+\frac{b\left(x\right)}{a\left(x\right)}y=\frac{c\left(x\right)}{a\left(x\right)}[/latex] is the derivative of the unknown function, and the second term is the product of a known function with the unknown function. This is somewhat reminiscent of the power rule from the Differentiation Rules section. If we multiply [latex]{y}^{\prime }+p\left(x\right)y=q\left(x\right)[/latex] by a yet-to-be-determined function [latex]\mu \left(x\right)[/latex], then the equation becomes

[latex]\mu \left(x\right){y}^{\prime }+\mu \left(x\right)p\left(x\right)y=\mu \left(x\right)q\left(x\right)[/latex].

 

The left-hand side of [latex]y^{\prime} +p\left(x\right)y=q\left(x\right)[/latex] can be matched perfectly to the product rule:

[latex]\frac{d}{dx}\left[f\left(x\right)g\left(x\right)\right]={f}^{\prime }\left(x\right)g\left(x\right)+f\left(x\right){g}^{\prime }\left(x\right)[/latex].

 

Matching term by term gives [latex]y=f\left(x\right),g\left(x\right)=\mu \left(x\right)[/latex], and [latex]{g}^{\prime }\left(x\right)=\mu \left(x\right)p\left(x\right)[/latex]. Taking the derivative of [latex]g\left(x\right)=\mu \left(x\right)[/latex] and setting it equal to the right-hand side of [latex]{g}^{\prime }\left(x\right)=\mu \left(x\right)p\left(x\right)[/latex] leads to

[latex]{\mu }^{\prime }\left(x\right)=\mu \left(x\right)p\left(x\right)[/latex].

 

This is a first-order, separable differential equation for [latex]\mu \left(x\right)[/latex]. We know [latex]p\left(x\right)[/latex] because it appears in the differential equation we are solving. Separating variables and integrating yields

[latex]\begin{array}{ccc}\hfill \frac{{\mu }^{\prime }\left(x\right)}{\mu \left(x\right)}& =\hfill & p\left(x\right)\hfill \\ \hfill {\displaystyle\int \frac{{\mu }^{\prime }\left(x\right)}{\mu \left(x\right)}dx}& =\hfill & {\displaystyle\int p\left(x\right)dx}\hfill \\ \hfill \text{ln}|\mu \left(x\right)|& =\hfill & {\displaystyle\int p\left(x\right)dx+C}\hfill \\ \hfill {e}^{\text{ln}|\mu \left(x\right)|}& =\hfill & {e}^{\displaystyle\int p\left(x\right)dx+C}\hfill \\ \hfill |\mu \left(x\right)|& =\hfill & {C}_{1}{e}^{\displaystyle\int p\left(x\right)dx}\hfill \\ \hfill \mu \left(x\right)& =\hfill & {C}_{2}{e}^{\displaystyle\int p\left(x\right)dx}\hfill \end{array}[/latex]

 

Here [latex]{C}_{2}[/latex] can be an arbitrary (positive or negative) constant. This leads to a general method for solving a first-order linear differential equation. We first multiply both sides of [latex]{y}^{\prime }+p\left(x\right)y=q\left(x\right)[/latex] by the integrating factor [latex]\mu \left(x\right)[/latex]. This gives

[latex]\mu \left(x\right){y}^{\prime }+\mu \left(x\right)p\left(x\right)y=\mu \left(x\right)q\left(x\right)[/latex].

 

The left-hand side of the above equation can be rewritten as [latex]\frac{d}{dx}\left(\mu \left(x\right)y\right)[/latex].

[latex]\frac{d}{dx}\left(\mu \left(x\right)y\right)=\mu \left(x\right)q\left(x\right)[/latex].

 

Next integrate both sides with respect to [latex]x[/latex].

[latex]\begin{array}{ccc}\hfill {\displaystyle\int \frac{d}{dx}\left(\mu \left(x\right)y\right)dx}& =\hfill & {\displaystyle\int \mu \left(x\right)q\left(x\right)dx}\hfill \\ \hfill \mu \left(x\right)y& =\hfill & {\displaystyle\int \mu \left(x\right)q\left(x\right)dx}\hfill \end{array}[/latex]

 

Divide both sides by [latex]\mu \left(x\right)\text{:}[/latex]

[latex]y=\dfrac{1}{\mu \left(x\right)}\left[\displaystyle\int \mu \left(x\right)q\left(x\right)dx+C\right][/latex].

 

Since [latex]\mu \left(x\right)[/latex] was previously calculated, we are now finished. An important note about the integrating constant [latex]C\text{:}[/latex] It may seem that we are inconsistent in the usage of the integrating constant. However, the integral involving [latex]p\left(x\right)[/latex] is necessary in order to find an integrating factor for [latex]{y}^{\prime }+\frac{b\left(x\right)}{a\left(x\right)}y=\frac{c\left(x\right)}{a\left(x\right)}[/latex]. Only one integrating factor is needed in order to solve the equation; therefore, it is safe to assign a value for [latex]C[/latex] for this integral. We chose [latex]C=0[/latex]. When calculating the integral inside the brackets in [latex]\frac{d}{dx}\left(\mu \left(x\right)y\right)=\mu \left(x\right)q\left(x\right)[/latex], it is necessary to keep our options open for the value of the integrating constant, because our goal is to find a general family of solutions to [latex]{y}^{\prime }+\frac{b\left(x\right)}{a\left(x\right)}y=\frac{c\left(x\right)}{a\left(x\right)}[/latex]. This integrating factor guarantees just that.

Problem-Solving Strategy: Solving a First-order Linear Differential Equation

  1. Put the equation into standard form and identify [latex]p\left(x\right)[/latex] and [latex]q\left(x\right)[/latex].
  2. Calculate the integrating factor [latex]\mu \left(x\right)={e}^{\displaystyle\int p\left(x\right)dx}[/latex].
  3. Multiply both sides of the differential equation by [latex]\mu \left(x\right)[/latex].
  4. Integrate both sides of the equation obtained in step [latex]3[/latex], and divide both sides by [latex]\mu \left(x\right)[/latex].
  5. If there is an initial condition, determine the value of [latex]C[/latex].

Example: Solving a First-order Linear Equation

Find a general solution for the differential equation [latex]xy^{\prime} +3y=4{x}^{2}-3x[/latex]. Assume [latex]x>0[/latex].

Watch the following video to see the worked solution to Example: Solving a First-Order Linear Equation.

For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.

You can view the transcript for this segmented clip of “4.5.2” here (opens in new window).

try it

Find the general solution to the differential equation [latex]\left(x - 2\right)y^{\prime} +y=3{x}^{2}+2x[/latex]. Assume [latex]x>2[/latex].

Now we use the same strategy to find the solution to an initial-value problem.

Example: A First-order Linear Initial-Value Problem

Solve the initial-value problem

[latex]{y}^{\prime }+3y=2x - 1,y\left(0\right)=3[/latex].

 

Watch the following video to see the worked solution to Example: A First-Order Linear Initial-Value Problem.

For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.

You can view the transcript for this segmented clip of “4.5.2” here (opens in new window).

try it

Solve the initial-value problem [latex]y^{\prime} -2y=4x+3, y\left(0\right)=-2[/latex].

Try It