Skip to Content
OpenStax Logo
Calculus Volume 3

7.2 Nonhomogeneous Linear Equations

Calculus Volume 37.2 Nonhomogeneous Linear Equations
Buy book
  1. Preface
  2. 1 Parametric Equations and Polar Coordinates
    1. Introduction
    2. 1.1 Parametric Equations
    3. 1.2 Calculus of Parametric Curves
    4. 1.3 Polar Coordinates
    5. 1.4 Area and Arc Length in Polar Coordinates
    6. 1.5 Conic Sections
    7. Key Terms
    8. Key Equations
    9. Key Concepts
    10. Chapter Review Exercises
  3. 2 Vectors in Space
    1. Introduction
    2. 2.1 Vectors in the Plane
    3. 2.2 Vectors in Three Dimensions
    4. 2.3 The Dot Product
    5. 2.4 The Cross Product
    6. 2.5 Equations of Lines and Planes in Space
    7. 2.6 Quadric Surfaces
    8. 2.7 Cylindrical and Spherical Coordinates
    9. Key Terms
    10. Key Equations
    11. Key Concepts
    12. Chapter Review Exercises
  4. 3 Vector-Valued Functions
    1. Introduction
    2. 3.1 Vector-Valued Functions and Space Curves
    3. 3.2 Calculus of Vector-Valued Functions
    4. 3.3 Arc Length and Curvature
    5. 3.4 Motion in Space
    6. Key Terms
    7. Key Equations
    8. Key Concepts
    9. Chapter Review Exercises
  5. 4 Differentiation of Functions of Several Variables
    1. Introduction
    2. 4.1 Functions of Several Variables
    3. 4.2 Limits and Continuity
    4. 4.3 Partial Derivatives
    5. 4.4 Tangent Planes and Linear Approximations
    6. 4.5 The Chain Rule
    7. 4.6 Directional Derivatives and the Gradient
    8. 4.7 Maxima/Minima Problems
    9. 4.8 Lagrange Multipliers
    10. Key Terms
    11. Key Equations
    12. Key Concepts
    13. Chapter Review Exercises
  6. 5 Multiple Integration
    1. Introduction
    2. 5.1 Double Integrals over Rectangular Regions
    3. 5.2 Double Integrals over General Regions
    4. 5.3 Double Integrals in Polar Coordinates
    5. 5.4 Triple Integrals
    6. 5.5 Triple Integrals in Cylindrical and Spherical Coordinates
    7. 5.6 Calculating Centers of Mass and Moments of Inertia
    8. 5.7 Change of Variables in Multiple Integrals
    9. Key Terms
    10. Key Equations
    11. Key Concepts
    12. Chapter Review Exercises
  7. 6 Vector Calculus
    1. Introduction
    2. 6.1 Vector Fields
    3. 6.2 Line Integrals
    4. 6.3 Conservative Vector Fields
    5. 6.4 Green’s Theorem
    6. 6.5 Divergence and Curl
    7. 6.6 Surface Integrals
    8. 6.7 Stokes’ Theorem
    9. 6.8 The Divergence Theorem
    10. Key Terms
    11. Key Equations
    12. Key Concepts
    13. Chapter Review Exercises
  8. 7 Second-Order Differential Equations
    1. Introduction
    2. 7.1 Second-Order Linear Equations
    3. 7.2 Nonhomogeneous Linear Equations
    4. 7.3 Applications
    5. 7.4 Series Solutions of Differential Equations
    6. Key Terms
    7. Key Equations
    8. Key Concepts
    9. Chapter Review Exercises
  9. A | Table of Integrals
  10. B | Table of Derivatives
  11. C | Review of Pre-Calculus
  12. Answer Key
    1. Chapter 1
    2. Chapter 2
    3. Chapter 3
    4. Chapter 4
    5. Chapter 5
    6. Chapter 6
    7. Chapter 7
  13. Index

Learning Objectives

  • 7.2.1. Write the general solution to a nonhomogeneous differential equation.
  • 7.2.2. Solve a nonhomogeneous differential equation by the method of undetermined coefficients.
  • 7.2.3. Solve a nonhomogeneous differential equation by the method of variation of parameters.

In this section, we examine how to solve nonhomogeneous differential equations. The terminology and methods are different from those we used for homogeneous equations, so let’s start by defining some new terms.

General Solution to a Nonhomogeneous Linear Equation

Consider the nonhomogeneous linear differential equation

a2(x)y+a1(x)y+a0(x)y=r(x).a2(x)y+a1(x)y+a0(x)y=r(x).

The associated homogeneous equation

a2(x)y+a1(x)y+a0(x)y=0a2(x)y+a1(x)y+a0(x)y=0
7.3

is called the complementary equation. We will see that solving the complementary equation is an important step in solving a nonhomogeneous differential equation.

Definition

A solution yp(x)yp(x) of a differential equation that contains no arbitrary constants is called a particular solution to the equation.

Theorem 7.4

General Solution to a Nonhomogeneous Equation

Let yp(x)yp(x) be any particular solution to the nonhomogeneous linear differential equation

a2(x)y+a1(x)y+a0(x)y=r(x).a2(x)y+a1(x)y+a0(x)y=r(x).

Also, let c1y1(x)+c2y2(x)c1y1(x)+c2y2(x) denote the general solution to the complementary equation. Then, the general solution to the nonhomogeneous equation is given by

y(x)=c1y1(x)+c2y2(x)+yp(x).y(x)=c1y1(x)+c2y2(x)+yp(x).
7.4

Proof

To prove y(x)y(x) is the general solution, we must first show that it solves the differential equation and, second, that any solution to the differential equation can be written in that form. Substituting y(x)y(x) into the differential equation, we have

a2(x)y+a1(x)y+a0(x)y=a2(x)(c1y1+c2y2+yp)+a1(x)(c1y1+c2y2+yp)+a0(x)(c1y1+c2y2+yp)=[a2(x)(c1y1+c2y2)+a1(x)(c1y1+c2y2)+a0(x)(c1y1+c2y2)]+a2(x)yp+a1(x)yp+a0(x)yp=0+r(x)=r(x).a2(x)y+a1(x)y+a0(x)y=a2(x)(c1y1+c2y2+yp)+a1(x)(c1y1+c2y2+yp)+a0(x)(c1y1+c2y2+yp)=[a2(x)(c1y1+c2y2)+a1(x)(c1y1+c2y2)+a0(x)(c1y1+c2y2)]+a2(x)yp+a1(x)yp+a0(x)yp=0+r(x)=r(x).

So y(x)y(x) is a solution.

Now, let z(x)z(x) be any solution to a2(x)y+a1(x)y+a0(x)y=r(x).a2(x)y+a1(x)y+a0(x)y=r(x). Then

a2(x)(zyp)+a1(x)(zyp)+a0(x)(zyp)=(a2(x)z+a1(x)z+a0(x)z)(a2(x)yp+a1(x)yp+a0(x)yp)=r(x)r(x)=0,a2(x)(zyp)+a1(x)(zyp)+a0(x)(zyp)=(a2(x)z+a1(x)z+a0(x)z)(a2(x)yp+a1(x)yp+a0(x)yp)=r(x)r(x)=0,

so z(x)yp(x)z(x)yp(x) is a solution to the complementary equation. But, c1y1(x)+c2y2(x)c1y1(x)+c2y2(x) is the general solution to the complementary equation, so there are constants c1c1 and c2c2 such that

z(x)yp(x)=c1y1(x)+c2y2(x).z(x)yp(x)=c1y1(x)+c2y2(x).

Hence, we see that z(x)=c1y1(x)+c2y2(x)+yp(x).z(x)=c1y1(x)+c2y2(x)+yp(x).

Example 7.11

Verifying the General Solution

Given that yp(x)=xyp(x)=x is a particular solution to the differential equation y+y=x,y+y=x, write the general solution and check by verifying that the solution satisfies the equation.

Solution

The complementary equation is y+y=0,y+y=0, which has the general solution c1cosx+c2sinx.c1cosx+c2sinx. So, the general solution to the nonhomogeneous equation is

y(x)=c1cosx+c2sinx+x.y(x)=c1cosx+c2sinx+x.

To verify that this is a solution, substitute it into the differential equation. We have

y(x)=c1sinx+c2cosx+1andy(x)=c1cosxc2sinx.y(x)=c1sinx+c2cosx+1andy(x)=c1cosxc2sinx.

Then

y(x)+y(x)=c1cosxc2sinx+c1cosx+c2sinx+x=x.y(x)+y(x)=c1cosxc2sinx+c1cosx+c2sinx+x=x.

So, y(x)y(x) is a solution to y+y=x.y+y=x.

Checkpoint 7.10

Given that yp(x)=−2yp(x)=−2 is a particular solution to y3y4y=8,y3y4y=8, write the general solution and verify that the general solution satisfies the equation.

In the preceding section, we learned how to solve homogeneous equations with constant coefficients. Therefore, for nonhomogeneous equations of the form ay+by+cy=r(x),ay+by+cy=r(x), we already know how to solve the complementary equation, and the problem boils down to finding a particular solution for the nonhomogeneous equation. We now examine two techniques for this: the method of undetermined coefficients and the method of variation of parameters.

Undetermined Coefficients

The method of undetermined coefficients involves making educated guesses about the form of the particular solution based on the form of r(x).r(x). When we take derivatives of polynomials, exponential functions, sines, and cosines, we get polynomials, exponential functions, sines, and cosines. So when r(x)r(x) has one of these forms, it is possible that the solution to the nonhomogeneous differential equation might take that same form. Let’s look at some examples to see how this works.

Example 7.12

Undetermined Coefficients When r(x)r(x) Is a Polynomial

Find the general solution to y+4y+3y=3x.y+4y+3y=3x.

Solution

The complementary equation is y+4y+3y=0,y+4y+3y=0, with general solution c1ex+c2e−3x.c1ex+c2e−3x. Since r(x)=3x,r(x)=3x, the particular solution might have the form yp(x)=Ax+B.yp(x)=Ax+B. If this is the case, then we have yp(x)=Ayp(x)=A and yp(x)=0.yp(x)=0. For ypyp to be a solution to the differential equation, we must find values for AA and BB such that

y+4y+3y=3x0+4(A)+3(Ax+B)=3x3Ax+(4A+3B)=3x.y+4y+3y=3x0+4(A)+3(Ax+B)=3x3Ax+(4A+3B)=3x.

Setting coefficients of like terms equal, we have

3A=34A+3B=0.3A=34A+3B=0.

Then, A=1A=1 and B=43,B=43, so yp(x)=x43yp(x)=x43 and the general solution is

y(x)=c1ex+c2e−3x+x43.y(x)=c1ex+c2e−3x+x43.

In Example 7.12, notice that even though r(x)r(x) did not include a constant term, it was necessary for us to include the constant term in our guess. If we had assumed a solution of the form yp=Axyp=Ax (with no constant term), we would not have been able to find a solution. (Verify this!) If the function r(x)r(x) is a polynomial, our guess for the particular solution should be a polynomial of the same degree, and it must include all lower-order terms, regardless of whether they are present in r(x).r(x).

Example 7.13

Undetermined Coefficients When r(x)r(x) Is an Exponential

Find the general solution to yy2y=2e3x.yy2y=2e3x.

Solution

The complementary equation is yy2y=0,yy2y=0, with the general solution c1ex+c2e2x.c1ex+c2e2x. Since r(x)=2e3x,r(x)=2e3x, the particular solution might have the form yp(x)=Ae3x.yp(x)=Ae3x. Then, we have yp(x)=3Ae3xyp(x)=3Ae3x and yp(x)=9Ae3x.yp(x)=9Ae3x. For ypyp to be a solution to the differential equation, we must find a value for AA such that

yy2y=2e3x9Ae3x3Ae3x2Ae3x=2e3x4Ae3x=2e3x.yy2y=2e3x9Ae3x3Ae3x2Ae3x=2e3x4Ae3x=2e3x.

So, 4A=24A=2 and A=1/2.A=1/2. Then, yp(x)=(12)e3x,yp(x)=(12)e3x, and the general solution is

y(x)=c1ex+c2e2x+12e3x.y(x)=c1ex+c2e2x+12e3x.
Checkpoint 7.11

Find the general solution to y4y+4y=7sintcost.y4y+4y=7sintcost.

In the previous checkpoint, r(x)r(x) included both sine and cosine terms. However, even if r(x)r(x) included a sine term only or a cosine term only, both terms must be present in the guess. The method of undetermined coefficients also works with products of polynomials, exponentials, sines, and cosines. Some of the key forms of r(x)r(x) and the associated guesses for yp(x)yp(x) are summarized in Table 7.2.

r(x)r(x) Initial guess for yp(x)yp(x)
kk (a constant) AA (a constant)
ax+bax+b Ax+BAx+B (Note: The guess must include both terms even if b=0.b=0.)
ax2+bx+cax2+bx+c Ax2+Bx+CAx2+Bx+C (Note: The guess must include all three terms even if bb or cc are zero.)
Higher-order polynomials Polynomial of the same order as r(x)r(x)
aeλxaeλx AeλxAeλx
acosβx+bsinβxacosβx+bsinβx Acosβx+BsinβxAcosβx+Bsinβx (Note: The guess must include both terms even if either a=0a=0 or b=0.b=0.)
aeαxcosβx+beαxsinβxaeαxcosβx+beαxsinβx Aeαxcosβx+BeαxsinβxAeαxcosβx+Beαxsinβx
(ax2+bx+c)eλx(ax2+bx+c)eλx (Ax2+Bx+C)eλx(Ax2+Bx+C)eλx
(a2x2+a1x+a0)cosβx+(b2x2+b1x+b0)sinβx(a2x2+a1x+a0)cosβx+(b2x2+b1x+b0)sinβx (A2x2+A1x+A0)cosβx+(B2x2+B1x+B0)sinβx(A2x2+A1x+A0)cosβx+(B2x2+B1x+B0)sinβx
(a2x2+a1x+a0)eαxcosβx+(b2x2+b1x+b0)eαxsinβx(a2x2+a1x+a0)eαxcosβx+(b2x2+b1x+b0)eαxsinβx (A2x2+A1x+A0)eαxcosβx+(B2x2+B1x+B0)eαxsinβx(A2x2+A1x+A0)eαxcosβx+(B2x2+B1x+B0)eαxsinβx
Table 7.2 Key Forms for the Method of Undetermined Coefficients

Keep in mind that there is a key pitfall to this method. Consider the differential equation y+5y+6y=3e−2x.y+5y+6y=3e−2x. Based on the form of r(x),r(x), we guess a particular solution of the form yp(x)=Ae−2x.yp(x)=Ae−2x. But when we substitute this expression into the differential equation to find a value for A,A, we run into a problem. We have

yp(x)=−2Ae−2xyp(x)=−2Ae−2x

and

yp=4Ae−2x,yp=4Ae−2x,

so we want

y+5y+6y=3e−2x4Ae−2x+5(−2Ae−2x)+6Ae−2x=3e−2x4Ae−2x10Ae−2x+6Ae−2x=3e−2x0=3e−2x,y+5y+6y=3e−2x4Ae−2x+5(−2Ae−2x)+6Ae−2x=3e−2x4Ae−2x10Ae−2x+6Ae−2x=3e−2x0=3e−2x,

which is not possible.

Looking closely, we see that, in this case, the general solution to the complementary equation is c1e−2x+c2e−3x.c1e−2x+c2e−3x. The exponential function in r(x)r(x) is actually a solution to the complementary equation, so, as we just saw, all the terms on the left side of the equation cancel out. We can still use the method of undetermined coefficients in this case, but we have to alter our guess by multiplying it byx.x. Using the new guess, yp(x)=Axe−2x,yp(x)=Axe−2x, we have

yp(x)=A(e−2x2xe−2x)yp(x)=A(e−2x2xe−2x)

and

yp(x)=−4Ae−2x+4Axe−2x.yp(x)=−4Ae−2x+4Axe−2x.

Substitution gives

y+5y+6y=3e−2x(−4Ae−2x+4Axe−2x)+5(Ae−2x2Axe−2x)+6Axe−2x=3e−2x−4Ae−2x+4Axe−2x+5Ae−2x10Axe−2x+6Axe−2x=3e−2xAe−2x=3e−2x.y+5y+6y=3e−2x(−4Ae−2x+4Axe−2x)+5(Ae−2x2Axe−2x)+6Axe−2x=3e−2x−4Ae−2x+4Axe−2x+5Ae−2x10Axe−2x+6Axe−2x=3e−2xAe−2x=3e−2x.

So, A=3A=3 and yp(x)=3xe−2x.yp(x)=3xe−2x. This gives us the following general solution

y(x)=c1e−2x+c2e−3x+3xe−2x.y(x)=c1e−2x+c2e−3x+3xe−2x.

Note that if xe−2xxe−2x were also a solution to the complementary equation, we would have to multiply by xx again, and we would try yp(x)=Ax2e−2x.yp(x)=Ax2e−2x.

Problem-Solving Strategy: Method of Undetermined Coefficients
  1. Solve the complementary equation and write down the general solution.
  2. Based on the form of r(x),r(x), make an initial guess for yp(x).yp(x).
  3. Check whether any term in the guess for yp(x)yp(x) is a solution to the complementary equation. If so, multiply the guess byx.x. Repeat this step until there are no terms in yp(x)yp(x) that solve the complementary equation.
  4. Substitute yp(x)yp(x) into the differential equation and equate like terms to find values for the unknown coefficients in yp(x).yp(x).
  5. Add the general solution to the complementary equation and the particular solution you just found to obtain the general solution to the nonhomogeneous equation.

Example 7.14

Solving Nonhomogeneous Equations

Find the general solutions to the following differential equations.

  1. y9y=−6cos3xy9y=−6cos3x
  2. x+2x+x=4etx+2x+x=4et
  3. y2y+5y=10x23x3y2y+5y=10x23x3
  4. y3y=−12ty3y=−12t

Solution

  1. The complementary equation is y9y=0,y9y=0, which has the general solution c1e3x+c2e−3xc1e3x+c2e−3x (step 1). Based on the form of r(x)=−6cos3x,r(x)=−6cos3x, our initial guess for the particular solution is yp(x)=Acos3x+Bsin3xyp(x)=Acos3x+Bsin3x (step 2). None of the terms in yp(x)yp(x) solve the complementary equation, so this is a valid guess (step 3).
    Now we want to find values for AA and B,B, so substitute ypyp into the differential equation. We have
    yp(x)=−3Asin3x+3Bcos3xandyp(x)=−9Acos3x9Bsin3x,yp(x)=−3Asin3x+3Bcos3xandyp(x)=−9Acos3x9Bsin3x,

    so we want to find values of AA and BB such that
    y9y=−6cos3x−9Acos3x9Bsin3x9(Acos3x+Bsin3x)=−6cos3x−18Acos3x18Bsin3x=−6cos3x.y9y=−6cos3x−9Acos3x9Bsin3x9(Acos3x+Bsin3x)=−6cos3x−18Acos3x18Bsin3x=−6cos3x.

    Therefore,
    −18A=−6−18B=0.−18A=−6−18B=0.

    This gives A=13A=13 and B=0,B=0, so yp(x)=(13)cos3xyp(x)=(13)cos3x (step 4).
    Putting everything together, we have the general solution
    y(x)=c1e3x+c2e−3x+13cos3x.y(x)=c1e3x+c2e−3x+13cos3x.
  2. The complementary equation is x+2x+x=0,x+2x+x=0, which has the general solution c1et+c2tetc1et+c2tet (step 1). Based on the form r(t)=4et,r(t)=4et, our initial guess for the particular solution is xp(t)=Aetxp(t)=Aet (step 2). However, we see that this guess solves the complementary equation, so we must multiply byt,t, which gives a new guess: xp(t)=Atetxp(t)=Atet (step 3). Checking this new guess, we see that it, too, solves the complementary equation, so we must multiply by t again, which gives xp(t)=At2etxp(t)=At2et (step 3 again). Now, checking this guess, we see that xp(t)xp(t) does not solve the complementary equation, so this is a valid guess (step 3 yet again).
    We now want to find a value for A,A, so we substitute xpxp into the differential equation. We have
    xp(t)=At2et,soxp(t)=2AtetAt2etxp(t)=At2et,soxp(t)=2AtetAt2et

    and xp(t)=2Aet2Atet(2AtetAt2et)=2Aet4Atet+At2et.xp(t)=2Aet2Atet(2AtetAt2et)=2Aet4Atet+At2et.
    Substituting into the differential equation, we want to find a value of AA so that
    x+2x+x=4et2Aet4Atet+At2et+2(2AtetAt2et)+At2et=4et2Aet=4et.x+2x+x=4et2Aet4Atet+At2et+2(2AtetAt2et)+At2et=4et2Aet=4et.

    This gives A=2,A=2, so xp(t)=2t2etxp(t)=2t2et (step 4). Putting everything together, we have the general solution
    x(t)=c1et+c2tet+2t2et.x(t)=c1et+c2tet+2t2et.
  3. The complementary equation is y2y+5y=0,y2y+5y=0, which has the general solution c1excos2x+c2exsin2xc1excos2x+c2exsin2x (step 1). Based on the form r(x)=10x23x3,r(x)=10x23x3, our initial guess for the particular solution is yp(x)=Ax2+Bx+Cyp(x)=Ax2+Bx+C (step 2). None of the terms in yp(x)yp(x) solve the complementary equation, so this is a valid guess (step 3). We now want to find values for A,A, B,B, and C,C, so we substitute ypyp into the differential equation. We have yp(x)=2Ax+Byp(x)=2Ax+B and yp(x)=2A,yp(x)=2A, so we want to find values of A,A, B,B, and CC such that
    y2y+5y=10x23x32A2(2Ax+B)+5(Ax2+Bx+C)=10x23x35Ax2+(5B4A)x+(5C2B+2A)=10x23x3.y2y+5y=10x23x32A2(2Ax+B)+5(Ax2+Bx+C)=10x23x35Ax2+(5B4A)x+(5C2B+2A)=10x23x3.

    Therefore,
    5A=105B4A=−35C2B+2A=−3.5A=105B4A=−35C2B+2A=−3.

    This gives A=2,A=2, B=1,B=1, and C=−1,C=−1, so yp(x)=2x2+x1yp(x)=2x2+x1 (step 4). Putting everything together, we have the general solution
    y(x)=c1excos2x+c2exsin2x+2x2+x1.y(x)=c1excos2x+c2exsin2x+2x2+x1.
  4. The complementary equation is y3y=0,y3y=0, which has the general solution c1e3t+c2c1e3t+c2 (step 1). Based on the form r(t)=−12t,r(t)=−12t, our initial guess for the particular solution is yp(t)=At+Byp(t)=At+B (step 2). However, we see that the constant term in this guess solves the complementary equation, so we must multiply by t,t, which gives a new guess: yp(t)=At2+Btyp(t)=At2+Bt (step 3). Checking this new guess, we see that none of the terms in yp(t)yp(t) solve the complementary equation, so this is a valid guess (step 3 again). We now want to find values for AA and B,B, so we substitute ypyp into the differential equation. We have yp(t)=2At+Byp(t)=2At+B and yp(t)=2A,yp(t)=2A, so we want to find values of AA and BB such that
    y3y=−12t2A3(2At+B)=−12t6At+(2A3B)=−12t.y3y=−12t2A3(2At+B)=−12t6At+(2A3B)=−12t.

    Therefore,
    −6A=−122A3B=0.−6A=−122A3B=0.

    This gives A=2A=2 and B=4/3,B=4/3, so yp(t)=2t2+(4/3)typ(t)=2t2+(4/3)t (step 4). Putting everything together, we have the general solution
    y(t)=c1e3t+c2+2t2+43t.y(t)=c1e3t+c2+2t2+43t.
Checkpoint 7.12

Find the general solution to the following differential equations.

  1. y5y+4y=3exy5y+4y=3ex
  2. y+y6y=52cos2ty+y6y=52cos2t

Variation of Parameters

Sometimes, r(x)r(x) is not a combination of polynomials, exponentials, or sines and cosines. When this is the case, the method of undetermined coefficients does not work, and we have to use another approach to find a particular solution to the differential equation. We use an approach called the method of variation of parameters.

To simplify our calculations a little, we are going to divide the differential equation through by a,a, so we have a leading coefficient of 1. Then the differential equation has the form

y+py+qy=r(x),y+py+qy=r(x),

where pp and qq are constants.

If the general solution to the complementary equation is given by c1y1(x)+c2y2(x),c1y1(x)+c2y2(x), we are going to look for a particular solution of the form yp(x)=u(x)y1(x)+v(x)y2(x).yp(x)=u(x)y1(x)+v(x)y2(x). In this case, we use the two linearly independent solutions to the complementary equation to form our particular solution. However, we are assuming the coefficients are functions of x, rather than constants. We want to find functions u(x)u(x) and v(x)v(x) such that yp(x)yp(x) satisfies the differential equation. We have

yp=uy1+vy2yp=uy1+uy1+vy2+vy2yp=(uy1+vy2)+uy1+uy1+vy2+vy2.yp=uy1+vy2yp=uy1+uy1+vy2+vy2yp=(uy1+vy2)+uy1+uy1+vy2+vy2.

Substituting into the differential equation, we obtain

yp+pyp+qyp=[(uy1+vy2)+uy1+uy1+vy2+vy2]+p[uy1+uy1+vy2+vy2]+q[uy1+vy2]=u[y1+py1+qy1]+v[y2+py2+qy2]+(uy1+vy2)+p(uy1+vy2)+(uy1+vy2).yp+pyp+qyp=[(uy1+vy2)+uy1+uy1+vy2+vy2]+p[uy1+uy1+vy2+vy2]+q[uy1+vy2]=u[y1+py1+qy1]+v[y2+py2+qy2]+(uy1+vy2)+p(uy1+vy2)+(uy1+vy2).

Note that y1y1 and y2y2 are solutions to the complementary equation, so the first two terms are zero. Thus, we have

(uy1+vy2)+p(uy1+vy2)+(uy1+vy2)=r(x).(uy1+vy2)+p(uy1+vy2)+(uy1+vy2)=r(x).

If we simplify this equation by imposing the additional condition uy1+vy2=0,uy1+vy2=0, the first two terms are zero, and this reduces to uy1+vy2=r(x).uy1+vy2=r(x). So, with this additional condition, we have a system of two equations in two unknowns:

uy1+vy2=0uy1+vy2=r(x).uy1+vy2=0uy1+vy2=r(x).

Solving this system gives us uu and v,v, which we can integrate to find u and v.

Then, yp(x)=u(x)y1(x)+v(x)y2(x)yp(x)=u(x)y1(x)+v(x)y2(x) is a particular solution to the differential equation. Solving this system of equations is sometimes challenging, so let’s take this opportunity to review Cramer’s rule, which allows us to solve the system of equations using determinants.

Rule: Cramer’s Rule

The system of equations

a1z1+b1z2=r1a2z1+b2z2=r2a1z1+b1z2=r1a2z1+b2z2=r2

has a unique solution if and only if the determinant of the coefficients is not zero. In this case, the solution is given by

z1=|r1b1r2b2||a1b1a2b2|andz2=|a1r1a2r2||a1b1a2b2|.z1=|r1b1r2b2||a1b1a2b2|andz2=|a1r1a2r2||a1b1a2b2|.

Example 7.15

Using Cramer’s Rule

Use Cramer’s rule to solve the following system of equations.

x2z1+2xz2=0z13x2z2=2xx2z1+2xz2=0z13x2z2=2x

Solution

We have

a1(x)=x2a2(x)=1b1(x)=2xb2(x)=−3x2r1(x)=0r2(x)=2x.a1(x)=x2a2(x)=1b1(x)=2xb2(x)=−3x2r1(x)=0r2(x)=2x.

Then,

|a1b1a2b2|=|x22x1−3x2|=−3x42x|a1b1a2b2|=|x22x1−3x2|=−3x42x

and

|r1b1r2b2|=|02x2x−3x2|=04x2=−4x2.|r1b1r2b2|=|02x2x−3x2|=04x2=−4x2.

Thus,

z1=|r1b1r2b2||a1b1a2b2|=−4x2−3x42x=4x3x3+2.z1=|r1b1r2b2||a1b1a2b2|=−4x2−3x42x=4x3x3+2.

In addition,

|a1r1a2r2|=|x2012x|=2x30=2x3.|a1r1a2r2|=|x2012x|=2x30=2x3.

Thus,

z2=|a1r1a2r2||a1b1a2b2|=2x3−3x42x=−2x23x3+2.z2=|a1r1a2r2||a1b1a2b2|=2x3−3x42x=−2x23x3+2.
Checkpoint 7.13

Use Cramer’s rule to solve the following system of equations.

2xz13z2=0x2z1+4xz2=x+12xz13z2=0x2z1+4xz2=x+1
Problem-Solving Strategy: Method of Variation of Parameters
  1. Solve the complementary equation and write down the general solution
    c1y1(x)+c2y2(x).c1y1(x)+c2y2(x).
  2. Use Cramer’s rule or another suitable technique to find functions u(x)u(x) and v(x)v(x) satisfying
    uy1+vy2=0uy1+vy2=r(x).uy1+vy2=0uy1+vy2=r(x).
  3. Integrate uu and vv to find u(x)u(x) and v(x).v(x). Then, yp(x)=u(x)y1(x)+v(x)y2(x)yp(x)=u(x)y1(x)+v(x)y2(x) is a particular solution to the equation.
  4. Add the general solution to the complementary equation and the particular solution found in step 3 to obtain the general solution to the nonhomogeneous equation.

Example 7.16

Using the Method of Variation of Parameters

Find the general solution to the following differential equations.

  1. y2y+y=ett2y2y+y=ett2
  2. y+y=3sin2xy+y=3sin2x

Solution

  1. The complementary equation is y2y+y=0y2y+y=0 with associated general solution c1et+c2tet.c1et+c2tet. Therefore, y1(t)=ety1(t)=et and y2(t)=tet.y2(t)=tet. Calculating the derivatives, we get y1(t)=ety1(t)=et and y2(t)=et+tety2(t)=et+tet (step 1). Then, we want to find functions u(t)u(t) and v(t)v(t) so that
    uet+vtet=0uet+v(et+tet)=ett2.uet+vtet=0uet+v(et+tet)=ett2.

    Applying Cramer’s rule, we have
    u=|0tetett2et+tet||ettetetet+tet|=0tet(ett2)et(et+tet)ettet=e2tte2t=1tu=|0tetett2et+tet||ettetetet+tet|=0tet(ett2)et(et+tet)ettet=e2tte2t=1t

    and
    v=|et0etett2||ettetetet+tet|=et(ett2)e2t=1t2(step 2).v=|et0etett2||ettetetet+tet|=et(ett2)e2t=1t2(step 2).

    Integrating, we get
    u=1tdt=ln|t|v=1t2dt=1t(step 3).u=1tdt=ln|t|v=1t2dt=1t(step 3).

    Then we have
    yp=etln|t|1ttet=etln|t|et(step 4).yp=etln|t|1ttet=etln|t|et(step 4).

    The etet term is a solution to the complementary equation, so we don’t need to carry that term into our general solution explicitly. The general solution is
    y(t)=c1et+c2tetetln|t|(step 5).y(t)=c1et+c2tetetln|t|(step 5).
  2. The complementary equation is y+y=0y+y=0 with associated general solution c1cosx+c2sinx.c1cosx+c2sinx. So, y1(x)=cosxy1(x)=cosx and y2(x)=sinxy2(x)=sinx (step 1). Then, we want to find functions u(x)u(x) and v(x)v(x) such that
    ucosx+vsinx=0usinx+vcosx=3sin2x.ucosx+vsinx=0usinx+vcosx=3sin2x.

    Applying Cramer’s rule, we have
    u=|0sinx3sin2xcosx||cosxsinxsinxcosx|=03sin3xcos2x+sin2x=−3sin3xu=|0sinx3sin2xcosx||cosxsinxsinxcosx|=03sin3xcos2x+sin2x=−3sin3x

    and
    v=|cosx0sinx3sin2x||cosxsinxsinxcosx|=3sin2xcosx1=3sin2xcosx(step 2).v=|cosx0sinx3sin2x||cosxsinxsinxcosx|=3sin2xcosx1=3sin2xcosx(step 2).

    Integrating first to find u, we get
    u=−3sin3xdx=−3[13sin2xcosx+23sinxdx]=sin2xcosx+2cosx.u=−3sin3xdx=−3[13sin2xcosx+23sinxdx]=sin2xcosx+2cosx.

    Now, we integrate to find v. Using substitution (with w=sinxw=sinx), we get
    v=3sin2xcosxdx=3w2dw=w3=sin3x.v=3sin2xcosxdx=3w2dw=w3=sin3x.

    Then,
    yp=(sin2xcosx+2cosx)cosx+(sin3x)sinx=sin2xcos2x+2cos2x+sin4x=2cos2x+sin2x(cos2x+sin2x)(step 4).=2cos2x+sin2x=cos2x+1yp=(sin2xcosx+2cosx)cosx+(sin3x)sinx=sin2xcos2x+2cos2x+sin4x=2cos2x+sin2x(cos2x+sin2x)(step 4).=2cos2x+sin2x=cos2x+1

    The general solution is
    y(x)=c1cosx+c2sinx+1+cos2x(step 5).y(x)=c1cosx+c2sinx+1+cos2x(step 5).
Checkpoint 7.14

Find the general solution to the following differential equations.

  1. y+y=secxy+y=secx
  2. x2x+x=ettx2x+x=ett

Section 7.2 Exercises

Solve the following equations using the method of undetermined coefficients.

54.

2y5y12y=62y5y12y=6

55.

3y+y4y=83y+y4y=8

56.

y6y+5y=exy6y+5y=ex

57.

y+16y=e−2xy+16y=e−2x

58.

y4y=x2+1y4y=x2+1

59.

y4y+4y=8x2+4xy4y+4y=8x2+4x

60.

y2y3y=sin2xy2y3y=sin2x

61.

y+2y+y=sinx+cosxy+2y+y=sinx+cosx

62.

y+9y=excosxy+9y=excosx

63.

y+y=3sin2x+xcos2xy+y=3sin2x+xcos2x

64.

y+3y28y=10e4xy+3y28y=10e4x

65.

y+10y+25y=xe−5x+4y+10y+25y=xe−5x+4

In each of the following problems,

  1. Write the form for the particular solution yp(x)yp(x) for the method of undetermined coefficients.
  2. [T] Use a computer algebra system to find a particular solution to the given equation.
66.

yyy=x+exyyy=x+ex

67.

y3y=x24x+11y3y=x24x+11

68.

yy4y=excos3xyy4y=excos3x

69.

2yy+y=(x25x)ex2yy+y=(x25x)ex

70.

4y+5y2y=e2x+xsinx4y+5y2y=e2x+xsinx

71.

yy2y=x2exsinxyy2y=x2exsinx

Solve the differential equation using either the method of undetermined coefficients or the variation of parameters.

72.

y+3y4y=2exy+3y4y=2ex

73.

y+2y=e3xy+2y=e3x

74.

y+6y+9y=exy+6y+9y=ex

75.

y+2y8y=6e2xy+2y8y=6e2x

Solve the differential equation using the method of variation of parameters.

76.

4y+y=2sinx4y+y=2sinx

77.

y9y=8xy9y=8x

78.

y+y=secx,0<x<π/2y+y=secx,0<x<π/2

79.

y+4y=3csc2x,0<x<π/2y+4y=3csc2x,0<x<π/2

Find the unique solution satisfying the differential equation and the initial conditions given, where yp(x)yp(x) is the particular solution.

80.

y2y+y=12ex,y2y+y=12ex, yp(x)=6x2ex,yp(x)=6x2ex, y(0)=6,y(0)=0y(0)=6,y(0)=0

81.

y7y=4xe7x,y7y=4xe7x, yp(x)=27x2e7x449xe7x,yp(x)=27x2e7x449xe7x, y(0)=−1,y(0)=0y(0)=−1,y(0)=0

82.

y+y=cosx4sinx,y+y=cosx4sinx, yp(x)=2xcosx+12xsinx,yp(x)=2xcosx+12xsinx, y(0)=8,y(0)=−4y(0)=8,y(0)=−4

83.

y5y=e5x+8e−5x,y5y=e5x+8e−5x, yp(x)=15xe5x+425e−5x,yp(x)=15xe5x+425e−5x, y(0)=−2,y(0)=0y(0)=−2,y(0)=0

In each of the following problems, two linearly independent solutions—y1y1 and y2y2—are given that satisfy the corresponding homogeneous equation. Use the method of variation of parameters to find a particular solution to the given nonhomogeneous equation. Assume x > 0 in each exercise.

84.

x2y+2xy2y=3x,x2y+2xy2y=3x, y1(x)=x,y2(x)=x−2y1(x)=x,y2(x)=x−2

85.

x2y2y=10x21,x2y2y=10x21, y1(x)=x2,y2(x)=x−1y1(x)=x2,y2(x)=x−1

Citation/Attribution

Want to cite, share, or modify this book? This book is Creative Commons Attribution-NonCommercial-ShareAlike License 4.0 and you must attribute OpenStax.

Attribution information
  • If you are redistributing all or part of this book in a print format, then you must include on every physical page the following attribution:
    Access for free at https://openstax.org/books/calculus-volume-3/pages/1-introduction
  • If you are redistributing all or part of this book in a digital format, then you must include on every digital page view the following attribution:
    Access for free at https://openstax.org/books/calculus-volume-3/pages/1-introduction
Citation information

© Mar 30, 2016 OpenStax. Textbook content produced by OpenStax is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike License 4.0 license. The OpenStax name, OpenStax logo, OpenStax book covers, OpenStax CNX name, and OpenStax CNX logo are not subject to the Creative Commons license and may not be reproduced without the prior and express written consent of Rice University.