Skip to main content
Mathematics LibreTexts

8.1: The Method of Variation of Parameters

  • Page ID
    106244
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    We are interested in solving nonhomogeneous second order linear differential equations of the form

    \[a_{2}(x) y^{\prime \prime}(x)+a_{1}(x) y^{\prime}(x)+a_{0}(x) y(x)=f(x) \label{8.1} \]

    The general solution of this nonhomogeneous second order linear differential equation is found as a sum of the general solution of the homogeneous equation,

    \[a_{2}(x) y^{\prime \prime}(x)+a_{1}(x) y^{\prime}(x)+a_{0}(x) y(x)=0, \label{8.2} \]

    and a particular solution of the nonhomogeneous equation. Recall from Chapter 1 that there are several approaches to finding particular solutions of nonhomogeneous equations. Any guess would be sufficient. An intelligent guess, based upon the Method of Undetermined Coefficients, was reviewed previously in Chapter 1. However, a more methodical method, which is first seen in a first course in differential equations, is the Method of Variation of Parameters. Also, we explored the matrix version of this method in Section 2.8. We will review this method in this section and extend it to the solution of boundary value problems.

    While it is sufficient to derive the method for the general differential equation above, we will instead consider solving equations that are in SturmLiouville, or self-adjoint, form. Therefore, we will apply the Method of Variation of Parameters to the equation

    \[\dfrac{d}{d x}\left(p(x) \dfrac{d y(x)}{d x}\right)+q(x) y(x)=f(x) \label{8.3} \]

    Note that \(f(x)\) in this equation is not the same function as in the general equation posed at the beginning of this section.

    We begin by assuming that we have determined two linearly independent solutions of the homogeneous equation. The general solution is then given by

    \[y(x)=c_{1} y_{1}(x)+c_{2} y_{2}(x) . \label{8.4} \]

    In order to determine a particular solution of the nonhomogeneous equation, we vary the parameters \(c_{1}\) and \(c_{2}\) in the solution of the homogeneous problem by making them functions of the independent variable. Thus, we seek a particular solution of the nonhomogeneous equation in the form

    \[y_{p}(x)=c_{1}(x) y_{1}(x)+c_{2}(x) y_{2}(x) \label{8.5} \]

    In order for this to be a solution, we need to show that it satisfies the differential equation. We first compute the derivatives of \(y_{p}(x)\). The first derivative is

    \[y_{p}^{\prime}(x)=c_{1}(x) y_{1}^{\prime}(x)+c_{2}(x) y_{2}^{\prime}(x)+c_{1}^{\prime}(x) y_{1}(x)+c_{2}^{\prime}(x) y_{2}(x) \nonumber \]

    Without loss of generality, we will set the sum of the last two terms to zero. (One can show that the same results would be obtained if we did not. See Problem 8.2.) Then, we have

    \[c_{1}^{\prime}(x) y_{1}(x)+c_{2}^{\prime}(x) y_{2}(x)=0 \text {. } \label{8.6} \]

    Now, we take the second derivative of the remaining terms to obtain

    \[y_{p}^{\prime \prime}(x)=c_{1}(x) y_{1}^{\prime \prime}(x)+c_{2}(x) y_{2}^{\prime \prime}(x)+c_{1}^{\prime}(x) y_{1}^{\prime}(x)+c_{2}^{\prime}(x) y_{2}^{\prime}(x) . \nonumber \]

    Expanding the derivative term in Equation (8.3),

    \[p(x) y_{p}^{\prime \prime}(x)+p^{\prime}(x) y_{p}^{\prime}(x)+q(x) y_{p}(x)=f(x), \nonumber \]

    and inserting the expressions for \(y_{p}, y_{p}^{\prime}(x)\), and \(y_{p}^{\prime \prime}(x)\), we have

    \begin{aligned}
    f(x)=& p(x)\left[c_{1}(x) y_{1}^{\prime \prime}(x)+c_{2}(x) y_{2}^{\prime \prime}(x)+c_{1}^{\prime}(x) y_{1}^{\prime}(x)+c_{2}^{\prime}(x) y_{2}^{\prime}(x)\right] \\
    &+p^{\prime}(x)\left[c_{1}(x) y_{1}^{\prime}(x)+c_{2}(x) y_{2}^{\prime}(x)\right]+q(x)\left[c_{1}(x) y_{1}(x)+c_{2}(x) y_{2}(x)\right] .
    \end{aligned}

    Rearranging terms, we find

    \[\begin{aligned}
    f(x)=& c_{1}(x)\left[p(x) y_{1}^{\prime \prime}(x)+p^{\prime}(x) y_{1}^{\prime}(x)+q(x) y_{1}(x)\right] \\
    &+c_{2}(x)\left[p(x) y_{2}^{\prime \prime}(x)+p^{\prime}(x) y_{2}^{\prime}(x)+q(x) y_{2}(x)\right] \\
    &+p(x)\left[c_{1}^{\prime}(x) y_{1}^{\prime}(x)+c_{2}^{\prime}(x) y_{2}^{\prime}(x)\right]
    \end{aligned} \label{8.7} \]

    Since \(y_{1}(x)\) and \(y_{2}(x)\) are both solutions of the homogeneous equation. The first two bracketed expressions vanish. Dividing by \(p(x)\), we have that

    \[c_{1}^{\prime}(x) y_{1}^{\prime}(x)+c_{2}^{\prime}(x) y_{2}^{\prime}(x)=\dfrac{f(x)}{p(x)} \label{8.8} \]

    Our goal is to determine \(c_{1}(x)\) and \(c_{2}(x)\). In this analysis, we have found that the derivatives of these functions satisfy a linear system of equations (in the \(c_{i}\)'s):

    Linear System for Variation of Parameters

    \[\begin{aligned}
    &c_{1}^{\prime}(x) y_{1}(x)+c_{2}^{\prime}(x) y_{2}(x)=0 \\
    &c_{1}^{\prime}(x) y_{1}^{\prime}(x)+c_{2}^{\prime}(x) y_{2}^{\prime}(x)=\dfrac{f(x)}{p(x)}
    \end{aligned} \label{8.9} \]

    This system is easily solved to give

    \[\begin{aligned}
    c_{1}^{\prime}(x) &=-\dfrac{f(x) y_{2}(x)}{p(x)\left[y_{1}(x) y_{2}^{\prime}(x)-y_{1}^{\prime}(x) y_{2}(x)\right]} \\
    c_{2}^{\prime}(x) &=\dfrac{f(x) y_{1}(x)}{p(x)\left[y_{1}(x) y_{2}^{\prime}(x)-y_{1}^{\prime}(x) y_{2}(x)\right]} .
    \end{aligned} \label{8.10} \]

    We note that the denominator in these expressions involves the Wronskian of the solutions to the homogeneous problem. Recall that

    \(W\left(y_{1}, y_{2}\right)(x)=\left|\begin{array}{ll}
    y_{1}(x) & y_{2}(x) \\
    y_{1}^{\prime}(x) & y_{2}^{\prime}(x)
    \end{array}\right|\)

    Furthermore, we can show that the denominator, \(p(x) W(x)\), is constant. Differentiating this expression and using the homogeneous form of the differential equation proves this assertion.

    \[\begin{aligned}
    \dfrac{d}{d x}(p(x) W(x))=& \dfrac{d}{d x}\left[p(x)\left(y_{1}(x) y_{2}^{\prime}(x)-y_{1}^{\prime}(x) y_{2}(x)\right)\right] \\
    =&\left.y_{1}(x) \dfrac{d}{d x}\left(p(x) y_{2}^{\prime}(x)\right)\right)+p(x) y_{2}^{\prime}(x) y_{1}^{\prime}(x) \\
    &\left.-y_{2}(x) \dfrac{d}{d x}\left(p(x) y_{1}^{\prime}(x)\right)\right)-p(x) y_{1}^{\prime}(x) y_{2}^{\prime}(x) \\
    =&-y_{1}(x) q(x) y_{2}(x)+y_{2}(x) q(x) y_{1}(x)=0
    \end{aligned} \label{8.11} \]

    Therefore,

    \[p(x) W(x)=\text { constant. } \nonumber \]

    So, after an integration, we find the parameters as

    \[\begin{aligned}
    &c_{1}(x)=-\int_{x_{0}}^{x} \dfrac{f(\xi) y_{2}(\xi)}{p(\xi) W(\xi)} d \xi \\
    &c_{2}(x)=\int_{x_{1}}^{x} \dfrac{f(\xi) y_{1}(\xi)}{p(\xi) W(\xi)} d \xi
    \end{aligned} \label{8.12} \]

    where \(x_{0}\) and \(x_{1}\) are arbitrary constants to be determined later.

    Therefore, the particular solution of (8.3) can be written as

    \[y_{p}(x)=y_{2}(x) \int_{x_{1}}^{x} \dfrac{f(\xi) y_{1}(\xi)}{p(\xi) W(\xi)} d \xi-y_{1}(x) \int_{x_{0}}^{x} \dfrac{f(\xi) y_{2}(\xi)}{p(\xi) W(\xi)} d \xi \label{8.13} \]

    As a further note, we usually do not rewrite our initial value problems in self-adjoint form. Recall that for an equation of the form

    \[a_{2}(x) y^{\prime \prime}(x)+a_{1}(x) y^{\prime}(x)+a_{0}(x) y(x)=g(x) . \label{8.14} \]

    we obtained the self-adjoint form by multiplying the equation by

    \[\dfrac{1}{a_{2}(x)} e^{\int \dfrac{a_{1}(x)}{a_{2}(x)} d x}=\dfrac{1}{a_{2}(x)} p(x) \nonumber \]

    This gives the standard form

    \[\left(p(x) y^{\prime}(x)\right)^{\prime}+q(x) y(x)=f(x) \nonumber \]

    where

    \[f(x)=\dfrac{1}{a_{2}(x)} p(x) g(x) \nonumber \]

    With this in mind, Equation (8.13) becomes

    \[y_{p}(x)=y_{2}(x) \int_{x_{1}}^{x} \dfrac{g(\xi) y_{1}(\xi)}{a_{2}(\xi) W(\xi)} d \xi-y_{1}(x) \int_{x_{0}}^{x} \dfrac{g(\xi) y_{2}(\xi)}{\left.a_{(} \xi\right) W(\xi)} d \xi \label{8.15} \]

    Example 8.1. Consider the nonhomogeneous differential equation

    \[y^{\prime \prime}-y^{\prime}-6 y=20 e^{-2 x}. \nonumber \]

    We seek a particular solution to this equation. First, we note two linearly independent solutions of this equation are

    \[y_{1}(x)=e^{3 x}, \quad y_{2}(x)=e^{-2 x} . \nonumber \]

    So, the particular solution takes the form

    \[y_{p}(x)=c_{1}(x) e^{3 x}+c_{2}(x) e^{-2 x} . \nonumber \]

    We just need to determine the \(c_{i}\)'s. Since this problem is not in self-adjoint form, we will use

    \[\dfrac{f(x)}{p(x)}=\dfrac{g(x)}{a_{2}(x)}=20 e^{-2 x} \nonumber \]

    as seen above. Then the linear system we have to solve is

    \[\begin{aligned}
    c_{1}^{\prime}(x) e^{3 x}+c_{2}^{\prime}(x) e^{-2 x} &=0 \\
    3 c_{1}^{\prime}(x) e^{3 x}-2 c_{2}^{\prime}(x) e^{-2 x} &=20 e^{-2 x}
    \end{aligned} \label{8.16} \]

    Multiplying the first equation by 2 and adding the equations yields

    \[5 c_{1}^{\prime}(x) e^{3 x}=20 e^{-2 x} \nonumber \]

    or

    \[c_{1}^{\prime}(x)=4 e^{-5 x} . \nonumber \]

    Inserting this back into the first equation in the system, we have

    \[4 e^{-2 x}+c_{2}^{\prime}(x) e^{-2 x}=0 \nonumber \]

    leading to

    \[c_{2}^{\prime}(x)=-4 . \nonumber \]

    These equations are easily integrated to give

    \[c_{1}(x)=-\dfrac{4}{5} e^{-5 x}, \quad c_{2}(x)=-4 x \nonumber \]

    Therefore, the particular solution has been found as

    \[\begin{aligned}
    y_{p}(x) &=c_{1}(x) e^{3 x}+c_{2}(x) e^{-2 x} \\
    &=-\dfrac{4}{5} e^{-5 x} e^{3 x}-4 x e^{-2 x} \\
    &=-\dfrac{4}{5} e^{-2 x}-4 x e^{-2 x}
    \end{aligned} \label{8.17} \]

    Noting that the first term can be absorbed into the solution of the homogeneous problem. So, the particular solution can simply be written as

    \[y_{p}(x)=-4 x e^{-2 x} \nonumber \]

    This is the answer you would have found had you used the Modified Method of Undetermined Coefficients.

    Example 8.2. Revisiting the last example, \(y'' - y' - 6y = 20e^{-2x}\).

    The formal solution in Equation (8.13) was not used in the last example. Instead, we proceeded from the Linear System for Variation of Parameters earlier in this section. This is the more natural approach towards finding the particular solution of the nonhomogeneous equation. Since we will be using Equation (8.13) to obtain solutions to initial value and boundary value problems, it might be useful to use it to solve this problem.

    From the last example we have

    \[y_{1}(x)=e^{3 x}, \quad y_{2}(x)=e^{-2 x} \nonumber \]

    We need to compute the Wronskian:

    \(W(x)=W\left(y_{1}, y_{2}\right)(x)=\left|\begin{array}{cc}
    e^{3 x} & e^{-2 x} \\
    3 e^{3 x} & -2 e^{-2 x}
    \end{array}\right|=-5 e^{x}\)

    Also, we need \(p(x)\), which is given by

    \[p(x)=\exp \left(-\int d x\right)=e^{-x} \nonumber \]

    So, we see that \(p(x) W(x)=-5\). It is indeed constant, just as we had proven earlier.

    Finally, we need \(f(x)\). Here is where one needs to be careful as the original problem was not in self-adjoint form. We have from the original equation that \(g(x)=20 e^{-2 x}\) and \(a_{2}(x)=1\). So

    \[f(x)=\dfrac{p(x)}{a_{2}(x)} g(x)=20 e^{-3 x} \nonumber \]

    Now we are ready to construct the solution.

    \[\begin{aligned}
    y_{p}(x) &=y_{2}(x) \int_{x_{1}}^{x} \dfrac{f(\xi) y_{1}(\xi)}{p(\xi) W(\xi)} d \xi-y_{1}(x) \int_{x_{0}}^{x} \dfrac{f(\xi) y_{2}(\xi)}{p(\xi) W(\xi)} d \xi \\
    &=e^{-2 x} \int_{x_{1}}^{x} \dfrac{20 e^{-3 \xi} e^{3 \xi}}{-5} d \xi-e^{3 x} \int_{x_{0}}^{x} \dfrac{20 e^{-3 \xi} e^{-2 \xi}}{-5} d \xi \\
    &=-4 e^{-2 x} \int_{x_{1}}^{x} d \xi+4 e^{3 x} \int_{x_{0}}^{x} e^{-5 x} d \xi \\
    &=-\left.4 \xi e^{-2 x}\right|_{x_{1}} ^{x}-\left.\dfrac{4}{5} e^{3 x} e^{-5 \xi}\right|_{x_{0}} ^{x} \\
    &=-4 x e^{-2 x}-\dfrac{4}{5} e^{-2 x}+4 x_{1} e^{-2 x}+\dfrac{4}{5} e^{-5 x_{0}} e^{3 x}
    \end{aligned} \label{8.18} \]

    Note that the first two terms we had found in the last example. The remaining two terms are simply linear combinations of \(y_{1}\) and \(y_{2}\). Thus, we really have the solution to the homogeneous problem contained within the solution when we use the arbitrary constant limits in the integrals. In the next section we will make use of these constants when solving initial value and boundary value problems.

    In the next section we will determine the unknown constants subject to either initial conditions or boundary conditions. This will allow us to combine the two integrals and then determine the appropriate Green's functions.


    This page titled 8.1: The Method of Variation of Parameters is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Russell Herman via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.