### Learning Objectives

- 4.5.1 Write a first-order linear differential equation in standard form.
- 4.5.2 Find an integrating factor and use it to solve a first-order linear differential equation.
- 4.5.3 Solve applied problems involving first-order linear differential equations.

Earlier, we studied an application of a first-order differential equation that involved solving for the velocity of an object. In particular, if a ball is thrown upward with an initial velocity of ${v}_{0}$ ft/s, then an initial-value problem that describes the velocity of the ball after $t$ seconds is given by

This model assumes that the only force acting on the ball is gravity. Now we add to the problem by allowing for the possibility of air resistance acting on the ball.

Air resistance always acts in the direction opposite to motion. Therefore if an object is rising, air resistance acts in a downward direction. If the object is falling, air resistance acts in an upward direction (Figure 4.24). There is no exact relationship between the velocity of an object and the air resistance acting on it. For very small objects, air resistance is proportional to velocity; that is, the force due to air resistance is numerically equal to some constant $k$ times $v.$ For larger (e.g., baseball-sized) objects, depending on the shape, air resistance can be approximately proportional to the square of the velocity. In fact, air resistance may be proportional to ${v}^{1.5},$ or ${v}^{0.9},$ or some other power of $v.$

We will work with the linear approximation for air resistance. If we assume $k>0,$ then the expression for the force ${F}_{A}$ due to air resistance is given by ${F}_{A}=\text{\u2212}kv.$ Therefore the sum of the forces acting on the object is equal to the sum of the gravitational force and the force due to air resistance. This, in turn, is equal to the mass of the object multiplied by its acceleration at time $t$ (Newton’s second law). This gives us the differential equation

Finally, we impose an initial condition $v\left(0\right)={v}_{0},$ where ${v}_{0}$ is the initial velocity measured in meters per second. This makes $g=9.8{\phantom{\rule{0.2em}{0ex}}\text{m/s}}^{2}.$ The initial-value problem becomes

The differential equation in this initial-value problem is an example of a first-order linear differential equation. (Recall that a differential equation is first-order if the highest-order derivative that appears in the equation is $1.)$ In this section, we study first-order linear equations and examine a method for finding a general solution to these types of equations, as well as solving initial-value problems involving them.

### Definition

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

where $a\left(x\right),b\left(x\right),$ and $c\left(x\right)$ are arbitrary functions of $x.$

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

Examples of first-order nonlinear differential equations include

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

### Standard Form

Consider the differential equation

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 ${y}^{\prime}$ be equal to $1.$ To make this happen, we divide both sides by $3{x}^{2}-4.$

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 Equation 4.14, we can divide both sides of the equation by $a\left(x\right).$ This leads to the equation

Now define $p\left(x\right)=\frac{b\left(x\right)}{a\left(x\right)}$ and $q\left(x\right)=\frac{c\left(x\right)}{a\left(x\right)}.$ Then Equation 4.14 becomes

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 4.15

#### Writing First-Order Linear Equations in Standard Form

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

- $y\prime =3x-4y$
- $\frac{3xy\prime}{4y-3}=2$ (here $x\ne 0)$
- $y=3y\prime -4{x}^{2}+5$

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

### 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:

The first term on the left-hand side of Equation 4.15 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 product rule from the Differentiation Rules section. If we multiply Equation 4.16 by a yet-to-be-determined function $\mu \left(x\right),$ then the equation becomes

The left-hand side Equation 4.18 can be matched perfectly to the product rule:

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

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

Here ${C}_{2}$ 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 Equation 4.16 by the integrating factor $\mu \left(x\right).$ This gives

The left-hand side of Equation 4.20 can be rewritten as $\frac{d}{dx}\left(\mu \left(x\right)y\right).$

Next integrate both sides of Equation 4.21 with respect to $x.$

Divide both sides of Equation 4.22 by $\mu \left(x\right)\text{:}$

Since $\mu \left(x\right)$ was previously calculated, we are now finished. An important note about the integrating constant $C\text{:}$ It may seem that we are inconsistent in the usage of the integrating constant. However, the integral involving $p\left(x\right)$ is necessary in order to find an integrating factor for Equation 4.15. Only one integrating factor is needed in order to solve the equation; therefore, it is safe to assign a value for $C$ for this integral. We chose $C=0.$ When calculating the integral inside the brackets in Equation 4.21, 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 Equation 4.15. This integrating factor guarantees just that.

- Put the equation into standard form and identify $p\left(x\right)$ and $q\left(x\right).$
- Calculate the integrating factor $\mu \left(x\right)={e}^{{\displaystyle \int p\left(x\right)\phantom{\rule{0.1em}{0ex}}dx}}.$
- Multiply both sides of the differential equation by $\mu \left(x\right).$
- Integrate both sides of the equation obtained in step $3,$ and divide both sides by $\mu \left(x\right).$
- If there is an initial condition, determine the value of $C.$

### Example 4.16

#### Solving a First-order Linear Equation

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

#### Analysis

You may have noticed the condition that was imposed on the differential equation; namely, $x>0.$ For any nonzero value of $C,$ the general solution is not defined at $x=0.$ Furthermore, when $x<0,$ the integrating factor changes. The integrating factor is given by Equation 4.19 as $f\left(x\right)={e}^{{\displaystyle \int p\left(x\right)}dx}.$ For this $p\left(x\right)$ we get

since $x<0.$ The behavior of the general solution changes at $x=0$ largely due to the fact that $p\left(x\right)$ is not defined there.

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

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

### Example 4.17

#### A First-order Linear Initial-Value Problem

Solve the initial-value problem

Solve the initial-value problem $y\prime -2y=4x+3\phantom{\rule{1em}{0ex}}y\left(0\right)=\mathrm{-2}.$

### Applications of First-order Linear Differential Equations

We look at two different applications of first-order linear differential equations. The first involves air resistance as it relates to objects that are rising or falling; the second involves an electrical circuit. Other applications are numerous, but most are solved in a similar fashion.

#### Free fall with air resistance

We discussed air resistance at the beginning of this section. The next example shows how to apply this concept for a ball in vertical motion. Other factors can affect the force of air resistance, such as the size and shape of the object, but we ignore them here.

### Example 4.18

#### A Ball with Air Resistance

A racquetball is hit straight upward with an initial velocity of $2$ m/s. The mass of a racquetball is approximately $0.0427$ kg. Air resistance acts on the ball with a force numerically equal to $0.5v,$ where $v$ represents the velocity of the ball at time $t.$

- Find the velocity of the ball as a function of time.
- How long does it take for the ball to reach its maximum height?
- If the ball is hit from an initial height of $1$ meter, how high will it reach?

### Checkpoint 4.18

The weight of a penny is $2.5$ grams (United States Mint, “Coin Specifications,” accessed April 9, 2015, http://www.usmint.gov/about_the_mint/?action=coin_specifications), and the upper observation deck of the Empire State Building is $369$ meters above the street. Since the penny is a small and relatively smooth object, air resistance acting on the penny is actually quite small. We assume the air resistance is numerically equal to $0.0025v.$ Furthermore, the penny is dropped with no initial velocity imparted to it.

- Set up an initial-value problem that represents the falling penny.
- Solve the problem for $v\left(t\right).$
- What is the terminal velocity of the penny (i.e., calculate the limit of the velocity as $t$ approaches infinity)?

#### Electrical Circuits

A source of electromotive force (e.g., a battery or generator) produces a flow of current in a closed circuit, and this current produces a voltage drop across each resistor, inductor, and capacitor in the circuit. Kirchhoff’s Loop Rule states that the sum of the voltage drops across resistors, inductors, and capacitors is equal to the total electromotive force in a closed circuit. We have the following three results:

- The voltage drop across a resistor is given by

$${E}_{R}=Ri,$$

where $R$ is a constant of proportionality called the*resistance,*and $i$ is the current. - The voltage drop across an inductor is given by

$${E}_{L}=L{i}^{\prime},$$

where $L$ is a constant of proportionality called the*inductance*, and $i$ again denotes the current. - The voltage drop across a capacitor is given by

$${E}_{C}=\frac{1}{C}q,$$

where $C$ is a constant of proportionality called the *capacitance*, and $q$ is the instantaneous charge on the capacitor. The relationship between $i$ and $q$ is $i={q}^{\prime}.$

We use units of volts $\left(\text{V}\right)$ to measure voltage $E,$ amperes $\left(\text{A}\right)$ to measure current $i,$ coulombs $\left(\text{C}\right)$ to measure charge $q,$ ohms $\left(\text{\Omega}\right)$ to measure resistance $R,$ henrys $\left(\text{H}\right)$ to measure inductance $L,$ and farads $\left(\text{F}\right)$ to measure capacitance $C.$ Consider the circuit in Figure 4.25.

Applying Kirchhoff’s Loop Rule to this circuit, we let $E$ denote the electromotive force supplied by the voltage generator. Then

Substituting the expressions for ${E}_{L},{E}_{R},$ and ${E}_{C}$ into this equation, we obtain

If there is no capacitor in the circuit, then the equation becomes

This is a first-order differential equation in $i.$ The circuit is referred to as an $LR$ circuit.

Next, suppose there is no inductor in the circuit, but there is a capacitor and a resistor, so $L=0,R\ne 0,$ and $C\ne 0.$ Then Equation 4.23 can be rewritten as

which is a first-order linear differential equation. This is referred to as an *RC* circuit. In either case, we can set up and solve an initial-value problem.

### Example 4.19

#### Finding Current in an *RL* Electric Circuit

A circuit has in series an electromotive force given by $E=50\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}20t\phantom{\rule{0.2em}{0ex}}\text{V},$ a resistor of $5\text{\Omega},$ and an inductor of $0.4\phantom{\rule{0.2em}{0ex}}\text{H}\text{.}$ If the initial current is $0,$ find the current at time $t>0.$

### Checkpoint 4.19

A circuit has in series an electromotive force given by $E=20\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}5t$ V, a capacitor with capacitance $0.02\phantom{\rule{0.2em}{0ex}}\text{F},$ and a resistor of $8\phantom{\rule{0.2em}{0ex}}\text{\Omega}.$ If the initial charge is $4\phantom{\rule{0.2em}{0ex}}\text{C},$ find the charge at time $t>0.$

### Section 4.5 Exercises

Are the following differential equations linear? Explain your reasoning.

$\frac{dy}{dx}={x}^{2}y+\text{sin}\phantom{\rule{0.1em}{0ex}}x$

$\frac{dy}{dt}+{y}^{2}=x$

$y\prime =y+{e}^{y}$

Write the following first-order differential equations in standard form.

$y\prime +3y-\text{ln}\phantom{\rule{0.1em}{0ex}}x=0$

$\frac{dy}{dt}=4y+ty+\text{tan}\phantom{\rule{0.1em}{0ex}}t$

What are the integrating factors for the following differential equations?

$y\prime =xy+3$

$y\prime =x\phantom{\rule{0.1em}{0ex}}\text{ln}\left(x\right)y+3x$

$\frac{dy}{dt}+3ty={e}^{t}y$

Solve the following differential equations by using integrating factors.

$y\prime =2y-{x}^{2}$

$\left(x+2\right)y\prime =3x+y$

$xy\prime =x+y$

$y\prime =y+{e}^{x}$

$y\prime +\text{ln}\phantom{\rule{0.1em}{0ex}}x=\frac{y}{x}$

Solve the following differential equations. Use your calculator to draw a family of solutions. Are there certain initial conditions that change the behavior of the solution?

**[T]** $y\prime =3{e}^{t\text{/}3}-2y$

**[T]** $xy\prime =2\frac{\text{cos}\phantom{\rule{0.1em}{0ex}}x}{x}-3y$

**[T]** $\text{sin}(x)y\prime +\text{cos}(x)y=2x$

**[T]** ${x}^{3}y\prime +2{x}^{2}y=x+1$

Solve the following initial-value problems by using integrating factors.

$y\prime =y+2{x}^{2},y(0)=0$

${x}^{2}y\prime =xy-\text{ln}\phantom{\rule{0.1em}{0ex}}x,y(1)=1$

$xy\prime =y+2x\phantom{\rule{0.1em}{0ex}}\text{ln}\phantom{\rule{0.1em}{0ex}}x,y(1)=5$

$y\prime =xy+2x{e}^{x},y(0)=2$

$y\prime =2y+x{e}^{x},y(0)=\mathrm{-1}$

A falling object of mass $m$ can reach terminal velocity when the drag force is proportional to its velocity, with proportionality constant $k.$ Set up the differential equation and solve for the velocity given an initial velocity of $0.$

Using your expression from the preceding problem, what is the terminal velocity? (*Hint:* Examine the limiting behavior; does the velocity approach a value?)

**[T]** Using your equation for terminal velocity, solve for the distance fallen. How long does it take to fall $5000$ meters if the mass is $100$ kilograms, the acceleration due to gravity is $9.8$ m/s^{2} and the proportionality constant is $4?$

A more accurate way to describe terminal velocity is that the drag force is proportional to the square of velocity, with a proportionality constant $k.$ Set up the differential equation and solve for the velocity.

Using your expression from the preceding problem, what is the terminal velocity? (*Hint:* Examine the limiting behavior: Does the velocity approach a value?)

**[T]** Using your equation for terminal velocity, solve for the distance fallen. How long does it take to fall $5000$ meters if the mass is $100$ kilograms, the acceleration due to gravity is $9.8{\phantom{\rule{0.2em}{0ex}}\text{m/s}}^{2}$ and the proportionality constant is $4?$ Does it take more or less time than your initial estimate?

For the following problems, determine how parameter $a$ affects the solution.

Solve the generic equation $y\prime =ay+x.$ How does varying $a$ change the behavior?

Solve the generic equation $y\prime =x+axy.$ How does varying $a$ change the behavior?

Solve $y\prime -y={e}^{kt}$ with the initial condition $y(0)=0.$ As $k$ approaches $1,$ what happens to your formula?