 Calculus Volume 2

# 4.5First-order Linear Equations

Calculus Volume 24.5 First-order Linear Equations

### 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 $v0v0$ ft/s, then an initial-value problem that describes the velocity of the ball after $tt$ seconds is given by

$dvdt=−32,v(0)=v0.dvdt=−32,v(0)=v0.$

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 $kk$ times $v.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 $v1.5,v1.5,$ or $v0.9,v0.9,$ or some other power of $v.v.$

Figure 4.24 Forces acting on a moving baseball: gravity acts in a downward direction and air resistance acts in a direction opposite to the direction of motion.

We will work with the linear approximation for air resistance. If we assume $k>0,k>0,$ then the expression for the force $FAFA$ due to air resistance is given by $FA=−kv.FA=−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 $tt$ (Newton’s second law). This gives us the differential equation

$mdvdt=−kv−mg.mdvdt=−kv−mg.$

Finally, we impose an initial condition $v(0)=v0,v(0)=v0,$ where $v0v0$ is the initial velocity measured in meters per second. This makes $g=9.8m/s2.g=9.8m/s2.$ The initial-value problem becomes

$mdvdt=−kv−mg,v(0)=v0.mdvdt=−kv−mg,v(0)=v0.$
(4.13)

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.)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

$a(x)y′+b(x)y=c(x),a(x)y′+b(x)y=c(x),$
(4.14)

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

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

$(3x2−4)y′+(x−3)y=sinx(sinx)y′−(cosx)y=cotx4xy′+(3lnx)y=x3−4x.(3x2−4)y′+(x−3)y=sinx(sinx)y′−(cosx)y=cotx4xy′+(3lnx)y=x3−4x.$

Examples of first-order nonlinear differential equations include

$(y′)4−(y′)3=(3x−2)(y+4)4y′+3y3=4x−5(y′)2=siny+cosx.(y′)4−(y′)3=(3x−2)(y+4)4y′+3y3=4x−5(y′)2=siny+cosx.$

These equations are nonlinear because of terms like $(y′)4,y3,(y′)4,y3,$ 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

$(3x2−4)y′+(x−3)y=sinx.(3x2−4)y′+(x−3)y=sinx.$

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′y′$ be equal to $1.1.$ To make this happen, we divide both sides by $3x2−4.3x2−4.$

$y′+(x−33x2−4)y=sinx3x2−4y′+(x−33x2−4)y=sinx3x2−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(x).a(x).$ This leads to the equation

$y′+b(x)a(x)y=c(x)a(x).y′+b(x)a(x)y=c(x)a(x).$
(4.15)

Now define $p(x)=b(x)a(x)p(x)=b(x)a(x)$ and $q(x)=c(x)a(x).q(x)=c(x)a(x).$ Then Equation 4.14 becomes

$y′+p(x)y=q(x).y′+p(x)y=q(x).$
(4.16)

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(x)p(x)$ and $q(x)q(x)$ for each equation.

1. $y′=3x−4yy′=3x−4y$
2. $3xy′4y−3=23xy′4y−3=2$ (here $x≠0)x≠0)$
3. $y=3y′−4x2+5y=3y′−4x2+5$

### Checkpoint4.15

Put the equation $(x+3)y′2x−3y−4=5(x+3)y′2x−3y−4=5$ into standard form and identify $p(x)p(x)$ and $q(x).q(x).$

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

$y′+p(x)y=q(x).y′+p(x)y=q(x).$
(4.18)

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 $μ(x),μ(x),$ then the equation becomes

$μ(x)y′+μ(x)p(x)y=μ(x)q(x).μ(x)y′+μ(x)p(x)y=μ(x)q(x).$
(4.19)

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

$ddx[f(x)g(x)]=f′(x)g(x)+f(x)g′(x).ddx[f(x)g(x)]=f′(x)g(x)+f(x)g′(x).$

Matching term by term gives $y=f(x),g(x)=μ(x),y=f(x),g(x)=μ(x),$ and $g′(x)=μ(x)p(x).g′(x)=μ(x)p(x).$ Taking the derivative of $g(x)=μ(x)g(x)=μ(x)$ and setting it equal to the right-hand side of $g′(x)=μ(x)p(x)g′(x)=μ(x)p(x)$ leads to

$μ′(x)=μ(x)p(x).μ′(x)=μ(x)p(x).$

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

$μ′(x)μ(x)=p(x)∫μ′(x)μ(x)dx=∫p(x)dxln|μ(x)|=∫p(x)dx+Celn|μ(x)|=e∫p(x)dx+C|μ(x)|=C1e∫p(x)dxμ(x)=C2e∫p(x)dx.μ′(x)μ(x)=p(x)∫μ′(x)μ(x)dx=∫p(x)dxln|μ(x)|=∫p(x)dx+Celn|μ(x)|=e∫p(x)dx+C|μ(x)|=C1e∫p(x)dxμ(x)=C2e∫p(x)dx.$

Here $C2C2$ 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 $μ(x).μ(x).$ This gives

$μ(x)y′+μ(x)p(x)y=μ(x)q(x).μ(x)y′+μ(x)p(x)y=μ(x)q(x).$
(4.20)

The left-hand side of Equation 4.20 can be rewritten as $ddx(μ(x)y).ddx(μ(x)y).$

$ddx(μ(x)y)=μ(x)q(x).ddx(μ(x)y)=μ(x)q(x).$
(4.21)

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

$∫ddx(μ(x)y)dx=∫μ(x)q(x)dxμ(x)y=∫μ(x)q(x)dx.∫ddx(μ(x)y)dx=∫μ(x)q(x)dxμ(x)y=∫μ(x)q(x)dx.$
(4.22)

Divide both sides of Equation 4.22 by $μ(x):μ(x):$

$y=1μ(x)[∫μ(x)q(x)dx+C].y=1μ(x)[∫μ(x)q(x)dx+C].$
(4.23)

Since $μ(x)μ(x)$ was previously calculated, we are now finished. An important note about the integrating constant $C:C:$ It may seem that we are inconsistent in the usage of the integrating constant. However, the integral involving $p(x)p(x)$ 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 $CC$ for this integral. We chose $C=0.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.

### Problem-Solving Strategy

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

1. Put the equation into standard form and identify $p(x)p(x)$ and $q(x).q(x).$
2. Calculate the integrating factor $μ(x)=e∫p(x)dx.μ(x)=e∫p(x)dx.$
3. Multiply both sides of the differential equation by $μ(x).μ(x).$
4. Integrate both sides of the equation obtained in step $3,3,$ and divide both sides by $μ(x).μ(x).$
5. If there is an initial condition, determine the value of $C.C.$

### Example 4.16

#### Solving a First-order Linear Equation

Find a general solution for the differential equation $xy′+3y=4x2−3x.xy′+3y=4x2−3x.$ Assume $x>0.x>0.$

#### Analysis

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

$e∫p(x)dx=e∫(3/x)dx=e3ln|x|=|x|3,e∫p(x)dx=e∫(3/x)dx=e3ln|x|=|x|3,$

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

### Checkpoint4.16

Find the general solution to the differential equation $(x−2)y′+y=3x2+2x.(x−2)y′+y=3x2+2x.$ Assume $x>2.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

$y′+3y=2x−1,y(0)=3.y′+3y=2x−1,y(0)=3.$

### Checkpoint4.17

Solve the initial-value problem $y′−2y=4x+3y(0)=−2.y′−2y=4x+3y(0)=−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 $22$ m/s. The mass of a racquetball is approximately $0.04270.0427$ kg. Air resistance acts on the ball with a force numerically equal to $0.5v,0.5v,$ where $vv$ represents the velocity of the ball at time $t.t.$

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

### Checkpoint4.18

The weight of a penny is $2.52.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 $369369$ 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.0.0025v.$ Furthermore, the penny is dropped with no initial velocity imparted to it.

1. Set up an initial-value problem that represents the falling penny.
2. Solve the problem for $v(t).v(t).$
3. What is the terminal velocity of the penny (i.e., calculate the limit of the velocity as $tt$ 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:

1. The voltage drop across a resistor is given by
$ER=Ri,ER=Ri,$

where $RR$ is a constant of proportionality called the resistance, and $ii$ is the current.
2. The voltage drop across an inductor is given by
$EL=Li′,EL=Li′,$

where $LL$ is a constant of proportionality called the inductance, and $ii$ again denotes the current.
3. The voltage drop across a capacitor is given by
$EC=1Cq,EC=1Cq,$

where $CC$ is a constant of proportionality called the capacitance, and $qq$ is the instantaneous charge on the capacitor. The relationship between $ii$ and $qq$ is $i=q′.i=q′.$

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

Figure 4.25 A typical electric circuit, containing a voltage generator $( V S ) , ( V S ) ,$ capacitor $( C ) , ( C ) ,$ inductor $( L ) , ( L ) ,$ and resistor $( R ) . ( R ) .$

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

$EL+ER+EC=E.EL+ER+EC=E.$

Substituting the expressions for $EL,ER,EL,ER,$ and $ECEC$ into this equation, we obtain

$Li′+Ri+1Cq=E.Li′+Ri+1Cq=E.$
(4.24)

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

$Li′+Ri=E.Li′+Ri=E.$
(4.25)

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

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

$Rq′+1Cq=E,Rq′+1Cq=E,$
(4.26)

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=50sin20tV,E=50sin20tV,$ a resistor of $5Ω,5Ω,$ and an inductor of $0.4H.0.4H.$ If the initial current is $0,0,$ find the current at time $t>0.t>0.$

### Checkpoint4.19

A circuit has in series an electromotive force given by $E=20sin5tE=20sin5t$ V, a capacitor with capacitance $0.02F,0.02F,$ and a resistor of $8Ω.8Ω.$ If the initial charge is $4C,4C,$ find the charge at time $t>0.t>0.$

### Section 4.5 Exercises

Are the following differential equations linear? Explain your reasoning.

208 .

$d y d x = x 2 y + sin x d y d x = x 2 y + sin x$

209 .

$d y d t = t y d y d t = t y$

210 .

$d y d t + y 2 = x d y d t + y 2 = x$

211 .

$y ′ = x 3 + e x y ′ = x 3 + e x$

212 .

$y ′ = y + e y y ′ = y + e y$

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

213 .

$y ′ = x 3 y + sin x y ′ = x 3 y + sin x$

214 .

$y ′ + 3 y − ln x = 0 y ′ + 3 y − ln x = 0$

215 .

$− x y ′ = ( 3 x + 2 ) y + x e x − x y ′ = ( 3 x + 2 ) y + x e x$

216 .

$d y d t = 4 y + t y + tan t d y d t = 4 y + t y + tan t$

217 .

$d y d t = y x ( x + 1 ) d y d t = y x ( x + 1 )$

What are the integrating factors for the following differential equations?

218 .

$y ′ = x y + 3 y ′ = x y + 3$

219 .

$y ′ + e x y = sin x y ′ + e x y = sin x$

220 .

$y ′ = x ln ( x ) y + 3 x y ′ = x ln ( x ) y + 3 x$

221 .

$d y d x = tanh ( x ) y + 1 d y d x = tanh ( x ) y + 1$

222 .

$d y d t + 3 t y = e t y d y d t + 3 t y = e t y$

Solve the following differential equations by using integrating factors.

223 .

$y ′ = 3 y + 2 y ′ = 3 y + 2$

224 .

$y ′ = 2 y − x 2 y ′ = 2 y − x 2$

225 .

$x y ′ = 3 y − 6 x 2 x y ′ = 3 y − 6 x 2$

226 .

$( x + 2 ) y ′ = 3 x + y ( x + 2 ) y ′ = 3 x + y$

227 .

$y ′ = 3 x + x y y ′ = 3 x + x y$

228 .

$x y ′ = x + y x y ′ = x + y$

229 .

$sin ( x ) y ′ = y + 2 x sin ( x ) y ′ = y + 2 x$

230 .

$y ′ = y + e x y ′ = y + e x$

231 .

$x y ′ = 3 y + x 2 x y ′ = 3 y + x 2$

232 .

$y ′ + ln x = y x y ′ + ln x = 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?

233 .

[T] $(x+2)y′=2y−1(x+2)y′=2y−1$

234 .

[T] $y′=3et/3−2yy′=3et/3−2y$

235 .

[T] $xy′+y2=sin(3t)xy′+y2=sin(3t)$

236 .

[T] $xy′=2cosxx−3yxy′=2cosxx−3y$

237 .

[T] $(x+1)y′=3y+x2+2x+1(x+1)y′=3y+x2+2x+1$

238 .

[T] $sin(x)y′+cos(x)y=2xsin(x)y′+cos(x)y=2x$

239 .

[T] $x2+1y′=y+2x2+1y′=y+2$

240 .

[T] $x3y′+2x2y=x+1x3y′+2x2y=x+1$

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

241 .

$y ′ + y = x , y ( 0 ) = 3 y ′ + y = x , y ( 0 ) = 3$

242 .

$y ′ = y + 2 x 2 , y ( 0 ) = 0 y ′ = y + 2 x 2 , y ( 0 ) = 0$

243 .

$x y ′ = y − 3 x 3 , y ( 1 ) = 0 x y ′ = y − 3 x 3 , y ( 1 ) = 0$

244 .

$x 2 y ′ = x y − ln x , y ( 1 ) = 1 x 2 y ′ = x y − ln x , y ( 1 ) = 1$

245 .

$( 1 + x 2 ) y ′ = y − 1 , y ( 0 ) = 0 ( 1 + x 2 ) y ′ = y − 1 , y ( 0 ) = 0$

246 .

$x y ′ = y + 2 x ln x , y ( 1 ) = 5 x y ′ = y + 2 x ln x , y ( 1 ) = 5$

247 .

$( 2 + x ) y ′ = y + 2 + x , y ( 0 ) = 0 ( 2 + x ) y ′ = y + 2 + x , y ( 0 ) = 0$

248 .

$y ′ = x y + 2 x e x , y ( 0 ) = 2 y ′ = x y + 2 x e x , y ( 0 ) = 2$

249 .

$x y ′ = y + 2 x , y ( 0 ) = 1 x y ′ = y + 2 x , y ( 0 ) = 1$

250 .

$y ′ = 2 y + x e x , y ( 0 ) = −1 y ′ = 2 y + x e x , y ( 0 ) = −1$

251 .

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

252 .

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

253 .

[T] Using your equation for terminal velocity, solve for the distance fallen. How long does it take to fall $50005000$ meters if the mass is $100100$ kilograms, the acceleration due to gravity is $9.89.8$ m/s2 and the proportionality constant is $4?4?$

254 .

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.k.$ Set up the differential equation and solve for the velocity.

255 .

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

256 .

[T] Using your equation for terminal velocity, solve for the distance fallen. How long does it take to fall $50005000$ meters if the mass is $100100$ kilograms, the acceleration due to gravity is $9.8m/s29.8m/s2$ and the proportionality constant is $4?4?$ Does it take more or less time than your initial estimate?

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

257 .

Solve the generic equation $y′=ax+y.y′=ax+y.$ How does varying $aa$ change the behavior?

258 .

Solve the generic equation $y′=ay+x.y′=ay+x.$ How does varying $aa$ change the behavior?

259 .

Solve the generic equation $y′=ax+xy.y′=ax+xy.$ How does varying $aa$ change the behavior?

260 .

Solve the generic equation $y′=x+axy.y′=x+axy.$ How does varying $aa$ change the behavior?

261 .

Solve $y′−y=ekty′−y=ekt$ with the initial condition $y(0)=0.y(0)=0.$ As $kk$ approaches $1,1,$ what happens to your formula?

Order a print copy

As an Amazon Associate we earn from qualifying purchases.