Second-Order Differential Equations

48 Nonhomogeneous Linear Equations

Learning Objectives

  • Write the general solution to a nonhomogeneous differential equation.
  • Solve a nonhomogeneous differential equation by the method of undetermined coefficients.
  • 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

{a}_{2}\left(x\right)y\text{″}+{a}_{1}\left(x\right){y}^{\prime }+{a}_{0}\left(x\right)y=r\left(x\right).

The associated homogeneous equation

{a}_{2}\left(x\right)y\text{″}+{a}_{1}\left(x\right){y}^{\prime }+{a}_{0}\left(x\right)y=0

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 {y}_{p}\left(x\right) of a differential equation that contains no arbitrary constants is called a particular solution to the equation.

General Solution to a Nonhomogeneous Equation

Let {y}_{p}\left(x\right) be any particular solution to the nonhomogeneous linear differential equation

{a}_{2}\left(x\right)y\text{″}+{a}_{1}\left(x\right){y}^{\prime }+{a}_{0}\left(x\right)y=r\left(x\right).

Also, let {c}_{1}{y}_{1}\left(x\right)+{c}_{2}{y}_{2}\left(x\right) denote the general solution to the complementary equation. Then, the general solution to the nonhomogeneous equation is given by

y\left(x\right)={c}_{1}{y}_{1}\left(x\right)+{c}_{2}{y}_{2}\left(x\right)+{y}_{p}\left(x\text{).}

Proof

To prove y\left(x\right) 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\left(x\right) into the differential equation, we have

\begin{array}{cc}\hfill {a}_{2}\left(x\right)y\text{″}+{a}_{1}\left(x\right){y}^{\prime }+{a}_{0}\left(x\right)y& ={a}_{2}\left(x\right)\left({c}_{1}{y}_{1}+{c}_{2}{y}_{2}+{y}_{p}\right)\text{″}+{a}_{1}\left(x\right){\left({c}_{1}{y}_{1}+{c}_{2}{y}_{2}+{y}_{p}\right)}^{\prime }\hfill \\ & \phantom{\rule{2em}{0ex}}+{a}_{0}\left(x\right)\left({c}_{1}{y}_{1}+{c}_{2}{y}_{2}+{y}_{p}\right)\hfill \\ & =\left[{a}_{2}\left(x\right)\left({c}_{1}{y}_{1}+{c}_{2}{y}_{2}\right)\text{″}+{a}_{1}\left(x\right){\left({c}_{1}{y}_{1}+{c}_{2}{y}_{2}\right)}^{\prime }+{a}_{0}\left(x\right)\left({c}_{1}{y}_{1}+{c}_{2}{y}_{2}\right)\right]\hfill \\ & \phantom{\rule{2em}{0ex}}+{a}_{2}\left(x\right){y}_{p}\text{″}+{a}_{1}\left(x\right){y}_{p}{}^{\prime }+{a}_{0}\left(x\right){y}_{p}\hfill \\ & =0+r\left(x\right)\hfill \\ & =r\left(x\text{).}\hfill \end{array}

So y\left(x\right) is a solution.

Now, let z\left(x\right) be any solution to {a}_{2}\left(x\right)y\text{″}+{a}_{1}\left(x\right){y}^{\prime }+{a}_{0}\left(x\right)y=r\left(x\right). Then

\begin{array}{cc}\hfill {a}_{2}\left(x\right)\left(z-{y}_{p}\right)\text{″}+{a}_{1}\left(x\right){\left(z-{y}_{p}\right)}^{\prime }+{a}_{0}\left(x\right)\left(z-{y}_{p}\right)& =\left({a}_{2}\left(x\right)z\text{″}+{a}_{1}\left(x\right){z}^{\prime }+{a}_{0}\left(x\right)z\right)\hfill \\ & \phantom{\rule{2em}{0ex}}-\left({a}_{2}\left(x\right){y}_{p}\text{″}+{a}_{1}\left(x\right){y}_{p}{}^{\prime }+{a}_{0}\left(x\right){y}_{p}\right)\hfill \\ & =r\left(x\right)-r\left(x\right)\hfill \\ & =0,\hfill \end{array}

so z\left(x\right)-{y}_{p}\left(x\right) is a solution to the complementary equation. But, {c}_{1}{y}_{1}\left(x\right)+{c}_{2}{y}_{2}\left(x\right) is the general solution to the complementary equation, so there are constants {c}_{1} and {c}_{2} such that

z\left(x\right)-{y}_{p}\left(x\right)={c}_{1}{y}_{1}\left(x\right)+{c}_{2}{y}_{2}\left(x\text{).}

Hence, we see that z\left(x\right)={c}_{1}{y}_{1}\left(x\right)+{c}_{2}{y}_{2}\left(x\right)+{y}_{p}\left(x\text{).}

Verifying the General Solution

Given that {y}_{p}\left(x\right)=x is a particular solution to the differential equation y\text{″}+y=x, write the general solution and check by verifying that the solution satisfies the equation.

The complementary equation is y\text{″}+y=0, which has the general solution {c}_{1}\text{cos}\phantom{\rule{0.1em}{0ex}}x+{c}_{2}\text{sin}\phantom{\rule{0.1em}{0ex}}x\text{.} So, the general solution to the nonhomogeneous equation is

y\left(x\right)={c}_{1}\text{cos}\phantom{\rule{0.1em}{0ex}}x+{c}_{2}\text{sin}\phantom{\rule{0.1em}{0ex}}x+x\text{.}

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

{y}^{\prime }\left(x\right)=\text{−}{c}_{1}\text{sin}\phantom{\rule{0.1em}{0ex}}x+{c}_{2}\text{cos}\phantom{\rule{0.1em}{0ex}}x+1\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y\text{″}\left(x\right)=\text{−}{c}_{1}\text{cos}\phantom{\rule{0.1em}{0ex}}x-{c}_{2}\text{sin}\phantom{\rule{0.1em}{0ex}}x\text{.}

Then

\begin{array}{cc}\hfill y\text{″}\left(x\right)+y\left(x\right)& =\text{−}{c}_{1}\text{cos}\phantom{\rule{0.1em}{0ex}}x-{c}_{2}\text{sin}\phantom{\rule{0.1em}{0ex}}x+{c}_{1}\text{cos}\phantom{\rule{0.1em}{0ex}}x+{c}_{2}\text{sin}\phantom{\rule{0.1em}{0ex}}x+x\hfill \\ & =x\text{.}\hfill \end{array}

So, y\left(x\right) is a solution to y\text{″}+y=x\text{.}

Given that {y}_{p}\left(x\right)=-2 is a particular solution to y\text{″}-3{y}^{\prime }-4y=8, write the general solution and verify that the general solution satisfies the equation.

y\left(x\right)={c}_{1}{e}^{\text{−}x}+{c}_{2}{e}^{4x}-2

Hint

Find the general solution to the complementary equation.

In the preceding section, we learned how to solve homogeneous equations with constant coefficients. Therefore, for nonhomogeneous equations of the form ay\text{″}+b{y}^{\prime }+cy=r\left(x\right), 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\left(x\text{).} When we take derivatives of polynomials, exponential functions, sines, and cosines, we get polynomials, exponential functions, sines, and cosines. So when r\left(x\right) 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.

Undetermined Coefficients When r\left(x\right) Is a Polynomial

Find the general solution to y\text{″}+4{y}^{\prime }+3y=3x\text{.}

The complementary equation is y\text{″}+4{y}^{\prime }+3y=0, with general solution {c}_{1}{e}^{\text{−}x}+{c}_{2}{e}^{-3x}. Since r\left(x\right)=3x, the particular solution might have the form {y}_{p}\left(x\right)=Ax+B\text{.} If this is the case, then we have {y}_{p}{}^{\prime }\left(x\right)=A and {y}_{p}\text{″}\left(x\right)=0. For {y}_{p} to be a solution to the differential equation, we must find values for A and B such that

\begin{array}{ccc}\hfill y\text{″}+4{y}^{\prime }+3y& =\hfill & 3x\hfill \\ \hfill 0+4\left(A\right)+3\left(Ax+B\right)& =\hfill & 3x\hfill \\ \hfill 3Ax+\left(4A+3B\right)& =\hfill & 3x\text{.}\hfill \end{array}

Setting coefficients of like terms equal, we have

\begin{array}{ccc}\hfill 3A& =\hfill & 3\hfill \\ \hfill 4A+3B& =\hfill & 0.\hfill \end{array}

Then, A=1 and B=-\frac{4}{3}, so {y}_{p}\left(x\right)=x-\frac{4}{3} and the general solution is

y\left(x\right)={c}_{1}{e}^{\text{−}x}+{c}_{2}{e}^{-3x}+x-\frac{4}{3}.

In (Figure), notice that even though r\left(x\right) 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 {y}_{p}=Ax (with no constant term), we would not have been able to find a solution. (Verify this!) If the function r\left(x\right) 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\left(x\text{).}

Undetermined Coefficients When r\left(x\right) Is an Exponential

Find the general solution to y\text{″}-{y}^{\prime }-2y=2{e}^{3x}.

The complementary equation is y\text{″}-{y}^{\prime }-2y=0, with the general solution {c}_{1}{e}^{\text{−}x}+{c}_{2}{e}^{2x}. Since r\left(x\right)=2{e}^{3x}, the particular solution might have the form {y}_{p}\left(x\right)=A{e}^{3x}. Then, we have {y}_{p}{}^{\prime }\left(x\right)=3A{e}^{3x} and {y}_{p}\text{″}\left(x\right)=9A{e}^{3x}. For {y}_{p} to be a solution to the differential equation, we must find a value for A such that

\begin{array}{ccc}\hfill y\text{″}-{y}^{\prime }-2y& =\hfill & 2{e}^{3x}\hfill \\ \hfill 9A{e}^{3x}-3A{e}^{3x}-2A{e}^{3x}& =\hfill & 2{e}^{3x}\hfill \\ \hfill 4A{e}^{3x}& =\hfill & 2{e}^{3x}.\hfill \end{array}

So, 4A=2 and A=1\text{/}2. Then, {y}_{p}\left(x\right)=\left(\frac{1}{2}\right){e}^{3x}, and the general solution is

y\left(x\right)={c}_{1}{e}^{\text{−}x}+{c}_{2}{e}^{2x}+\frac{1}{2}{e}^{3x}.

Find the general solution to y\text{″}-4{y}^{\prime }+4y=7\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}t-\text{cos}\phantom{\rule{0.1em}{0ex}}t\text{.}

y\left(t\right)={c}_{1}{e}^{2t}+{c}_{2}t{e}^{2t}+\text{sin}\phantom{\rule{0.1em}{0ex}}t+\text{cos}\phantom{\rule{0.1em}{0ex}}t

Hint

Use {y}_{p}\left(t\right)=A\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}t+B\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}t as a guess for the particular solution.

In the previous checkpoint, r\left(x\right) included both sine and cosine terms. However, even if r\left(x\right) 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\left(x\right) and the associated guesses for {y}_{p}\left(x\right) are summarized in (Figure).

Key Forms for the Method of Undetermined Coefficients
r\left(x\right) Initial guess for {y}_{p}\left(x\right)
k (a constant) A (a constant)
ax+b Ax+B (Note: The guess must include both terms even if b=0.)
a{x}^{2}+bx+c A{x}^{2}+Bx+C (Note: The guess must include all three terms even if b or c are zero.)
Higher-order polynomials Polynomial of the same order as r\left(x\right)
a{e}^{\lambda x} A{e}^{\lambda x}
a\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}\beta x+b\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}\beta x A\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}\beta x+B\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}\beta x (Note: The guess must include both terms even if either a=0 or b=0.)
a{e}^{\alpha x}\text{cos}\phantom{\rule{0.1em}{0ex}}\beta x+b{e}^{\alpha x}\text{sin}\phantom{\rule{0.1em}{0ex}}\beta x A{e}^{\alpha x}\text{cos}\phantom{\rule{0.1em}{0ex}}\beta x+B{e}^{\alpha x}\text{sin}\phantom{\rule{0.1em}{0ex}}\beta x
\left(a{x}^{2}+bx+c\right){e}^{\lambda x} \left(A{x}^{2}+Bx+C\right){e}^{\lambda x}
\begin{array}{l}\left({a}_{2}{x}^{2}+{a}_{1}x+{a}_{0}\right)\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}\beta x\hfill \\ +\left({b}_{2}{x}^{2}+{b}_{1}x+{b}_{0}\right)\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}\beta x\hfill \end{array} \begin{array}{l}\left({A}_{2}{x}^{2}+{A}_{1}x+{A}_{0}\right)\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}\beta x\hfill \\ +\left({B}_{2}{x}^{2}+{B}_{1}x+{B}_{0}\right)\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}\beta x\hfill \end{array}
\begin{array}{l}\left({a}_{2}{x}^{2}+{a}_{1}x+{a}_{0}\right){e}^{\alpha x}\text{cos}\phantom{\rule{0.1em}{0ex}}\beta x\hfill \\ +\left({b}_{2}{x}^{2}+{b}_{1}x+{b}_{0}\right){e}^{\alpha x}\text{sin}\phantom{\rule{0.1em}{0ex}}\beta x\hfill \end{array} \begin{array}{l}\left({A}_{2}{x}^{2}+{A}_{1}x+{A}_{0}\right){e}^{\alpha x}\text{cos}\phantom{\rule{0.1em}{0ex}}\beta x\hfill \\ +\left({B}_{2}{x}^{2}+{B}_{1}x+{B}_{0}\right){e}^{\alpha x}\text{sin}\phantom{\rule{0.1em}{0ex}}\beta x\hfill \end{array}

Keep in mind that there is a key pitfall to this method. Consider the differential equation y\text{″}+5{y}^{\prime }+6y=3{e}^{-2x}. Based on the form of r\left(x\right), we guess a particular solution of the form {y}_{p}\left(x\right)=A{e}^{-2x}. But when we substitute this expression into the differential equation to find a value for A, we run into a problem. We have

{y}_{p}{}^{\prime }\left(x\right)=-2A{e}^{-2x}

and

{y}_{p}\text{″}=4A{e}^{-2x},

so we want

\begin{array}{ccc}\hfill y\text{″}+5{y}^{\prime }+6y& =\hfill & 3{e}^{-2x}\hfill \\ \hfill 4A{e}^{-2x}+5\left(-2A{e}^{-2x}\right)+6A{e}^{-2x}& =\hfill & 3{e}^{-2x}\hfill \\ \hfill 4A{e}^{-2x}-10A{e}^{-2x}+6A{e}^{-2x}& =\hfill & 3{e}^{-2x}\hfill \\ \hfill 0& =\hfill & 3{e}^{-2x},\hfill \end{array}

which is not possible.

Looking closely, we see that, in this case, the general solution to the complementary equation is {c}_{1}{e}^{-2x}+{c}_{2}{e}^{-3x}. The exponential function in r\left(x\right) 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\text{.} Using the new guess, {y}_{p}\left(x\right)=Ax{e}^{-2x}, we have

{y}_{p}{}^{\prime }\left(x\right)=A\left({e}^{-2x}-2x{e}^{-2x}\right)

and

{y}_{p}\text{″}\left(x\right)=-4A{e}^{-2x}+4Ax{e}^{-2x}.

Substitution gives

\begin{array}{ccc}\hfill y\text{″}+5{y}^{\prime }+6y& =\hfill & 3{e}^{-2x}\hfill \\ \hfill \left(-4A{e}^{-2x}+4Ax{e}^{-2x}\right)+5\left(A{e}^{-2x}-2Ax{e}^{-2x}\right)+6Ax{e}^{-2x}& =\hfill & 3{e}^{-2x}\hfill \\ \hfill -4A{e}^{-2x}+4Ax{e}^{-2x}+5A{e}^{-2x}-10Ax{e}^{-2x}+6Ax{e}^{-2x}& =\hfill & 3{e}^{-2x}\hfill \\ \hfill A{e}^{-2x}& =\hfill & 3{e}^{-2x}.\hfill \end{array}

So, A=3 and {y}_{p}\left(x\right)=3x{e}^{-2x}. This gives us the following general solution

y\left(x\right)={c}_{1}{e}^{-2x}+{c}_{2}{e}^{-3x}+3x{e}^{-2x}.

Note that if x{e}^{-2x} were also a solution to the complementary equation, we would have to multiply by x again, and we would try {y}_{p}\left(x\right)=A{x}^{2}{e}^{-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\left(x\right), make an initial guess for {y}_{p}\left(x\text{).}
  3. Check whether any term in the guess for {y}_{p}\left(x\right) is a solution to the complementary equation. If so, multiply the guess byx\text{.} Repeat this step until there are no terms in {y}_{p}\left(x\right) that solve the complementary equation.
  4. Substitute {y}_{p}\left(x\right) into the differential equation and equate like terms to find values for the unknown coefficients in {y}_{p}\left(x\text{).}
  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.
Solving Nonhomogeneous Equations

Find the general solutions to the following differential equations.

  1. y\text{″}-9y=-6\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}3x
  2. x\text{″}+2{x}^{\prime }+x=4{e}^{\text{−}t}
  3. y\text{″}-2{y}^{\prime }+5y=10{x}^{2}-3x-3
  4. y\text{″}-3{y}^{\prime }=-12t
  1. The complementary equation is y\text{″}-9y=0, which has the general solution {c}_{1}{e}^{3x}+{c}_{2}{e}^{-3x} (step 1). Based on the form of r\left(x\right)=-6\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}3x, our initial guess for the particular solution is {y}_{p}\left(x\right)=A\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}3x+B\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}3x (step 2). None of the terms in {y}_{p}\left(x\right) solve the complementary equation, so this is a valid guess (step 3).
    Now we want to find values for A and B, so substitute {y}_{p} into the differential equation. We have
    {y}_{p}{}^{\prime }\left(x\right)=-3A\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}3x+3B\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}3x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}{y}_{p}\text{″}\left(x\right)=-9A\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}3x-9B\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}3x,


    so we want to find values of A and B such that

    \begin{array}{ccc}\hfill y\text{″}-9y& =\hfill & -6\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}3x\hfill \\ \hfill -9A\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}3x-9B\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}3x-9\left(A\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}3x+B\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}3x\right)& =\hfill & -6\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}3x\hfill \\ \hfill -18A\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}3x-18B\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}3x& =\hfill & -6\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}3x\text{.}\hfill \end{array}


    Therefore,

    \begin{array}{ccc}\hfill -18A& =\hfill & -6\hfill \\ \hfill -18B& =\hfill & 0.\hfill \end{array}


    This gives A=\frac{1}{3} and B=0, so {y}_{p}\left(x\right)=\left(\frac{1}{3}\right)\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}3x (step 4).
    Putting everything together, we have the general solution

    y\left(x\right)={c}_{1}{e}^{3x}+{c}_{2}{e}^{-3x}+\frac{1}{3}\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}3x\text{.}
  2. The complementary equation is x\text{″}+2{x}^{\prime }+x=0, which has the general solution {c}_{1}{e}^{\text{−}t}+{c}_{2}t{e}^{\text{−}t} (step 1). Based on the form r\left(t\right)=4{e}^{\text{−}t}, our initial guess for the particular solution is {x}_{p}\left(t\right)=A{e}^{\text{−}t} (step 2). However, we see that this guess solves the complementary equation, so we must multiply byt, which gives a new guess: {x}_{p}\left(t\right)=At{e}^{\text{−}t} (step 3). Checking this new guess, we see that it, too, solves the complementary equation, so we must multiply by t again, which gives {x}_{p}\left(t\right)=A{t}^{2}{e}^{\text{−}t} (step 3 again). Now, checking this guess, we see that {x}_{p}\left(t\right) 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, so we substitute {x}_{p} into the differential equation. We have
    \begin{array}{ccc}\hfill {x}_{p}\left(t\right)& =\hfill & A{t}^{2}{e}^{\text{−}t},\phantom{\rule{0.2em}{0ex}}\text{so}\hfill \\ \hfill {x}_{p}{}^{\prime }\left(t\right)& =\hfill & 2At{e}^{\text{−}t}-A{t}^{2}{e}^{\text{−}t}\hfill \end{array}


    and {x}_{p}\text{″}\left(t\right)=2A{e}^{\text{−}t}-2At{e}^{\text{−}t}-\left(2At{e}^{\text{−}t}-A{t}^{2}{e}^{\text{−}t}\right)=2A{e}^{\text{−}t}-4At{e}^{\text{−}t}+A{t}^{2}{e}^{\text{−}t}.
    Substituting into the differential equation, we want to find a value of A so that

    \begin{array}{ccc}\hfill x\text{″}+2{x}^{\prime }+x& =\hfill & 4{e}^{\text{−}t}\hfill \\ \hfill 2A{e}^{\text{−}t}-4At{e}^{\text{−}t}+A{t}^{2}{e}^{\text{−}t}+2\left(2At{e}^{\text{−}t}-A{t}^{2}{e}^{\text{−}t}\right)+A{t}^{2}{e}^{\text{−}t}& =\hfill & 4{e}^{\text{−}t}\hfill \\ \hfill 2A{e}^{\text{−}t}& =\hfill & 4{e}^{\text{−}t}.\hfill \end{array}


    This gives A=2, so {x}_{p}\left(t\right)=2{t}^{2}{e}^{\text{−}t} (step 4). Putting everything together, we have the general solution

    x\left(t\right)={c}_{1}{e}^{\text{−}t}+{c}_{2}t{e}^{\text{−}t}+2{t}^{2}{e}^{\text{−}t}.
  3. The complementary equation is y\text{″}-2{y}^{\prime }+5y=0, which has the general solution {c}_{1}{e}^{x}\text{cos}\phantom{\rule{0.1em}{0ex}}2x+{c}_{2}{e}^{x}\text{sin}\phantom{\rule{0.1em}{0ex}}2x (step 1). Based on the form r\left(x\right)=10{x}^{2}-3x-3, our initial guess for the particular solution is {y}_{p}\left(x\right)=A{x}^{2}+Bx+C (step 2). None of the terms in {y}_{p}\left(x\right) solve the complementary equation, so this is a valid guess (step 3). We now want to find values for A, B, and C, so we substitute {y}_{p} into the differential equation. We have {y}_{p}{}^{\prime }\left(x\right)=2Ax+B and {y}_{p}\text{″}\left(x\right)=2A, so we want to find values of A, B, and C such that
    \begin{array}{ccc}\hfill y\text{″}-2{y}^{\prime }+5y& =\hfill & 10{x}^{2}-3x-3\hfill \\ \hfill 2A-2\left(2Ax+B\right)+5\left(A{x}^{2}+Bx+C\right)& =\hfill & 10{x}^{2}-3x-3\hfill \\ \hfill 5A{x}^{2}+\left(5B-4A\right)x+\left(5C-2B+2A\right)& =\hfill & 10{x}^{2}-3x-3.\hfill \end{array}


    Therefore,

    \begin{array}{ccc}\hfill 5A& =\hfill & 10\hfill \\ \hfill 5B-4A& =\hfill & -3\hfill \\ \hfill 5C-2B+2A& =\hfill & -3.\hfill \end{array}


    This gives A=2, B=1, and C=-1, so {y}_{p}\left(x\right)=2{x}^{2}+x-1 (step 4). Putting everything together, we have the general solution

    y\left(x\right)={c}_{1}{e}^{x}\text{cos}\phantom{\rule{0.1em}{0ex}}2x+{c}_{2}{e}^{x}\text{sin}\phantom{\rule{0.1em}{0ex}}2x+2{x}^{2}+x-1.
  4. The complementary equation is y\text{″}-3{y}^{\prime }=0, which has the general solution {c}_{1}{e}^{3t}+{c}_{2} (step 1). Based on the form r\left(t\right)=-12t, our initial guess for the particular solution is {y}_{p}\left(t\right)=At+B (step 2). However, we see that the constant term in this guess solves the complementary equation, so we must multiply by t, which gives a new guess: {y}_{p}\left(t\right)=A{t}^{2}+Bt (step 3). Checking this new guess, we see that none of the terms in {y}_{p}\left(t\right) solve the complementary equation, so this is a valid guess (step 3 again). We now want to find values for A and B, so we substitute {y}_{p} into the differential equation. We have {y}_{p}{}^{\prime }\left(t\right)=2At+B and {y}_{p}\text{″}\left(t\right)=2A, so we want to find values of A and B such that
    \begin{array}{ccc}\hfill y\text{″}-3{y}^{\prime }& =\hfill & -12t\hfill \\ \hfill 2A-3\left(2At+B\right)& =\hfill & -12t\hfill \\ \hfill -6At+\left(2A-3B\right)& =\hfill & -12t\text{.}\hfill \end{array}


    Therefore,

    \begin{array}{ccc}\hfill -6A& =\hfill & -12\hfill \\ \hfill 2A-3B& =\hfill & 0.\hfill \end{array}


    This gives A=2 and B=4\text{/}3, so {y}_{p}\left(t\right)=2{t}^{2}+\left(4\text{/}3\right)t (step 4). Putting everything together, we have the general solution

    y\left(t\right)={c}_{1}{e}^{3t}+{c}_{2}+2{t}^{2}+\frac{4}{3}t\text{.}

Find the general solution to the following differential equations.

  1. y\text{″}-5{y}^{\prime }+4y=3{e}^{x}
  2. y\text{″}+{y}^{\prime }-6y=52\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}2t
  1. y\left(x\right)={c}_{1}{e}^{4x}+{c}_{2}{e}^{x}-x{e}^{x}
  2. y\left(t\right)={c}_{1}{e}^{-3t}+{c}_{2}{e}^{2t}-5\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}2t+\text{sin}\phantom{\rule{0.1em}{0ex}}2t
Hint

Use the problem-solving strategy.

Variation of Parameters

Sometimes, r\left(x\right) 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, so we have a leading coefficient of 1. Then the differential equation has the form

y\text{″}+p{y}^{\prime }+qy=r\left(x\right),

where p and q are constants.

If the general solution to the complementary equation is given by {c}_{1}{y}_{1}\left(x\right)+{c}_{2}{y}_{2}\left(x\right), we are going to look for a particular solution of the form {y}_{p}\left(x\right)=u\left(x\right){y}_{1}\left(x\right)+v\left(x\right){y}_{2}\left(x\text{).} 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\left(x\right) and v\left(x\right) such that {y}_{p}\left(x\right) satisfies the differential equation. We have

\begin{array}{ccc}\hfill {y}_{p}& =\hfill & u{y}_{1}+v{y}_{2}\hfill \\ \hfill {y}_{p}{}^{\prime }& =\hfill & {u}^{\prime }{y}_{1}+u{y}_{1}{}^{\prime }+{v}^{\prime }{y}_{2}+v{y}_{2}{}^{\prime }\hfill \\ \hfill {y}_{p}\text{″}& =\hfill & {\left({u}^{\prime }{y}_{1}+{v}^{\prime }{y}_{2}\right)}^{\prime }+{u}^{\prime }{y}_{1}{}^{\prime }+u{y}_{1}\text{″}+{v}^{\prime }{y}_{2}{}^{\prime }+v{y}_{2}\text{″}\text{.}\hfill \end{array}

Substituting into the differential equation, we obtain

\begin{array}{cc}\hfill {y}_{p}\text{″}+p{y}_{p}{}^{\prime }+q{y}_{p}& =\left[{\left({u}^{\prime }{y}_{1}+{v}^{\prime }{y}_{2}\right)}^{\prime }+{u}^{\prime }{y}_{1}{}^{\prime }+u{y}_{1}\text{″}+{v}^{\prime }{y}_{2}{}^{\prime }+v{y}_{2}\text{″}\right]\hfill \\ & \phantom{\rule{2em}{0ex}}+p\left[{u}^{\prime }{y}_{1}+u{y}_{1}{}^{\prime }+{v}^{\prime }{y}_{2}+v{y}_{2}{}^{\prime }\right]+q\left[u{y}_{1}+v{y}_{2}\right]\hfill \\ & =u\left[{y}_{1}\text{″}+p{y}_{1}{}^{\prime }+q{y}_{1}\right]+v\left[{y}_{2}\text{″}+p{y}_{2}{}^{\prime }+q{y}_{2}\right]\hfill \\ & \phantom{\rule{2em}{0ex}}+{\left({u}^{\prime }{y}_{1}+{v}^{\prime }{y}_{2}\right)}^{\prime }+p\left({u}^{\prime }{y}_{1}+{v}^{\prime }{y}_{2}\right)+\left({u}^{\prime }{y}_{1}{}^{\prime }+{v}^{\prime }{y}_{2}{}^{\prime }\right).\hfill \end{array}

Note that {y}_{1} and {y}_{2} are solutions to the complementary equation, so the first two terms are zero. Thus, we have

{\left({u}^{\prime }{y}_{1}+{v}^{\prime }{y}_{2}\right)}^{\prime }+p\left({u}^{\prime }{y}_{1}+{v}^{\prime }{y}_{2}\right)+\left({u}^{\prime }{y}_{1}{}^{\prime }+{v}^{\prime }{y}_{2}{}^{\prime }\right)=r\left(x\text{).}

If we simplify this equation by imposing the additional condition {u}^{\prime }{y}_{1}+{v}^{\prime }{y}_{2}=0, the first two terms are zero, and this reduces to {u}^{\prime }{y}_{1}{}^{\prime }+{v}^{\prime }{y}_{2}{}^{\prime }=r\left(x\text{).} So, with this additional condition, we have a system of two equations in two unknowns:

\begin{array}{ccc}\hfill {u}^{\prime }{y}_{1}+{v}^{\prime }{y}_{2}& =\hfill & 0\hfill \\ \hfill {u}^{\prime }{y}_{1}{}^{\prime }+{v}^{\prime }{y}_{2}{}^{\prime }& =\hfill & r\left(x\text{).}\hfill \end{array}

Solving this system gives us {u}^{\prime } and {v}^{\prime }, which we can integrate to find u and v.

Then, {y}_{p}\left(x\right)=u\left(x\right){y}_{1}\left(x\right)+v\left(x\right){y}_{2}\left(x\right) 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

\begin{array}{ccc}\hfill {a}_{1}{z}_{1}+{b}_{1}{z}_{2}& =\hfill & {r}_{1}\hfill \\ \hfill {a}_{2}{z}_{1}+{b}_{2}{z}_{2}& =\hfill & {r}_{2}\hfill \end{array}

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

{z}_{1}=\frac{|\begin{array}{cc}{r}_{1}\hfill & {b}_{1}\hfill \\ {r}_{2}\hfill & {b}_{2}\hfill \end{array}|}{|\begin{array}{cc}{a}_{1}\hfill & {b}_{1}\hfill \\ {a}_{2}\hfill & {b}_{2}\hfill \end{array}|}\phantom{\rule{2em}{0ex}}\text{and}\phantom{\rule{2em}{0ex}}{z}_{2}=\frac{|\begin{array}{cc}{a}_{1}\hfill & {r}_{1}\hfill \\ {a}_{2}\hfill & {r}_{2}\hfill \end{array}|}{|\begin{array}{cc}{a}_{1}\hfill & {b}_{1}\hfill \\ {a}_{2}\hfill & {b}_{2}\hfill \end{array}|}.
Using Cramer’s Rule

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

\begin{array}{ccc}\hfill {x}^{2}{z}_{1}+2x{z}_{2}& =\hfill & 0\hfill \\ \hfill {z}_{1}-3{x}^{2}{z}_{2}& =\hfill & 2x\hfill \end{array}

We have

\begin{array}{}\\ \\ \hfill {a}_{1}\left(x\right)& =\hfill & {x}^{2}\hfill \\ \hfill {a}_{2}\left(x\right)& =\hfill & 1\hfill \\ \hfill {b}_{1}\left(x\right)& =\hfill & 2x\hfill \\ \hfill {b}_{2}\left(x\right)& =\hfill & -3{x}^{2}\hfill \\ \hfill {r}_{1}\left(x\right)& =\hfill & 0\hfill \\ \hfill {r}_{2}\left(x\right)& =\hfill & 2x\text{.}\hfill \end{array}

Then,

|\begin{array}{cc}{a}_{1}\hfill & {b}_{1}\hfill \\ {a}_{2}\hfill & {b}_{2}\hfill \end{array}|=|\begin{array}{cc}{x}^{2}\hfill & \phantom{\rule{0.8em}{0ex}}2x\hfill \\ 1\hfill & -3{x}^{2}\hfill \end{array}|=-3{x}^{4}-2x

and

|\begin{array}{cc}{r}_{1}\hfill & {b}_{1}\hfill \\ {r}_{2}\hfill & {b}_{2}\hfill \end{array}|=|\begin{array}{cc}0\hfill & \phantom{\rule{0.8em}{0ex}}2x\hfill \\ 2x\hfill & -3{x}^{2}\hfill \end{array}|=0-4{x}^{2}=-4{x}^{2}.

Thus,

{z}_{1}=\frac{|\begin{array}{cc}{r}_{1}\hfill & {b}_{1}\hfill \\ {r}_{2}\hfill & {b}_{2}\hfill \end{array}|}{|\begin{array}{cc}{a}_{1}\hfill & {b}_{1}\hfill \\ {a}_{2}\hfill & {b}_{2}\hfill \end{array}|}=\frac{-4{x}^{2}}{-3{x}^{4}-2x}=\frac{4x}{3{x}^{3}+2}.

In addition,

|\begin{array}{cc}{a}_{1}\hfill & {r}_{1}\hfill \\ {a}_{2}\hfill & {r}_{2}\hfill \end{array}|=|\begin{array}{cc}{x}^{2}\hfill & 0\hfill \\ 1\hfill & 2x\hfill \end{array}|=2{x}^{3}-0=2{x}^{3}.

Thus,

{z}_{2}=\frac{|\begin{array}{cc}{a}_{1}\hfill & {r}_{1}\hfill \\ {a}_{2}\hfill & {r}_{2}\hfill \end{array}|}{|\begin{array}{cc}{a}_{1}\hfill & {b}_{1}\hfill \\ {a}_{2}\hfill & {b}_{2}\hfill \end{array}|}=\frac{2{x}^{3}}{-3{x}^{4}-2x}=\frac{-2{x}^{2}}{3{x}^{3}+2}.

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

\begin{array}{ccc}\hfill 2x{z}_{1}-3{z}_{2}& =\hfill & 0\hfill \\ \hfill {x}^{2}{z}_{1}+4x{z}_{2}& =\hfill & x+1\hfill \end{array}

{z}_{1}=\frac{3x+3}{11{x}^{2}},{z}_{2}=\frac{2x+2}{11x}

Hint

Use the process from the previous example.

Problem-Solving Strategy: Method of Variation of Parameters
  1. Solve the complementary equation and write down the general solution
    {c}_{1}{y}_{1}\left(x\right)+{c}_{2}{y}_{2}\left(x\text{).}
  2. Use Cramer’s rule or another suitable technique to find functions {u}^{\prime }\left(x\right) and {v}^{\prime }\left(x\right) satisfying
    \begin{array}{ccc}\hfill {u}^{\prime }{y}_{1}+{v}^{\prime }{y}_{2}& =\hfill & 0\hfill \\ \hfill {u}^{\prime }{y}_{1}{}^{\prime }+{v}^{\prime }{y}_{2}{}^{\prime }& =\hfill & r\left(x\text{).}\hfill \end{array}
  3. Integrate {u}^{\prime } and {v}^{\prime } to find u\left(x\right) and v\left(x\text{).} Then, {y}_{p}\left(x\right)=u\left(x\right){y}_{1}\left(x\right)+v\left(x\right){y}_{2}\left(x\right) 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.
Using the Method of Variation of Parameters

Find the general solution to the following differential equations.

  1. y\text{″}-2{y}^{\prime }+y=\frac{{e}^{t}}{{t}^{2}}
  2. y\text{″}+y=3\phantom{\rule{0.1em}{0ex}}{\text{sin}}^{2}x
  1. The complementary equation is y\text{″}-2{y}^{\prime }+y=0 with associated general solution {c}_{1}{e}^{t}+{c}_{2}t{e}^{t}. Therefore, {y}_{1}\left(t\right)={e}^{t} and {y}_{2}\left(t\right)=t{e}^{t}. Calculating the derivatives, we get {y}_{1}{}^{\prime }\left(t\right)={e}^{t} and {y}_{2}{}^{\prime }\left(t\right)={e}^{t}+t{e}^{t} (step 1). Then, we want to find functions {u}^{\prime }\left(t\right) and {v}^{\prime }\left(t\right) so that
    \begin{array}{ccc}\hfill {u}^{\prime }{e}^{t}+{v}^{\prime }t{e}^{t}& =\hfill & 0\hfill \\ \hfill {u}^{\prime }{e}^{t}+{v}^{\prime }\left({e}^{t}+t{e}^{t}\right)& =\hfill & \frac{{e}^{t}}{{t}^{2}}.\hfill \end{array}


    Applying Cramer’s rule, we have

    {u}^{\prime }=\frac{|\begin{array}{cc}0\hfill & \hfill t{e}^{t}\hfill \\ \frac{{e}^{t}}{{t}^{2}}\hfill & {e}^{t}+t{e}^{t}\hfill \end{array}|}{|\begin{array}{cc}{e}^{t}\hfill & \hfill t{e}^{t}\hfill \\ {e}^{t}\hfill & {e}^{t}+t{e}^{t}\hfill \end{array}|}=\frac{0-t{e}^{t}\left(\frac{{e}^{t}}{{t}^{2}}\right)}{{e}^{t}\left({e}^{t}+t{e}^{t}\right)-{e}^{t}t{e}^{t}}=\frac{-\frac{{e}^{2t}}{t}}{{e}^{2t}}=-\frac{1}{t}


    and

    {v}^{\prime }=\frac{|\begin{array}{cc}{e}^{t}\hfill & 0\hfill \\ {e}^{t}\hfill & \frac{{e}^{t}}{{t}^{2}}\hfill \end{array}|}{|\begin{array}{cc}{e}^{t}\hfill & \hfill t{e}^{t}\hfill \\ {e}^{t}\hfill & {e}^{t}+t{e}^{t}\hfill \end{array}|}=\frac{{e}^{t}\left(\frac{{e}^{t}}{{t}^{2}}\right)}{{e}^{2t}}=\frac{1}{{t}^{2}}\phantom{\rule{0.2em}{0ex}}\text{(step 2).}


    Integrating, we get

    \begin{array}{}\\ \\ u=\text{−}\int \frac{1}{t}dt=\text{−}\text{ln}|t|\hfill \\ v=\int \frac{1}{{t}^{2}}dt=-\frac{1}{t}\phantom{\rule{0.2em}{0ex}}\text{(step 3).}\hfill \end{array}


    Then we have

    \begin{array}{cc}\hfill {y}_{p}& =\text{−}{e}^{t}\text{ln}|t|-\frac{1}{t}t{e}^{t}\hfill \\ & =\text{−}{e}^{t}\text{ln}|t|-{e}^{t}\phantom{\rule{0.2em}{0ex}}\text{(step 4).}\hfill \end{array}


    The {e}^{t} 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\left(t\right)={c}_{1}{e}^{t}+{c}_{2}t{e}^{t}-{e}^{t}\text{ln}|t|\phantom{\rule{0.2em}{0ex}}\text{(step 5).}
  2. The complementary equation is y\text{″}+y=0 with associated general solution {c}_{1}\text{cos}\phantom{\rule{0.1em}{0ex}}x+{c}_{2}\text{sin}\phantom{\rule{0.1em}{0ex}}x\text{.} So, {y}_{1}\left(x\right)=\text{cos}\phantom{\rule{0.1em}{0ex}}x and {y}_{2}\left(x\right)=\text{sin}\phantom{\rule{0.1em}{0ex}}x (step 1). Then, we want to find functions {u}^{\prime }\left(x\right) and {v}^{\prime }\left(x\right) such that
    \begin{array}{ccc}{u}^{\prime }\text{cos}\phantom{\rule{0.1em}{0ex}}x+{v}^{\prime }\text{sin}\phantom{\rule{0.1em}{0ex}}x\hfill & =\hfill & 0\hfill \\ \hfill \text{−}{u}^{\prime }\text{sin}\phantom{\rule{0.1em}{0ex}}x+{v}^{\prime }\text{cos}\phantom{\rule{0.1em}{0ex}}x& =\hfill & 3\phantom{\rule{0.1em}{0ex}}{\text{sin}}^{\phantom{\rule{0.1em}{0ex}}}x\text{.}\hfill \end{array}


    Applying Cramer’s rule, we have

    {u}^{\prime }=\frac{|\begin{array}{cc}\hfill 0\hfill & \text{sin}\phantom{\rule{0.1em}{0ex}}x\hfill \\ 3\phantom{\rule{0.1em}{0ex}}{\text{sin}}^{2}x\hfill & \text{cos}\phantom{\rule{0.1em}{0ex}}x\hfill \end{array}|}{|\begin{array}{cc}\text{cos}\phantom{\rule{0.1em}{0ex}}x\hfill & \text{sin}\phantom{\rule{0.1em}{0ex}}x\hfill \\ \text{−}\text{sin}\phantom{\rule{0.1em}{0ex}}x\hfill & \text{cos}\phantom{\rule{0.1em}{0ex}}x\hfill \end{array}|}=\frac{0-3\phantom{\rule{0.1em}{0ex}}{\text{sin}}^{3}x}{{\text{cos}}^{2}x+{\text{sin}}^{2}x}=-3\phantom{\rule{0.1em}{0ex}}{\text{sin}}^{3}x


    and

    {v}^{\prime }=\frac{|\begin{array}{cc}\text{cos}\phantom{\rule{0.1em}{0ex}}x\hfill & \hfill 0\hfill \\ \text{−}\text{sin}\phantom{\rule{0.1em}{0ex}}x\hfill & 3\phantom{\rule{0.1em}{0ex}}{\text{sin}}^{2}x\hfill \end{array}|}{|\begin{array}{cc}\text{cos}\phantom{\rule{0.1em}{0ex}}x\hfill & \text{sin}\phantom{\rule{0.1em}{0ex}}x\hfill \\ \text{−}\text{sin}\phantom{\rule{0.1em}{0ex}}x\hfill & \text{cos}\phantom{\rule{0.1em}{0ex}}x\hfill \end{array}|}=\frac{3\phantom{\rule{0.1em}{0ex}}{\text{sin}}^{2}x\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}x}{1}=3\phantom{\rule{0.1em}{0ex}}{\text{sin}}^{2}x\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}x\phantom{\rule{0.2em}{0ex}}\text{(step 2).}


    Integrating first to find u, we get

    u=\int -3\phantom{\rule{0.1em}{0ex}}{\text{sin}}^{3}xdx=-3\left[\text{−}\frac{1}{3}{\text{sin}}^{2}x\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}x+\frac{2}{3}\int \text{sin}\phantom{\rule{0.1em}{0ex}}xdx\right]={\text{sin}}^{2}x\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}x+2\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}x\text{.}


    Now, we integrate to find v. Using substitution (with w=\text{sin}\phantom{\rule{0.1em}{0ex}}x), we get

    v=\int 3\phantom{\rule{0.1em}{0ex}}{\text{sin}}^{2}x\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}xdx=\int 3{w}^{2}dw={w}^{3}={\text{sin}}^{3}x\text{.}


    Then,

    \begin{array}{cc}\hfill {y}_{p}& =\left({\text{sin}}^{2}x\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}x+2\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}x\right)\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}x+\left({\text{sin}}^{3}x\right)\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}x\hfill \\ & ={\text{sin}}^{\phantom{\rule{0.1em}{0ex}}}x\phantom{\rule{0.1em}{0ex}}{\text{cos}}^{\phantom{\rule{0.1em}{0ex}}}x+2\phantom{\rule{0.1em}{0ex}}{\text{cos}}^{\phantom{\rule{0.1em}{0ex}}}x+{\text{sin}}^{\phantom{\rule{0.1em}{0ex}}}x\hfill \\ & =2\phantom{\rule{0.1em}{0ex}}{\text{cos}}^{\phantom{\rule{0.1em}{0ex}}}x+{\text{sin}}^{\phantom{\rule{0.1em}{0ex}}}x\left({\text{cos}}^{2}x+{\text{sin}}^{2}x\right)\phantom{\rule{2em}{0ex}}\text{(step 4).}\hfill \\ & =2\phantom{\rule{0.1em}{0ex}}{\text{cos}}^{\phantom{\rule{0.1em}{0ex}}}x+{\text{sin}}^{\phantom{\rule{0.1em}{0ex}}}x\hfill \\ & ={\text{cos}}^{\phantom{\rule{0.1em}{0ex}}}x+1\hfill \end{array}


    The general solution is

    y\left(x\right)={c}_{1}\text{cos}\phantom{\rule{0.1em}{0ex}}x+{c}_{2}\text{sin}\phantom{\rule{0.1em}{0ex}}x+1+{\text{cos}}^{2}x\phantom{\rule{0.2em}{0ex}}\text{(step 5).}

Find the general solution to the following differential equations.

  1. y\text{″}+y=\text{sec}\phantom{\rule{0.1em}{0ex}}x
  2. x\text{″}-2{x}^{\prime }+x=\frac{{e}^{t}}{t}
  1. y\left(x\right)={c}_{1}\text{cos}\phantom{\rule{0.1em}{0ex}}x+{c}_{2}\text{sin}\phantom{\rule{0.1em}{0ex}}x+\text{cos}\phantom{\rule{0.1em}{0ex}}x\phantom{\rule{0.1em}{0ex}}\text{ln}|\text{cos}\phantom{\rule{0.1em}{0ex}}x|+x\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}x
  2. x\left(t\right)={c}_{1}{e}^{t}+{c}_{2}t{e}^{t}+t{e}^{t}\text{ln}|t|
Hint

Follow the problem-solving strategy.

Key Concepts

  • To solve a nonhomogeneous linear second-order differential equation, first find the general solution to the complementary equation, then find a particular solution to the nonhomogeneous equation.
  • Let {y}_{p}\left(x\right) be any particular solution to the nonhomogeneous linear differential equation
    {a}_{2}\left(x\right)y\text{″}+{a}_{1}\left(x\right){y}^{\prime }+{a}_{0}\left(x\right)y=r\left(x\right),


    and let {c}_{1}{y}_{1}\left(x\right)+{c}_{2}{y}_{2}\left(x\right) denote the general solution to the complementary equation. Then, the general solution to the nonhomogeneous equation is given by

    y\left(x\right)={c}_{1}{y}_{1}\left(x\right)+{c}_{2}{y}_{2}\left(x\right)+{y}_{p}\left(x\text{).}
  • When r\left(x\right) is a combination of polynomials, exponential functions, sines, and cosines, use the method of undetermined coefficients to find the particular solution. To use this method, assume a solution in the same form as r\left(x\right), multiplying by x as necessary until the assumed solution is linearly independent of the general solution to the complementary equation. Then, substitute the assumed solution into the differential equation to find values for the coefficients.
  • When r\left(x\right) is not a combination of polynomials, exponential functions, or sines and cosines, use the method of variation of parameters to find the particular solution. This method involves using Cramer’s rule or another suitable technique to find functions {u}^{\prime }\left(x\right) and {v}^{\prime }\left(x\right) satisfying
    \begin{array}{ccc}\hfill {u}^{\prime }{y}_{1}+{v}^{\prime }{y}_{2}& =\hfill & 0\hfill \\ \hfill {u}^{\prime }{y}_{1}{}^{\prime }+{v}^{\prime }{y}_{2}{}^{\prime }& =\hfill & r\left(x\text{).}\hfill \end{array}


    Then, {y}_{p}\left(x\right)=u\left(x\right){y}_{1}\left(x\right)+v\left(x\right){y}_{2}\left(x\right) is a particular solution to the differential equation.

Key Equations

  • Complementary equation
    {a}_{2}\left(x\right)y\text{″}+{a}_{1}\left(x\right){y}^{\prime }+{a}_{0}\left(x\right)y=0
  • General solution to a nonhomogeneous linear differential equation
    y\left(x\right)={c}_{1}{y}_{1}\left(x\right)+{c}_{2}{y}_{2}\left(x\right)+{y}_{p}\left(x\right)

Solve the following equations using the method of undetermined coefficients.

2y\text{″}-5{y}^{\prime }-12y=6

3y\text{″}+{y}^{\prime }-4y=8

y={c}_{1}{e}^{-4x\text{/}3}+{c}_{2}{e}^{x}-2

y\text{″}-6{y}^{\prime }+5y={e}^{\text{−}x}

y\text{″}+16y={e}^{-2x}

y={c}_{1}\text{cos}\phantom{\rule{0.1em}{0ex}}4x+{c}_{2}\text{sin}\phantom{\rule{0.1em}{0ex}}4x+\frac{1}{20}{e}^{-2x}

y\text{″}-4y={x}^{2}+1

y\text{″}-4{y}^{\prime }+4y=8{x}^{2}+4x

y={c}_{1}{e}^{2x}+{c}_{2}x{e}^{2x}+2{x}^{2}+5x

y\text{″}-2{y}^{\prime }-3y=\text{sin}\phantom{\rule{0.1em}{0ex}}2x

y\text{″}+2{y}^{\prime }+y=\text{sin}\phantom{\rule{0.1em}{0ex}}x+\text{cos}\phantom{\rule{0.1em}{0ex}}x

y={c}_{1}{e}^{\text{−}x}+{c}_{2}x{e}^{\text{−}x}+\frac{1}{2}\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}x-\frac{1}{2}\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}x

y\text{″}+9y={e}^{x}\text{cos}\phantom{\rule{0.1em}{0ex}}x

y\text{″}+y=3\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}2x+x\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}2x

y={c}_{1}\text{cos}\phantom{\rule{0.1em}{0ex}}x+{c}_{2}\text{sin}\phantom{\rule{0.1em}{0ex}}x-\frac{1}{3}x\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}2x-\frac{5}{9}\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}2x

y\text{″}+3{y}^{\prime }-28y=10{e}^{4x}

y\text{″}+10{y}^{\prime }+25y=x{e}^{-5x}+4

y={c}_{1}{e}^{-5x}+{c}_{2}x{e}^{-5x}+\frac{1}{6}{x}^{3}{e}^{-5x}+\frac{4}{25}

In each of the following problems,

  1. Write the form for the particular solution {y}_{p}\left(x\right) for the method of undetermined coefficients.
  2. [T] Use a computer algebra system to find a particular solution to the given equation.

y\text{″}-{y}^{\prime }-y=x+{e}^{\text{−}x}

y\text{″}-3y={x}^{2}-4x+11

a. {y}_{p}\left(x\right)=A{x}^{2}+Bx+C
b. {y}_{p}\left(x\right)=-\frac{1}{3}{x}^{2}+\frac{4}{3}x-\frac{35}{9}

y\text{″}-{y}^{\prime }-4y={e}^{x}\text{cos}\phantom{\rule{0.1em}{0ex}}3x

2y\text{″}-{y}^{\prime }+y=\left({x}^{2}-5x\right){e}^{\text{−}x}

a. {y}_{p}\left(x\right)=\left(A{x}^{2}+Bx+C\right){e}^{\text{−}x}
b. {y}_{p}\left(x\right)=\left(\frac{1}{4}{x}^{2}-\frac{5}{8}x-\frac{33}{32}\right){e}^{\text{−}x}

4y\text{″}+5{y}^{\prime }-2y={e}^{2x}+x\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}x

y\text{″}-{y}^{\prime }-2y={x}^{2}{e}^{x}\text{sin}\phantom{\rule{0.1em}{0ex}}x

a. {y}_{p}\left(x\right)=\left(A{x}^{2}+Bx+C\right){e}^{x}\text{cos}\phantom{\rule{0.1em}{0ex}}x +\left(D{x}^{2}+Ex+F\right){e}^{x}\text{sin}\phantom{\rule{0.1em}{0ex}}x
b. {y}_{p}\left(x\right)=\left(-\frac{1}{10}{x}^{2}-\frac{11}{25}x-\frac{27}{250}\right){e}^{x}\text{cos}\phantom{\rule{0.1em}{0ex}}x +\left(-\frac{3}{10}{x}^{2}+\frac{2}{25}x+\frac{39}{250}\right){e}^{x}\text{sin}\phantom{\rule{0.1em}{0ex}}x

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

y\text{″}+3{y}^{\prime }-4y=2{e}^{x}

y\text{″}+2{y}^{\prime }={e}^{3x}

y={c}_{1}+{c}_{2}{e}^{-2x}+\frac{1}{15}{e}^{3x}

y\text{″}+6{y}^{\prime }+9y={e}^{\text{−}x}

y\text{″}+2{y}^{\prime }-8y=6{e}^{2x}

y={c}_{1}{e}^{2x}+{c}_{2}{e}^{-4x}+x{e}^{2x}

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

4y\text{″}+y=2\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}x

y\text{″}-9y=8x

y={c}_{1}{e}^{3x}+{c}_{2}{e}^{-3x}-\frac{8x}{9}

y\text{″}+y=\text{sec}\phantom{\rule{0.1em}{0ex}}x,\phantom{\rule{2em}{0ex}}0<x<\pi \text{/}2

y\text{″}+4y=3\phantom{\rule{0.1em}{0ex}}\text{csc}\phantom{\rule{0.1em}{0ex}}2x,\phantom{\rule{1em}{0ex}}0<x<\pi \text{/}2

y={c}_{1}\text{cos}\phantom{\rule{0.1em}{0ex}}2x+{c}_{2}\text{sin}\phantom{\rule{0.1em}{0ex}}2x-\frac{3}{2}x\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}2x+\frac{3}{4}\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}2x\phantom{\rule{0.1em}{0ex}}\text{ln}\phantom{\rule{0.1em}{0ex}}\left(\text{sin}\phantom{\rule{0.1em}{0ex}}2x\right)

Find the unique solution satisfying the differential equation and the initial conditions given, where {y}_{p}\left(x\right) is the particular solution.

y\text{″}-2{y}^{\prime }+y=12{e}^{x},{\text{y}}_{p}\left(x\right)=6{x}^{2}{e}^{x},y\left(0\right)=6,\phantom{\rule{0.2em}{0ex}}\text{}\phantom{\rule{0.2em}{0ex}}y\prime \left(0\right)=0

y\text{″}-7{y}^{\prime }=4x{e}^{7x},{y}_{p}\left(x\right)=\frac{2}{7}{x}^{2}{e}^{7x}-\frac{4}{49}x{e}^{7x},y\left(0\right)=-1,\phantom{\rule{0.2em}{0ex}}\text{}\phantom{\rule{0.2em}{0ex}}y\prime \left(0\right)=0

y=-\frac{347}{343}+\frac{4}{343}{e}^{7x}+\frac{2}{7}{x}^{2}{e}^{7x}-\frac{4}{49}x{e}^{7x}

y\text{″}+y=\text{cos}\phantom{\rule{0.1em}{0ex}}x-4\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}x,{y}_{p}\left(x\right)=2x\phantom{\rule{0.1em}{0ex}}\text{cos}\phantom{\rule{0.1em}{0ex}}x+\frac{1}{2}x\phantom{\rule{0.1em}{0ex}}\text{sin}\phantom{\rule{0.1em}{0ex}}x,y\left(0\right)=8,\phantom{\rule{0.2em}{0ex}}\text{}\phantom{\rule{0.2em}{0ex}}y\prime \left(0\right)=-4

y\text{″}-5{y}^{\prime }={e}^{5x}+8{e}^{-5x},{y}_{p}\left(x\right)=\frac{1}{5}x{e}^{5x}+\frac{4}{25}{e}^{-5x},y\left(0\right)=-2,\phantom{\rule{0.2em}{0ex}}\text{}\phantom{\rule{0.2em}{0ex}}y\prime \left(0\right)=0

y=-\frac{57}{25}+\frac{3}{25}{e}^{5x}+\frac{1}{5}x{e}^{5x}+\frac{4}{25}{e}^{-5x}

In each of the following problems, two linearly independent solutions—{y}_{1} and {y}_{2}—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.

{x}^{2}y\text{″}+2x{y}^{\prime }-2y=3x,{y}_{1}\left(x\right)=x,\phantom{\rule{1em}{0ex}}{y}_{2}\left(x\right)={x}^{-2}

{x}^{2}y\text{″}-2y=10{x}^{2}-1,{y}_{1}\left(x\right)={x}^{2},\phantom{\rule{1em}{0ex}}{y}_{2}\left(x\right)={x}^{-1}

{y}_{p}=\frac{1}{2}+\frac{10}{3}{x}^{2}\text{ln}\phantom{\rule{0.1em}{0ex}}x

Glossary

complementary equation
for the nonhomogeneous linear differential equation

{a}_{2}\left(x\right)y\text{″}+{a}_{1}\left(x\right){y}^{\prime }+{a}_{0}\left(x\right)y=r\left(x\right),


the associated homogeneous equation, called the complementary equation, is

{a}_{2}\left(x\right)y\text{″}+{a}_{1}\left(x\right){y}^{\prime }+{a}_{0}\left(x\right)y=0
method of undetermined coefficients
a method that involves making a guess about the form of the particular solution, then solving for the coefficients in the guess
method of variation of parameters
a method that involves looking for particular solutions in the form {y}_{p}\left(x\right)=u\left(x\right){y}_{1}\left(x\right)+v\left(x\right){y}_{2}\left(x\right), where {y}_{1} and {y}_{2} are linearly independent solutions to the complementary equations, and then solving a system of equations to find u\left(x\right) and v\left(x\right)
particular solution
a solution {y}_{p}\left(x\right) of a differential equation that contains no arbitrary constants

License

Share This Book