Nonhomogeneous Linear Equations: Learn It 3

Variation of Parameters

Sometimes, [latex]r(x)[/latex] 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, we are going to divide the differential equation through by [latex]a[/latex], so we have a leading coefficient of [latex]1[/latex]. Then the differential equation has the form:

[latex]y^{\prime\prime}+py^\prime+qy=r(x)[/latex],

where [latex]p[/latex] and [latex]q[/latex] are constants.

If the general solution to the complementary equation is given by [latex]c_1y_1(x)+c_2y_2(x)[/latex], we are going to look for a particular solution of the form [latex]y_p(x)=u(x)y_1(x)+v(x)y_2(x)[/latex]. 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 [latex]x[/latex], rather than constants. We want to find functions [latex]u(x)[/latex] and [latex]v(x)[/latex] such that [latex]y_p(x)[/latex] satisfies the differential equation.

We have:

[latex]\begin{aligned} y_p&=uy_1+vy_2 \\ y_p^\prime&=u^\prime+uy_1^\prime+v^\prime y_2+vy_2^\prime \\ y_p^{\prime\prime}&=(u^\prime y_1+v^\prime y_2)^\prime+u^\prime y_1^\prime+uy_1^{\prime\prime}+v^\prime y_2^\prime+vy_2^{\prime\prime} \end{aligned}[/latex].

Substituting into the differential equation, we obtain:

[latex]\begin{aligned} y_p^{\prime\prime}+py_p^\prime+qy_p&=[(u^\prime y_1+v^\prime y_2)+u^\prime y_1^\prime+uy_1^{\prime\prime}+v^\prime y_2^\prime+vy_2^{\prime\prime}]+p[u^\prime y_1+uy_1^\prime+v^\prime y_2+vy_2^\prime]+q[uy_1+vy_2] \\ &=u[y_1^{\prime\prime}+py_1^\prime+qy_1]+v[y_2^{\prime\prime}+py_2^\prime+qy_2]+(u^\prime y_1+v^\prime y_2)^\prime+p(u^\prime y_1+v^\prime y_2)+(u^\prime y_1^\prime+v^\prime y_2^\prime) \end{aligned}[/latex].

Note that [latex]y_1[/latex] and [latex]y_2[/latex] are solutions to the complementary equation, so the first two terms are zero. Thus, we have:

[latex](u^\prime y_1+v^\prime y_2)^\prime+p(u^\prime y_1+v^\prime y_2)+(u^\prime y_1^\prime+v^\prime y_2^\prime)=r(x)[/latex].

If we simplify this equation by imposing the additional condition [latex]u^\prime y_1+v^\prime y_2=0[/latex], the first two terms are zero, and this reduces to [latex]u^\prime y_1^\prime+v^\prime y_2^\prime=r(x)[/latex]. So, with this additional condition, we have a system of two equations in two unknowns:

[latex]\begin{aligned} u^\prime y_1+v^\prime y_2&=0 \\ u^\prime y_1^\prime+v^\prime y_2^\prime&=r(x) \end{aligned}[/latex].

Solving this system gives us [latex]u^\prime[/latex] and [latex]v^\prime[/latex], which we can integrate to find [latex]u[/latex] and [latex]v[/latex]. Then, [latex]y_p(x)=u(x)y_1(x)+v(x)y_2(x)[/latex] is a particular solution to the differential equation.

Solving this system of equations is sometimes challenging, so let’s review Cramer’s rule, which allows us to solve the system of equations using determinants.

Cramer’s rule

The system of equations:

[latex]\begin{aligned} a_1z_1+b_1z_2=r_1 \\ a_2z_1+b_2z_2&=r_2 \end{aligned}[/latex]

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

[latex]z_1=\frac{\begin{vmatrix}r_1&b_1 \\ r_2&b_2\end{vmatrix}}{\begin{vmatrix}a_1&b_1 \\ a_2&b_2\end{vmatrix}}[/latex] and [latex]z_2=\frac{\begin{vmatrix}a_1&r_1 \\ a_2&r_2\end{vmatrix}}{\begin{vmatrix}a_1&b_1 \\ a_2&b_2\end{vmatrix}}[/latex].

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

[latex]\begin{aligned} x^2z_1+2xz_2&=0 \\ z_1-3x^2z_2&=2x \end{aligned}[/latex].

How to: Use the Method of Variation of Parameters

  1. Solve the complementary equation: Write down the general solution [latex]c_1y_1(x)+c_2y_2(x)[/latex].
  2. Find [latex]u^\prime(x)[/latex] and [latex]v^\prime(x)[/latex]: Use Cramer’s rule or another suitable technique to find functions [latex]u^\prime(x)[/latex] and [latex]v^\prime(x)[/latex] satisfying [latex]\begin{aligned} u^\prime y_1+v^\prime y_2&=0 \\ u^\prime y_1^\prime+v^\prime y_2^\prime&=r(x) \end{aligned}[/latex]
  3. Integrate to find [latex]u[/latex] and [latex]v[/latex]: Integrate [latex]u^\prime[/latex] and [latex]v^\prime[/latex] to find [latex]u(x)[/latex] and [latex]v(x)[/latex]. Then, [latex]y_p(x)=u(x)y_1(x)+v(x)y_2(x)[/latex] is a particular solution to the equation.
  4. Form the particular solution: Calculate [latex]y_p(x)=u(x)y_1(x)+v(x)y_2(x)[/latex].
  5. Write the general solution: Add the general solution to the complementary equation and the particular solution found in step 4.

Find the general solution to the following differential equations.

  1. [latex]y^{\prime\prime}-2y^\prime+y=\frac{e^t}{t^2}[/latex]
  2. [latex]y^{\prime\prime}+y=3\sin^2x[/latex]