In this section we give a method called variation of parameters for finding a particular solution of
if we know a fundamental set \(\{y_1,y_2\}\) of solutions of the complementary equation
Having found a particular solution \(y_p\) by this method, we can write the general solution of (5.7.1) as
Since we need only one nontrivial solution of (5.7.2) to find the general solution of (5.7.1) by reduction of order, it’s natural to ask why we’re interested in variation of parameters, which requires two linearly independent solutions of (5.7.2) to achieve the same goal. Here’s the answer:
If we already know two linearly independent solutions of (5.7.2) then variation of parameters will probably be simpler than reduction of order.
Variation of parameters generalizes naturally to a method for finding particular solutions of higher order linear equations (Section 9.4) and linear systems of equations (Section 10.7), while reduction of order doesn’t.
Variation of parameters is a powerful theoretical tool used by researchers in differential equations. Although a detailed discussion of this is beyond the scope of this book, you can get an idea of what it means from Exercises 37–39.
We’ll now derive the method. As usual, we consider solutions of (5.7.1) and (5.7.2) on an interval \((a,b)\) where \(P_0\), \(P_1\), \(P_2\), and \(F\) are continuous and \(P_0\) has no zeros. Suppose that \(\{y_1,y_2\}\) is a fundamental set of solutions of the complementary equation (5.7.2). We look for a particular solution of (5.7.1) in the form
where \(u_1\) and \(u_2\) are functions to be determined so that \(y_p\) satisfies (5.7.1). You may not think this is a good idea, since there are now two unknown functions to be determined, rather than one. However, since \(u_1\) and \(u_2\) have to satisfy only one condition (that \(y_p\) is a solution of (5.7.1)), we can impose a second condition that produces a convenient simplification, as follows.
Differentiating (5.7.3) yields
As our second condition on \(u_1\) and \(u_2\) we require that
Then (5.7.4) becomes
that is, (5.7.5) permits us to differentiate \(y_p\) (once!) as if \(u_1\) and \(u_2\) are constants. Differentiating (5.7.4) yields
(There are no terms involving \(u_1''\) and \(u_2''\) here, as there would be if we hadn’t required (5.7.5).) Substituting (5.7.3), (5.7.6), and (5.7.7) into (5.7.1) and collecting the coefficients of \(u_1\) and \(u_2\) yields
As in the derivation of the method of reduction of order, the coefficients of \(u_1\) and \(u_2\) here are both zero because \(y_1\) and \(y_2\) satisfy the complementary equation. Hence, we can rewrite the last equation as
Therefore \(y_p\) in (5.7.3) satisfies (5.7.1) if
where the first equation is the same as (5.7.5) and the second is from (5.7.8).
We’ll now show that you can always solve (5.7.9) for \(u_1'\) and \(u_2'\). (The method that we use here will always work, but simpler methods usually work when you’re dealing with specific equations.) To obtain \(u_1'\), multiply the first equation in (5.7.9) by \(y_2'\) and the second equation by \(y_2\). This yields
Subtracting the second equation from the first yields
Since \(\{y_1,y_2\}\) is a fundamental set of solutions of (5.7.2) on \((a,b)\), Theorem 5.1.6 implies that the Wronskian \(y_1y_2'-y_1'y_2\) has no zeros on \((a,b)\). Therefore we can solve (5.7.10) for \(u_1'\), to obtain
We leave it to you to start from (5.7.9) and show by a similar argument that
We can now obtain \(u_1\) and \(u_2\) by integrating \(u_1'\) and \(u_2'\). The constants of integration can be taken to be zero, since any choice of \(u_1\) and \(u_2\) in (5.7.3) will suffice.
You should not memorize (5.7.11) and (5.7.12). On the other hand, you don’t want to rederive the whole procedure for every specific problem. We recommend the a compromise:
Write
\begin{equation} y_p=u_1y_1+u_2y_2 \tag{5.7.13}\end{equation}to remind yourself of what you’re doing.
Write the system
\begin{equation} \begin{array}{rcl} u_1'y_1+u_2'y_2 &=& 0 \\ u_1'y_1'+u_2'y_2' &=& \dst{F\over P_0} \end{array} \tag{5.7.14}\end{equation}for the specific problem you’re trying to solve.
Solve (5.7.14) for \(u_1'\) and \(u_2'\) by any convenient method.
Obtain \(u_1\) and \(u_2\) by integrating \(u_1'\) and \(u_2'\), taking the constants of integration to be zero.
Substitute \(u_1\) and \(u_2\) into (5.7.13) to obtain \(y_p\).
Example 5.7.1
Find a particular solution \(y_p\) of
given that \(y_1=x\) and \(y_2=x^2\) are solutions of the complementary equation
Then find the general solution of (5.7.15).
Solution We set
where
From the first equation, \(u_1'=-u_2'x\). Substituting this into the second equation yields \(u_2'x=x^{5/2}\), so \(u_2'=x^{3/2}\) and therefore \(u_1'=-u_2'x=-x^{5/2}\). Integrating and taking the constants of integration to be zero yields
Therefore
and the general solution of (5.7.15) is
Example 5.7.2
Find a particular solution \(y_p\) of
given that \(y_1=x\) and \(y_2=e^x\) are solutions of the complementary equation
Then find the general solution of (5.7.16).
Solution We set
where
Subtracting the first equation from the second yields \(-u_1'(x-1)=x-1\), so \(u_1'=-1\). From this and the first equation, \(u_2'=-xe^{-x}u_1'=xe^{-x}\). Integrating and taking the constants of integration to be zero yields
Therefore
so the general solution of (5.7.16) is
However, since \(c_1\) is an arbitrary constant, so is \(c_1-1\); therefore, we improve the appearance of this result by renaming the constant and writing the general solution as
There’s nothing wrong with leaving the general solution of (5.7.16) in the form (5.7.17); however, we think you’ll agree that (5.7.18) is preferable. We can also view the transition from (5.7.17) to (5.7.18) differently. In this example the particular solution \(y_p=-x^2-x-1\) contained the term \(-x\), which satisfies the complementary equation. We can drop this term and redefine \(y_p=-x^2-1\), since \(-x^2-x-1\) is a solution of (5.7.16) and \(x\) is a solution of the complementary equation; hence, \(-x^2-1=(-x^2-x-1)+x\) is also a solution of (5.7.16). In general, it’s always legitimate to drop linear combinations of \(\{y_1,y_2\}\) from particular solutions obtained by variation of parameters. (See Exercise 36 for a general discussion of this question.) We’ll do this in the following examples and in the answers to exercises that ask for a particular solution. Therefore, don’t be concerned if your answer to such an exercise differs from ours only by a solution of the complementary equation.
Example 5.7.3
Find a particular solution of
Then find the general solution.
Solution
The characteristic polynomial of the complementary equation
is \(p(r)=r^2+3r+2=(r+1)(r+2)\), so \(y_1=e^{-x}\) and \(y_2=e^{-2x}\) form a fundamental set of solutions of (5.7.20). We look for a particular solution of (5.7.19) in the form
where
Adding these two equations yields
From the first equation,
Integrating by means of the substitution \(v=e^x\) and taking the constants of integration to be zero yields
and
Therefore
so
Since the last term on the right satisfies the complementary equation, we drop it and redefine
The general solution of (5.7.19) is
Example 5.7.4
Solve the initial value problem
given that
are solutions of the complementary equation
Solution We first use variation of parameters to find a particular solution of
on \((-1,1)\) in the form
where
Multiplying the first equation by \(1/(x-1)\) and adding the result to the second equation yields
Since
(5.7.23) implies that \(u_2'=1\). From (5.7.22),
Integrating and taking the constants of integration to be zero yields
and
Therefore
However, since
is a solution of the complementary equation, we redefine
Therefore the general solution of (5.7.24) is
Differentiating this yields
Setting \(x=0\) in the last two equations and imposing the initial conditions \(y(0)=-1\) and \(y'(0)=-5\) yields the system
The solution of this system is \(c_1=2,\,c_2=1\). Substituting these into (5.7.24) yields
as the solution of (5.7.21). Figure 5.7.1 is a graph of the solution.
Comparison of Methods
We’ve now considered three methods for solving nonhomogeneous linear equations: undetermined coefficients, reduction of order, and variation of parameters. It’s natural to ask which method is best for a given problem. The method of undetermined coefficients should be used for constant coefficient equations with forcing functions that are linear combinations of polynomials multiplied by functions of the form \(e^{\alpha x}\), \(e^{\lambda x}\cos \omega x\), or \(e^{\lambda x}\sin \omega x\). Although the other two methods can be used to solve such problems, they will be more difficult except in the most trivial cases, because of the integrations involved.
If the equation isn’t a constant coefficient equation or the forcing function isn’t of the form just specified, the method of undetermined coefficients does not apply and the choice is necessarily between the other two methods. The case could be made that reduction of order is better because it requires only one solution of the complementary equation while variation of parameters requires two. However, variation of parameters will probably be easier if you already know a fundamental set of solutions of the complementary equation.
5.7 Exercises
In Exercises 1–6 use variation of parameters to find a particular solution.
-
\(y''+9y=\tan 3x\)
Show answer
\(y_p=\dst{-\cos 3x\ln|\sec 3x+\tan 3x|\over9}\)
-
\(y''+4y=\sin 2x\sec^2 2x\)
Show answer
\(y_p=\dst{-{\sin 2x\ln|\cos 2x|\over4} +{x\cos 2x\over2}}\)
-
\(y''-3y'+2y=\dst{4\over 1+e^{-x}}\)
Show answer
\(y_p=4e^x(1+e^x) \ln(1+e^{-x})\)
-
\(y''-2y'+2y=3e^x \sec x\)
Show answer
\(y_p=3e^x(\cos x \ln |\cos x|+x\sin x)\)
-
\(y''-2y'+y=14x^{3/2}e^x\)
Show answer
\(y_p=\dst{8\over 5} x^{7/2}e^x\)
-
\(y''-y=\dst{4e^{-x}\over 1-e^{-2x}}\)
Show answer
\(y_p=e^x\ln(1-e^{-2x})-e^{-x}\ln(e^{2x}-1)\)
In Exercises 7–29 use variation of parameters to find a particular solution, given the solutions \(y_1\), \(y_2\) of the complementary equation.
-
\(x^2y''+xy'- y=2x^2+2; \quad y_1=x, \quad y_2=\dst{1\over x}\)
Show answer
\(y_p=\dst{2(x^2-3)\over3}\)
-
\(\dst{xy''+(2-2x)y'+(x-2)y=e^{2x}; \quad y_1=e^x, \quad y_2={e^x\over x}}\)
Show answer
\(y_p=\dst{e^{2x}\over x}\)
-
\(4x^2y''+(4x-8x^2)y'+(4x^2-4x-1)y=4x^{1/2}e^x, \quad x > 0\); \(y_1=x^{1/2} e^x,\; y_2=x^{-1/2}e^x\)
Show answer
\(y_p=x^{1/2}e^x\ln x\)
-
\(y''+4xy'+(4x^2+2)y=4e^{-x(x+2)};\quad y_1=e^{-x^2}, \quad y_2=xe^{-x^2}\)
Show answer
\(y_p=e^{-x(x+2)}\)
-
\(x^2y''-4xy'+6y=x^{5/2},\, x > 0;\quad y_1=x^2,\; y_2=x^3\)
Show answer
\(y_p=-4x^{5/2}\)
-
\(x^2y''-3xy'+3y=2x^4\sin x; \quad y_1=x,\; y_2=x^3\)
Show answer
\(y_p=-2x^2\sin x-2x\cos x\)
-
\((2x+1)y''-2y'-(2x+3)y=(2x+1)^2e^{-x}; \quad y_1=e^{-x}, \quad y_2=xe^x\)
Show answer
\(y_p=-\dst{xe^{-x}(x+1)\over2}\)
-
\(4xy''+2y'+y=\sin\sqrt x; \quad y_1=\cos\sqrt x, \quad y_2=\sin\sqrt x\)
Show answer
\(y_p=-\dst{\sqrt x\cos\sqrt x\over2}\)
-
\(xy''-(2x+2)y'+(x+2)y=6x^3e^x;\quad y_1=e^x,\quad y_2=x^3e^x\)
Show answer
\(y_p=\dst{3x^4e^x\over2}\)
-
\(x^2y''-(2a-1)xy'+a^2y=x^{a+1}; \quad y_1=x^a, \quad y_2=x^a \ln x\)
Show answer
\(y_p=x^{a+1}\)
-
\(x^2y''-2xy'+(x^2+2)y=x^3\cos x; \quad y_1=x\cos x, \quad y_2=x\sin x\)
Show answer
\(y_p=\dst{x^2\sin x\over 2}\)
-
\(xy''-y'-4x^3y=8x^5;\quad y_1=e^{x^2},\; y_2=e^{-x^2}\)
Show answer
\(y_p=-2x^2\)
-
\((\sin x)y''+(2\sin x-\cos x)y'+(\sin x-\cos x)y=e^{-x}; \quad y_1=e^{-x},\quad y_2=e^{-x}\cos x\)
Show answer
\(y_p=-e^{-x}\sin x\)
-
\(4x^2y''-4xy'+(3-16x^2)y=8x^{5/2}; \quad y_1=\sqrt xe^{2x},\; y_2=\sqrt xe^{-2x}\)
Show answer
\(y_p=-\dst{\sqrt x\over2}\)
-
\( 4x^2y''-4xy'+(4x^2+3)y=x^{7/2}; \quad y_1=\sqrt x\sin x,\; y_2=\sqrt x\cos x\)
Show answer
\(y_p=\dst{x^{3/2}\over4}\)
-
\(x^2y''-2xy'-(x^2-2)y=3x^4;\quad y_1=xe^x,\; y_2=xe^{-x}\)
Show answer
\(y_p=-3x^2\)
-
\(x^2y''-2x(x+1)y' +(x^2+2x+2)y=x^3e^x; \quad y_1=xe^x, \quad y_2=x^2e^x\)
Show answer
\(y_p=\dst{x^3e^x\over2}\)
-
\(x^2y''-xy'-3y=x^{3/2}; \quad y_1=1/x, \quad y_2=x^3\)
Show answer
\(y_p=-\dst{4x^{3/2}\over15}\)
-
\(x^2y''-x(x+4)y'+2(x+3)y=x^4e^x; \quad y_1=x^2, \quad y_2=x^2e^x\)
Show answer
\(y_p=x^3e^x\)
-
\(x^2y''-2x(x+2)y'+(x^2+4x+6)y=2xe^x; \quad y_1=x^2e^x, \quad y_2=x^3e^x\)
Show answer
\(y_p=xe^x\)
-
\(x^2y''-4xy'+(x^2+6)y=x^4; \quad y_1=x^2\cos x, \quad y_2=x^2\sin x\)
Show answer
\(y_p=x^2\)
-
\((x-1)y''-xy'+y=2(x-1)^2e^x; \quad y_1=x, \quad y_2=e^x\)
Show answer
\(y_p=xe^x(x-2)\)
-
\(4x^2y''-4x(x+1)y'+(2x+3)y=x^{5/2}e^x; \quad y_1=\sqrt x, \quad y_2=\sqrt xe^x\)
Show answer
\(y_p=\dst{\sqrt xe^x(x-1)/4}\)
In Exercises 30–32 use variation of parameters to solve the initial value problem, given \(y_1,y_2\) are solutions of the complementary equation.
-
\((3x-1)y''-(3x+2)y'-(6x-8)y=(3x-1)^2e^{2x}, \quad y(0)=1,\; y'(0)=2\);
\(y_1=e^{2x},\; y_2=xe^{-x}\)
Show answer
\(y=\dst{e^{2x}(3x^2-2x+6)\over6}+\dst{xe^{-x}\over3}\)
-
\((x-1)^2y''-2(x-1)y'+2y=(x-1)^2, \quad y(0)=3,\quad y'(0)=-6\);
\(y_1=x-1\), \(y_2=x^2-1\)
Show answer
\(y=(x-1)^2\ln(1-x)+2x^2-5x+3\)
-
\((x-1)^2y''-(x^2-1)y'+(x+1)y=(x-1)^3e^x, \quad y(0)=4,\quad y'(0)=-6\);
\(y_1=(x-1)e^x,\quad y_2=x-1\)
Show answer
\(y=(x^2-1)e^x-5(x-1)\)
In Exercises 33–35 use variation of parameters to solve the initial value problem and graph the solution, given that \(y_1,y_2\) are solutions of the complementary equation.
-
C/G \(\dst{(x^2-1)y''+4xy'+2y=2x, \quad y(0)=0,\; y'(0) =-2; \quad y_1={1\over x-1},\; y_2={1\over x+1}}\)
Show answer
\(y=\dst{x(x^2+6)\over3(x^2-1)}\)
-
C/G \(\dst{x^2y''+2xy'-2y=-2x^2, \quad y(1)=1,\; y'(1)= -1; \quad y_1=x,\; y_2={1\over x^2}}\)
Show answer
\(y=\dst{ -{x^2\over 2}+x+{1\over 2x^2}}\)
-
C/G \((x+1)(2x+3)y''+2(x+2)y'-2y=(2x+3)^2, \quad y(0)=0,\quad y'(0)=0\); \(y_1=x+2,\quad y_2=\dst{1\over x+1}\)
Show answer
\(y=\dst{x^2(4x+9)\over6(x+1)}\)
-
Suppose
\[ y_p=\overline y+a_1y_1+a_2y_2 \]is a particular solution of
\[ P_0(x)y''+P_1(x)y'+P_2(x)y=F(x), \tag*{\rm (A)} \]where \(y_1\) and \(y_2\) are solutions of the complementary equation
\[ P_0(x)y''+P_1(x)y'+P_2(x)y=0. \]Show that \(\overline y\) is also a solution of (A).
-
Suppose \(p\), \(q\), and \(f\) are continuous on \((a,b)\) and let \(x_0\) be in \((a,b)\). Let \(y_1\) and \(y_2\) be the solutions of
\[ y''+p(x)y'+q(x)y=0 \]such that
\[ y_1(x_0)=1, \quad y_1'(x_0)=0, \quad y_2(x_0)=0, \quad y_2'(x_0)=1. \]Use variation of parameters to show that the solution of the initial value problem
\[ y''+p(x)y'+q(x)y=f(x), \quad y(x_0)=k_0,\; y'(x_0)=k_1, \]is
\[ \begin{array}{rcl} y(x) &=& k_0y_1(x)+k_1y_2(x) \\ & & \dst \qquad+\int^x_{x_0}\left(y_1(t)y_2(x)- y_1(x)y_2(t)\right) f(t)\exp\left(\int^t_{x_0}p(s)\,ds\right)\,dt. \end{array} \]Hint: Use Abel’s formula for the Wronskian of \(\{y_1,y_2\}\), and integrate \(u_1'\) and \(u_2'\) from \(x_0\) to \(x\). Show also that
\[ \begin{array}{rcl} y'(x) &=& k_0y_1'(x)+k_1y_2'(x) \\[6pt] & & \dst \qquad+\int^x_{x_0}\left(y_1(t)y_2'(x)-y_1'(x)y_2(t) \right)f(t)\exp\left(\int^t_{x_0}p(s)\,ds\right)\,dt. \end{array} \] -
Suppose \(f\) is continuous on an open interval that contains \(x_0=0\). Use variation of parameters to find a formula for the solution of the initial value problem
\[ y''-y=f(x), \quad y(0)=k_0,\quad y'(0)=k_1. \]Show answer
(a) \(y=k_0\cosh x+k_1\sinh x+\dst{\int_0^x}\sinh (x-t)f(t)\,dt\)
(b) \(y'=k_0\sinh x+k_1\cosh x+\dst{\int_0^x}\cosh (x-t)f(t)\,dt\)
-
Suppose \(f\) is continuous on \((a,\infty)\), where \(a<0\), so \(x_0=0\) is in \((a,\infty)\).
Use variation of parameters to find a formula for the solution of the initial value problem
\[ y''+y=f(x), \quad y(0)=k_0,\quad y'(0)=k_1. \]Hint
You will need the addition formulas for the sine and cosine:
\begin{eqnarray*} \sin(A+B)&=&\sin A\cos B+\cos A\sin B \\ \cos(A+B)&=&\cos A\cos B-\sin A\sin B. \end{eqnarray*}
For the rest of this exercise assume that the improper integral \(\int_{0}^\infty f(t)\,dt\) is absolutely convergent.
Show that if \(y\) is a solution of
\[ y''+y=f(x) \tag*{\rm (A)} \]on \((a,\infty)\), then
\[ \lim_{x \to \infty}\left(y(x)-A_0\cos x-A_1\sin x\right)=0 \tag*{\rm (B)} \]and
\[ \lim_{x\to\infty}\left(y'(x)+A_0\sin x-A_1\cos x\right)=0, \tag*{\rm (C)} \]where
\[ A_0=k_0-\int_0^\infty f(t)\sin t\,dt\mbox{\quad and \quad} A_1=k_1+\int_0^\infty f(t)\cos t\,dt. \]Hint: Recall from calculus that if \(\int_0^\infty f(t)\,dt\) converges absolutely, then \(\lim_{x\to\infty}\int_x^\infty |f(t)|\,dt~=~0\).
Show that if \(A_0\) and \(A_1\) are arbitrary constants, then there’s a unique solution of \(y''+y=f(x)\) on \((a,\infty)\) that satisfies (B) and (C).
Show answer
(a) \(y(x)=k_0\cos x+k_1\sin x+\dst{\int_0^x}\sin (x-t)f(t)\,dt\)
(b) \(y'(x)=-k_0\sin x+k_1\cos x+\int_0^x\cos (x-t) f(t)\,dt\)