Skip to main content
Mathematics LibreTexts

3.5: Variation of Parameters

  • Page ID
    405
  • \( \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}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    In the last section we solved nonhomogeneous differential equations using the method of undetermined coefficients. This method fails to find a solution when the functions g(t) does not generate a UC-Set. For example if \(g(t)\) is \(\sec(t), \; t^{-1}, \;\ln t\), etc, we must use another approach. The approach that we will use is similar to reduction of order. Our method will be called variation of parameters.

    Consider the differential equation

    \[ L(y) = y'' + p(t)y' + q(t)y = g(t),\]

    and let \(y_1\) and \(y_2\) be solutions to the corresponding homogeneous differential equation

    \[ L(y) = 0.\]

    We write the particular solution is of the form

    \[ y_p = u_1y_1 + u_2y_2\]

    where \(u_1\) and \(u_2\) are both functions of \(t\). Notice that this is always possible, by setting

    \[ u_1 = \dfrac {1}{y_1} \;\;\; \text{and} \;\;\; u_2 = \dfrac {( y_p - 1)}{y_2}. \]

    Actually more can be said, since we are choosing two parameters to find one solution, we can impose one additional condition on the \( u_1\) and \( u_2 \) and still end up with a solution. We make the assumption that

    \[ u_1' y_1 + u_2' y_2 = 0.\]

    This assumption will come in handy later.

    Next take the derivative

    \[ y'_p = u'_1y_1 + u_1y'_1 + u'_2y_2 + u_2y'_2. \]

    The assumption helps us simplify \(y'_p\) as

    \[ y'_p = u_1y'_1 + u_2y'_2. \]

    Now take a second derivative

    \[ y''_p = u'_1y'_1 + u_1y''_1 + u'_2y'_2 + u_2y''_2. \]

    Now substitute into the original differential equation to get

    \[ (u'_1y'_1 + u_1y''_1 + u'_2y'_2 + u_2y''_2) + p(t)(u_1y'_1 + u_2y'_2) + q(t)(u_1y_1 + u_2y_2) = g(t). \]

    Combine terms with common \(u\)'s, we get

    \[ u_1 (y''_1 + p(t)y'_1 + q(t)y_1) + u_2(y''_2 + p(t)y'_2 + q(t)y_2) + u'_1y'_1 + u'_2y'_2 = g(t). \]

    Now notice that since \(y_1\) and \( y_2\) are solutions to the differential equation, both expressions in the parentheses are zero. We have

    \[ u'_1y'_1 + u'_2y'_2 = g(t). \]

    This equation along with the assumption give a system of two equations and two unknowns

    \[ u'_1y_1 + u'_2y_2 = 0 \]

    \[ u'_1y'_1 + u'_2y'_2 = g(t). \]

    Using matrices we get

    \[ \begin{pmatrix} y_1 y_2 \\ y'_1 y'_2 \end{pmatrix} \begin{pmatrix} u'_1\\ u'_2 \end{pmatrix} = \begin{pmatrix} 0 \\ g(t) \end{pmatrix}\]

    We recognize the first matrix as the matrix for the Wronskian. Calling this \(W\), and recalling that the Wronskian of two linearly independent solutions is never zero we can take \(W^{-1}\) of both sides to get

    \[ \begin{pmatrix} u'_1\\ u'_2 \end{pmatrix} = W^{-1} \begin{pmatrix} 0 \\ g(t) \end{pmatrix} \]

    We integrate to find \(u_1\) and \(u_2\).

    \[ \begin{pmatrix} u_1 \\ u_2 \end{pmatrix} = \int W^{-1} \begin{pmatrix} 0 \\ g(t) \end{pmatrix} dt. \]

    Example \(\PageIndex{1}\): Solving a nonhomogeneous differential equation

    Given that

    \[ y_1 = x^2 \quad \text{ and } \quad y_2 = x^2 \ln x \nonumber \]

    are solutions to

    \[ x^2y'' - 3xy' + 4y = x^2 \ln x \nonumber \]

    to the corresponding homogeneous differential equation, find the general solution to the nonhomogeneous differential equation.

    Solution

    First, we divide by \( x^2 \) to get the differential equation in standard form

    \[ y'' - \dfrac {3}{x} y' + \dfrac {4}{x^2}y = \ln x.\nonumber \]

    We let

    \[ y_p = u_1y_1 + u_2y_2 . \nonumber \]

    The Wronskian matrix is

    \[ W = \begin{pmatrix} x^2 x^2 \ln x \\ 2x x + 2x \ln x \end{pmatrix}.\nonumber \]

    We use the adjoint formula to find the inverse matrix. First the Wronskian is the determinant which is

    \[ w = x^3 + 2x^3 \ln x - 2x^3 \ln x = x^3.\nonumber \]

    So the inverse is

    \[ W^{-1} = \dfrac {1}{x^3} \begin{pmatrix} x + 2x \ln x -x^2 \ln x \\ -2x x^2 \end{pmatrix}.\nonumber \]

    We have

    \[\begin{pmatrix} u'_1 \\ u'_2 \end{pmatrix} = \dfrac {1}{x^3} \begin{pmatrix} x + 2x \ln x -x^2 \ln x \\ -2x x^2 \end{pmatrix} \begin{pmatrix} 0 \\ \ln x \end{pmatrix} \]

    \[= \dfrac {1}{x^3} \begin{pmatrix} -x^2 {\left ( \ln x \right )}^2 \\ x^2 \ln x \end{pmatrix} = \begin{pmatrix} -\dfrac{{(\ln x)}^2 }{x} \\ \dfrac {\ln x}{x} \end{pmatrix}\nonumber \]

    Integrating using u-substitution gives

    \[ u_1 =\dfrac{-(\ln x)^3}{3}, \nonumber \]

    \[ u_2 = \dfrac{(\ln x)^2}{2}.\nonumber \]

    We have

    \[ y_p = - \dfrac {1}{3} x^2 {\left ( \ln x \right )}^3 + \dfrac {1}{2} x^2 {\left ( \ln x \right )}^3 = \dfrac {1}{6}x^2{\left ( \ln x \right )}^3.\nonumber \]

    Finally we get

    \[ y = c_1 x^2 + c_2 x^2 \ln x + \dfrac{1}{6} x^2(\ln x)^3. \nonumber \]

    Contributors and Attributions


    This page titled 3.5: Variation of Parameters is shared under a not declared license and was authored, remixed, and/or curated by Larry Green.

    • Was this article helpful?