Skip to content

20. Variation of Parameters

Dated: 01-12-2024

The general solution of the linear first order differential equation of the form

\[\frac{dy}{dx}+P(x)y=f(x)\]

is given by

\[y=e^{-\int Pdx}.\int e^{\int Pdx}f(x)dx+c_1e^{-\int Pdx}\]

Note

  • In the last equation, the 2nd term \(y_c=c_1e^{-\int Pdx}\) is the solution of the associated homogeneous equation
\[\frac {dy}{dx} + P(x) y = 0\]
  • Similarly, the first term \(y_p=e^{-\int Pdx}.\int e^{\int Pdx}.f(x)dx\) is a particular solution of the first order non homogeneous linear differential equation.
  • Therefore, the solution is \(y = y_c + y_p\).

The Variation of Parameters

First order Equation

The particular solution \(y_p\) of the first-order linear differential equation is given by

\[ y_p = e^{-\int P dx} \int e^{\int P dx} f(x) dx \]

This formula can also be derived by another method, known as the variation of parameters. The basic procedure is the same as discussed in the lecture on the construction of a second solution.

Since

\[ y_1 = e^{-\int P dx} \]

is the solution of the homogeneous differential equation

\[ \frac{dy}{dx} + P(x)y = 0, \]

and the equation is linear. Therefore, the general solution of the equation is

\[ y = c_1 y_1(x). \]

The variation of parameters consists of finding a function \(u_1(x)\) such that

\[ y_p = u_1(x) y_1(x) \]

is a particular solution of the non-homogeneous differential equation

\[ \frac{dy}{dx} + P(x)y = f(x). \]

Notice that the parameter \(c_1\) has been replaced by the variable \(u_1\). We substitute \(y_p\) in the given equation to obtain

\[ u_1 \left[ \frac{dy_1}{dx} + P(x)y_1 \right] + y_1 \frac{du_1}{dx} = f(x). \]

Since \(y_1\) is a solution of the homogeneous differential equation, we must have

\[ \frac{dy_1}{dx} + P(x)y_1 = 0. \]

So that we obtain

\[ y_1 \frac{du_1}{dx} = f(x). \]

This is a variable separable equation. By separating the variables, we have

\[ du_1 = \frac{f(x)}{y_1(x)} dx. \]

Integrating the last expression with respect to \(x\), we obtain

\[ u_{1}(x)=\int\frac{f(x)}{y_{1}(x)}dx = \int e^{-\int Pdx} \cdot f(x) dx \]

Therefore, the particular solution \(y_p\) of the given first-order differential equation is:

\[ y = u(x)y_{1} \]
\[ y_{p} = e^{-\int Pdx} \cdot \int e^{\int Pdx} \cdot f(x) dx \]

Or

\[ u_{i} = \int\frac{f(x)}{y_{i}(x)}dx \]

Second order Equation

Consider the 2ⁿᵈ-order linear non-homogeneous differential equation

\[ a_2(x)y'' + a_1(x)y' + a_0(x)y = g(x). \]

By dividing with \(a_2(x)\), we can write this equation in the standard form

\[ y'' + P(x)y' + Q(x)y = f(x). \]

The functions \(P(x)\), \(Q(x)\), and \(f(x)\) are continuous on some interval \(I\). For the complementary function, we consider the associated homogeneous differential equation

\[ y'' + P(x)y' + Q(x)y = 0. \]

Complementary Function

Suppose that \(y_1\) and \(y_2\) are two linearly independent solutions of the homogeneous equation. Then \(y_1\) and \(y_2\) form a fundamental set of solutions of the homogeneous equation on the interval \(I\). Thus, the complementary function is

\[ y_c = c_1y_1(x) + c_2y_2(x). \]

Since \(y_1\) and \(y_2\) are solutions of the homogeneous equation, we have

\[ y_1'' + P(x)y_1' + Q(x)y_1 = 0 \]

and

\[ y_2'' + P(x)y_2' + Q(x)y_2 = 0. \]

Particular Integral

For finding a particular solution \(y_p\), we replace the parameters \(c_1\) and \(c_2\) in the complementary function with the unknown variables \(u_1(x)\) and \(u_2(x)\). So that the assumed particular integral is

\[ y_p = u_1(x)y_1(x) + u_2(x)y_2(x). \]

Since we seek to determine two unknown functions \(u_1\) and \(u_2\), we need two equations involving these unknowns. One of these two equations results from substituting the assumed particular integral into the differential equation.
Assumed \(y_p\) in the given differential equation. We impose the other equation to simplify the first derivative and thereby the 2ⁿᵈ derivative of \(y_p\).

\[ y_p' = u_1'y_1 + u_1y_1' + u_2'y_2 + u_2y_2' = u_1y_1' + u_2y_2' + u_1'y_1 + u_2'y_2. \]

To avoid 2ⁿᵈ derivatives of \(u_1\) and \(u_2\), we impose the condition

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

Then

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

So that

\[ y_p'' = u_1'y_1' + u_1y_1'' + u_2'y_2' + u_2y_2''. \]

Therefore

\[ y_p'' + P y_p' + Qy_p = u_1'y_1' + u_1y_1'' + u_2'y_2' + u_2y_2'' + Pu_1y_1' + Pu_2y_2' + Qu_1y_1 + Qu_2y_2. \]

Substituting in the given non-homogeneous differential equation yields

\[ u_1'y_1' + u_1y_1'' + u_2'y_2' + u_2y_2'' + Pu_1y_1' + Pu_2y_2' + Qu_1y_1 + Qu_2y_2 = f(x), \]

or

\[ u_1[y_1'' + Py_1' + Qy_1] + u_2[y_2'' + Py_2' + Qy_2] + u_1'y_1' + u_2'y_2' = f(x). \]

Now making use of the relations

\[ y_1'' + P(x)y_1' + Q(x)y_1 = 0 \]
\[ y_2'' + P(x)y_2' + Q(x)y_2 = 0 \]

we obtain

\[ u_1'y_1 + u_2'y_2 = f(x). \]

Hence \(u_1\) and \(u_2\) must be functions that satisfy the equations

\[ u_1'y_1 + u_2'y_2 = 0 \]
\[ u_1'y_1' + u_2'y_2' = f(x). \]

By using Cramer's rule, the solution of this set of equations is given by

\[ u_1' = \frac{W_1}{W}, \quad u_2' = \frac{W_2}{W} \]

where \(W\), \(W_1\), and \(W_2\) denote the following determinants:

\[ W = \begin{vmatrix} y_1 & y_2 \\ y_1' & y_2' \end{vmatrix}, \quad W_1 = \begin{vmatrix} 0 & y_2 \\ f(x) & y_2' \end{vmatrix}, \quad W_2 = \begin{vmatrix} y_1 & 0 \\ y_1' & f(x) \end{vmatrix} \]

The determinant \(W\) can be identified as the Wronskian of the solutions \(y_1\) and \(y_2\). Since the solutions \(y_1\) and \(y_2\) are linearly independent on \(I\). Therefore

\[W(y_1(x), y_2(x)) \neq 0, \forall x \in I\]

Now integrating the expressions for \(u'_1\) and \(u'_2\), we obtain the values of \(u_1\) and \(u_2\), hence the particular solution of the non-homogeneous linear differential equation.

Summary of Method

Step 1

We find the complementary function by solving the associated homogeneous differential equation:

\[ a_{2}y^{\prime\prime}+a_{1}y^{\prime}+a_{0}y=0 \]

Step 2

If the complementary function is given by:

\[ y_{c}=c_{1}y_{1}+c_{2}y_{2} \]

then \(y_1\) and \(y_2\) are two linearly independent solutions of the homogeneous differential equation. Then compute the Wronskian of these solutions:

\[ W=|\begin{matrix}y_{1}&y_{2}\\ y_{1}^{\prime}&y_{2}^{\prime}\end{matrix}| \]

Step 3

By dividing with \(a_2\), we transform the given non-homogeneous equation into the standard form:

\[ y^{\prime\prime}+P(x)y^{\prime}+Q(x)y=f(x) \]

and we identify the function \(f(x)\).

Step 4

We now construct the determinants \(W_1\) and \(W_2\) given by:

\[ W_{1}=[\begin{matrix}0&y_{2}\\ f(x)&y_{2}^{\prime}\end{matrix}] \]
\[ W_{2}=|\begin{matrix}y_{1}&0\\ y_{1}^{\prime}&f(x)\end{matrix}| \]

Step 5

Next, we determine the derivatives of the unknown variables \(u_1\) and \(u_2\) through the relations:

\[ u_{1}^{\prime}=\frac{W_{1}}{W} \]
\[ u_{2}^{\prime}=\frac{W_{2}}{W} \]

Step 6

Integrate the derivatives \(u_1'\) and \(u_2'\) to find the unknown variables \(u_1\) and \(u_2\). So that

\[u_1 = \int {\frac {W_1} W} dx\]
\[u_2 = \int {\frac {W_2} W} dx\]

Step 7

A particular solution of the given non-homogeneous equation can be written as:

\[ y_p = u_1y_1 + u_2y_2 \]

Step 8

The general solution of the differential equation is then given by:

\[ y = y_c + y_p = c_1y_1 + c_2y_2 + u_1y_1 + u_2y_2 \]

Constants of Integration

We don't need to introduce the constants of integration when computing the indefinite integrals in Step 6 to find the unknown functions 1 of \(u_1\) and \(u_2\). For, if we do introduce these constants, then:

\[ y_p = (u_1 + a_1)y_1 + (u_2 + b_1)y_2 \]

So that the general solution of the given non-homogeneous differential equation is:

\[ y = y_c + y_p = c_1y_1 + c_2y_2 + (u_1 + a_1)y_1 + (u_2 + b_1)y_2 \]
\[ y = (c_1 + a_1)y_1 + (c_2 + b_1)y_2 + u_1y_1 + u_2y_2 \]

If we replace \(c_1 + a_1\) with \(C_1\) and \(c_2 + b_1\) with \(C_2\), we obtain:

\[ y = C_1y_1 + C_2y_2 + u_1y_1 + u_2y_2 \]

This does not provide anything new and is similar to the general solution found in Step 8, namely:

\[ y = c_1y_1 + c_2y_2 + u_1y_1 + u_2y_2 \]

Example

Solve

\[ y'' - 4y' + 4y = (x + 1)e^{2x} \]

Solution

Step 1

To find the complementary function

\[ y'' - 4y' + 4y = 0 \]

Put

\[ y = e^{mx} \]
\[ y' = me^{mx} \]
\[ y'' = m^2e^{mx} \]

Then the auxiliary equation is

\[ m^2 - 4m + 4 = 0 \]
\[ (m - 2)^2 = 0 \Rightarrow m = 2, 2 \]

Repeated real roots of the auxiliary equation

\[ y_c = c_1e^{2x} + c_2xe^{2x} \]

Step 2

By inspecting the complementary function \(y_c\), we make the identification:

\[ y_1 = e^{2x} \quad \text{and} \quad y_2 = xe^{2x} \]
\[ W(y_1, y_2) = W(e^{2x}, xe^{2x}) = \begin{vmatrix} e^{2x} & xe^{2x} \\ 2e^{2x} & 2xe^{2x} + e^{2x} \end{vmatrix} = e^{4x} \neq 0, \forall x \]

Step 3

The given differential equation is:

\[ y'' - 4y' + 4y = (x + 1)e^{2x} \]

Since this equation is already in the standard form:

\[ y'' + P(x)y' + Q(x)y = f(x) \]

Therefore, we identify the function \(f(x)\) as:

\[ f(x) = (x + 1)e^{2x} 1 \]

Step 4

We now construct the determinants \(W_1\) and \(W_2\):

\[ W_1 = \begin{vmatrix} 0 & xe^{2x} \\ (x + 1)e^{2x} & 2xe^{2x} + e^{2x} \end{vmatrix} = -(x + 1)xe^{4x} \]
\[ W_2 = \begin{vmatrix} e^{2x} & 0 \\ 2e^{2x} & (x + 1)e^{2x} \end{vmatrix} = (x + 1)e^{4x} \]

Step 5

We determine the derivatives of the functions \(u_1\) and \(u_2\):

\[ u_1' = \frac{W_1}{W} = \frac{-(x + 1)xe^{4x}}{e^{4x}} = -x^2 - x \]
\[ u_2' = \frac{W_2}{W} = \frac{(x + 1)e^{4x}}{e^{4x}} = x + 1 \]

Step 6

Integrating the last two expressions, we obtain:

\[ u_1 = \int (-x^2 - x) dx = -\frac{x^3}{3} - \frac{x^2}{2} \]
\[ u_2 = \int (x + 1) dx = \frac{x^2}{2} + x \]

Remember: We don't have to add the constants of integration.

Step 7

Therefore, a particular solution of the given differential equation is:

\[ y_p = \left(-\frac{x^3}{3} - \frac{x^2}{2}\right)e^{2x} + \left(\frac{x^2}{2} + x\right)xe^{2x} \]

or

\[y_p = \left(\frac {x^3} 6 + \frac {x^2} 2\right)e^{2x}\]

Step 8

Hence, the general solution of the given differential equation is:

\[ y = y_c + y_p = c_1e^{2x} + c_2xe^{2x} + \left(-\frac{x^3}{6} + \frac{x^2}{2}\right)e^{2x} \]

References

Read more about notations and symbols.