(I) Method of Undetermined Coefficients

Consider a nonhomogeneous linear \( n^{th} \)-order differential equation with constant coefficients:

$$ a_n y^{(n)} + a_{n-1} y^{(n-1)} + \dots + a_1 y' + a_0 y = f(x) \quad (1) $$

Recall from Section 3.2 that the general solution of equation (1) is \( y = y_c + y_p \), where:

Our main task is to find the particular solution \( y_p \). Let \( D \) be the differential operator \( \frac{d}{dx} \). We can define the linear operator \( L \) as:

$$ L = a_n D^n + a_{n-1} D^{n-1} + \dots + a_1 D + a_0 $$

Then equation (1) can be written as \( Ly = f(x) \). The Method of Undetermined Coefficients is a straightforward way of finding \( y_p \) when the forcing function \( f(x) \) is simple enough to allow an educated guess for its form.

Rule 1: No Duplication

Suppose that no term appearing either in the forcing function \( f(x) \), or in any of its derivatives, satisfies the associated homogeneous equation \( Ly = 0 \). In this case, we take as a trial solution for \( y_p \) a linear combination of all linearly independent such terms and their derivatives.

Case 1: \( f(x) \) is a Polynomial of Degree \( m \)

Example 1

Find a particular solution of \( y'' + 3y' + 4y = 3x + 2 \).

Solution: Let \( y_p = Ax + B \). Then \( y_p' = A \) and \( y_p'' = 0 \). Substituting into the differential equation:

$$ 0 + 3(A) + 4(Ax + B) = 3x + 2 \implies 4Ax + (3A + 4B) = 3x + 2 $$

Equating coefficients:
\( x \)-terms: \( 4A = 3 \implies A = 3/4 \).
Constant terms: \( 3A + 4B = 2 \implies 3(3/4) + 4B = 2 \implies 4B = 2 - 9/4 = -1/4 \implies B = -1/16 \).

Result: \( y_p = \frac{3}{4}x - \frac{1}{16} \).

Case 2: \( f(x) = a \cos(kx) + b \sin(kx) \)

Example 2

Find a particular solution of \( 3y'' + y' - 2y = 2 \cos x \).

Solution: Let \( y_p = A \cos x + B \sin x \). Derivatives: \( y_p' = -A \sin x + B \cos x \), \( y_p'' = -A \cos x - B \sin x \). Substitute:

$$ 3(-A \cos x - B \sin x) + (-A \sin x + B \cos x) - 2(A \cos x + B \sin x) = 2 \cos x $$

Group by function:
\( (-3A + B - 2A) \cos x + (-3B - A - 2B) \sin x = 2 \cos x \)

Solving the system:
1) \( -5A + B = 2 \)
2) \( -A - 5B = 0 \implies A = -5B \)

Substitute: \( -5(-5B) + B = 2 \implies 26B = 2 \implies B = 1/13 \). Then \( A = -5/13 \).

Result: \( y_p = -\frac{5}{13} \cos x + \frac{1}{13} \sin x \).

Case 3: \( f(x) = a e^{rx} \)

Example 3

Find a particular solution of \( y'' - 4y = 2e^{3x} \).

Solution: Let \( y_p = Ae^{3x} \). Then \( y_p'' = 9Ae^{3x} \). Substituting into the equation:
\( 9Ae^{3x} - 4Ae^{3x} = 2e^{3x} \implies 5A = 2 \implies A = 2/5 \).

Result: \( y_p = \frac{2}{5} e^{3x} \).


Rule 2: The Modification Rule (Dealing with Duplication)

If the forcing function \( f(x) \) is of either form \( P_m(x) e^{rx} \cos(kx) \) or \( P_m(x) e^{rx} \sin(kx) \), and any term in the standard trial solution satisfies the associated homogeneous equation, we must multiply the standard trial solution by \( x^s \), where \( s \) is the smallest non-negative integer such that no term in \( y_p \) duplicates a term in \( y_c \).

Example 4: Handling Duplication

Find a particular solution of \( y'' - 4y = 2e^{2x} \).

Solution: The homogeneous characteristic equation \( r^2 - 4 = 0 \) gives \( r = \pm 2 \). Thus \( y_c = C_1 e^{2x} + C_2 e^{-2x} \).
Since \( Ae^{2x} \) is a solution of the homogeneous equation, substituting it would result in zero. We use the modified guess: \( y_p = Axe^{2x} \).

Derivatives: \( y_p' = Ae^{2x} + 2Axe^{2x} \), \( y_p'' = 4Ae^{2x} + 4Axe^{2x} \).
Substitute: \( (4Ae^{2x} + 4Axe^{2x}) - 4(Axe^{2x}) = 2e^{2x} \implies 4A = 2 \implies A = 1/2 \).

Result: \( y_p = \frac{1}{2} x e^{2x} \).

Summary Table for Trial Particular Solutions

Forcing Function \( f(x) \) Trial Particular Solution \( y_p \)
Polynomial of degree \( m \) \( x^s (A_m x^m + \dots + A_1 x + A_0) \)
\( a \cos(kx) + b \sin(kx) \) \( x^s (A \cos(kx) + B \sin(kx)) \)
\( e^{rx} (a \cos(kx) + b \sin(kx)) \) \( x^s e^{rx} (A \cos(kx) + B \sin(kx)) \)
\( P_m(x) e^{rx} \) \( x^s e^{rx} (A_m x^m + \dots + A_0) \)

*Note: \( s = 0 \) for Rule 1 (no duplication).

Example 5: Determining Trial Forms

Find the form of the particular solution \( y_p \) for the following equations without determining coefficients:

(1) \( y^{(3)} + 9y' = x \sin x + x^2 e^{2x} \)

  • Homogeneous roots: \( r^3 + 9r = r(r^2+9) = 0 \implies r = 0, \pm 3i \).
  • \( y_c = C_1 + C_2 \cos(3x) + C_3 \sin(3x) \).
  • Trial form for \( x \sin x \): \( (Ax + B) \cos x + (Cx + D) \sin x \). (No duplication).
  • Trial form for \( x^2 e^{2x} \): \( (Ex^2 + Fx + G) e^{2x} \). (No duplication).
  • Combined \( y_p \): \( (Ax + B) \cos x + (Cx + D) \sin x + (Ex^2 + Fx + G) e^{2x} \).

(2) \( y'' + 6y' + 13y = e^{-3x} \cos(2x) \)

  • Homogeneous roots: \( r^2 + 6r + 13 = (r+3)^2 + 4 = 0 \implies r = -3 \pm 2i \).
  • \( y_c = e^{-3x}(C_1 \cos(2x) + C_2 \sin(2x)) \).
  • Since \( e^{-3x} \cos(2x) \) is present in \( y_c \), we must multiply the standard guess by \( x \).
  • Trial \( y_p \): \( x e^{-3x} (A \cos(2x) + B \sin(2x)) \).

(3) \( (D-2)^3 (D^2 + 9) y = x^2 e^{2x} + x \sin(2x) \)

  • Homogeneous roots: \( (r-2)^3 (r^2+9) = 0 \implies r = 2 \) (multiplicity 3), \( \pm 3i \).
  • \( y_c = (C_1 + C_2 x + C_3 x^2)e^{2x} + C_4 \cos(3x) + C_5 \sin(3x) \).
  • For \( x^2 e^{2x} \), the standard guess \( (Ax^2 + Bx + C) e^{2x} \) duplicates all three terms in \( y_c \). Multiply by \( x^3 \).
  • Trial \( y_p \): \( x^3 (Ax^2 + Bx + C) e^{2x} + (Dx + E) \cos(2x) + (Fx + G) \sin(2x) \).
Example 6: Initial Value Problem

Solve: \( y'' - 2y' + 2y = x + 1 \) with \( y(0) = 3 \) and \( y'(0) = 0 \).

1. Homogeneous: \( r^2 - 2r + 2 = (r-1)^2 + 1 = 0 \implies r = 1 \pm i \).
\( y_c = e^x(C_1 \cos x + C_2 \sin x) \).

2. Particular: Guess \( y_p = Ax + B \).
Substituting: \( -2(A) + 2(Ax + B) = x + 1 \implies 2Ax + (2B - 2A) = x + 1 \).
\( 2A = 1 \implies A = 1/2 \). \( 2B - 2(1/2) = 1 \implies 2B = 2 \implies B = 1 \).
\( y_p = \frac{1}{2}x + 1 \).

3. General: \( y(x) = e^x(C_1 \cos x + C_2 \sin x) + \frac{1}{2}x + 1 \).

4. Apply Conditions:
\( y(0) = C_1 + 1 = 3 \implies C_1 = 2 \).
\( y'(x) = e^x(C_1 \cos x + C_2 \sin x) + e^x(-C_1 \sin x + C_2 \cos x) + 1/2 \).
\( y'(0) = C_1 + C_2 + 1/2 = 0 \implies 2 + C_2 + 0.5 = 0 \implies C_2 = -5/2 \).

Particular Solution: \( y(x) = e^x(2 \cos x - \frac{5}{2} \sin x) + \frac{1}{2}x + 1 \).


(II) Method of Variation of Parameters

Variation of parameters is a more general method used when the forcing function \( f(x) \) has infinitely many independent derivatives (e.g., \( \tan x, \sec x, \ln x \)). For the equation \( y'' + P(x) y' + Q(x) y = f(x) \), if the complementary solution is \( y_c = C_1 y_1 + C_2 y_2 \), we assume the particular solution has the form \( y_p = u_1 y_1 + u_2 y_2 \).

Theorem: Variation of Parameters

The particular solution is given by \( y_p(x) = u_1 y_1 + u_2 y_2 \), where:

$$ u_1 = -\int \frac{y_2 f(x)}{W(y_1, y_2)} dx, \quad u_2 = \int \frac{y_1 f(x)}{W(y_1, y_2)} dx $$

Important: The coefficient of the highest-order derivative (e.g., \( y'' \)) must be 1 before identifying the forcing function \( f(x) \).

Example 7

Solve: \( y'' + y = \tan x \).

1. Homogeneous: \( r^2 + 1 = 0 \implies r = \pm i \). \( y_1 = \cos x, y_2 = \sin x, W = 1 \).

2. Find parameters:
\( u_1 = -\int \sin x \tan x dx = \int (\cos x - \sec x) dx = \sin x - \ln |\sec x + \tan x| \).
\( u_2 = \int \cos x \tan x dx = \int \sin x dx = -\cos x \).

3. Result: \( y_p = (\sin x - \ln |\sec x + \tan x|)\cos x - \cos x \sin x = -\cos x \ln |\sec x + \tan x| \).

Example 9: Variable Coefficients

Find \( y_p \) for \( x^2 y'' + xy' - y = 72x^5 \), given \( y_c = C_1 x + C_2 x^{-1} \).

Step 1: Standard form. Divide by \( x^2 \): \( y'' + \frac{1}{x} y' - \frac{1}{x^2} y = 72x^3 \). Thus \( f(x) = 72x^3 \).

Step 2: Wronskian. \( W(x, x^{-1}) = (x)(-x^{-2}) - (1)(x^{-1}) = -2x^{-1} \).

Step 3: Solve for parameters.
\( u_1 = -\int \frac{x^{-1} \cdot 72x^3}{-2x^{-1}} dx = \int 36x^3 dx = 9x^4 \).
\( u_2 = \int \frac{x \cdot 72x^3}{-2x^{-1}} dx = \int -36x^5 dx = -6x^6 \).

Result: \( y_p = (9x^4)(x) + (-6x^6)(x^{-1}) = 3x^5 \).

Example 10: Higher Order Equation

Find \( y_p \) for \( y^{(5)} + 2y^{(3)} + 2y'' = 3x^2 - 1 \).

1. Homogeneous Solution: \( r^2 (r^3 + 2r + 2) = 0 \). Root \( r=0 \) has multiplicity 2.
\( y_c = C_1 + C_2 x + \dots \)

2. Guess Trial Form: For \( 3x^2 - 1 \), guess \( Ax^2 + Bx + C \). Since both \( 1 \) and \( x \) are in \( y_c \), multiply by \( x^2 \):
\( y_p = x^2 (Ax^2 + Bx + C) = Ax^4 + Bx^3 + Cx^2 \).

3. Substitute: Derivatives yield:
\( y_p^{(5)} = 0 \), \( y_p^{(4)} = 24A \), \( y_p^{(3)} = 24Ax + 6B \), \( y_p'' = 12Ax^2 + 6Bx + 2C \).

Substituting into the nonhomogeneous equation: \( 2(24Ax + 6B) + 2(12Ax^2 + 6Bx + 2C) = 3x^2 - 1 \).

Equating coefficients:
\( 24A = 3 \implies A = 1/8 \).
\( 48A + 12B = 0 \implies 6 + 12B = 0 \implies B = -1/2 \).
\( 12B + 4C = -1 \implies -6 + 4C = -1 \implies C = 5/4 \).

Result: \( y_p = \frac{1}{8}x^4 - \frac{1}{2}x^3 + \frac{5}{4}x^2 \).