PAGE 1

5.5 Nonhomogeneous Eqs: Undetermined Coefficients

\[y'' + ay' + by = f(x)\]

Where a and b are constants.

  • If \(f(x) = 0 \rightarrow\) homogeneous (solution in 5.3)
  • If \(f(x) \neq 0 \rightarrow\) nonhomogeneous

Because the equation is linear \(\rightarrow\) superposition applies.

Solution is: \(y = y_c + y_p\)

\(y_p\) : particular solution
(contribution from nonzero \(f(x)\))

\(y_c\) : complementary solution
(the homogeneous part, solve pretending \(f(x) = 0\))

The method of undetermined coeffs is one method to find \(y_p\)

Effective if \(f(x)\) is:

  • polynomial
  • exponential
  • sine and or cosine
  • hyperbolic sine and hyp cosine
PAGE 2

basic idea: "guess" the form of \(y_p\) based on the form of \(f(x)\)

Example

\[y'' - 4y = 3x\]

Solution: \(y = y_c + y_p\)

\(y_c\) : solution to \(y'' - 4y = 0\)

\[r^2 - 4 = 0 \implies r = \pm 2\]\[y_c = C_1 e^{2x} + C_2 e^{-2x}\]

\(y_p\) : "guess" a function w/ unknown coeff that has the same form as \(f(x)\)

here, \(f(x) = 3x \rightarrow\) first-deg polynomial

so, we "guess" \(y_p = Ax + B\) (1st-deg polynomial w/ unknown A, B)

PAGE 3

\( y_p \) is itself a solution, so we sub it into the eq. to find the undetermined coeffs.

\[ y'' - 4y = 3x \]

\( y_p = Ax + B \)

\( y_p' = A \)

\( y_p'' = 0 \)

\[ 0 - 4(Ax + B) = 3x \]\[ -4Ax - 4B = 3x + 0 \]

\( -4A = 3 \)

\( -4B = 0 \)

so, \( A = -\frac{3}{4} \), \( B = 0 \)

\( y_p = -\frac{3}{4}x \)

general solution: \( y = y_c + y_p = \)

\( C_1 e^{2x} + C_2 e^{-2x} + (-\frac{3}{4}x) \)

PAGE 4

example

\[ y'' - y' - 2y = 3e^x \]

\( y = y_c + y_p \)

\( y_c \): solution to \( y'' - y' - 2y = 0 \)

\( \vdots \)

\( y_c = C_1 e^{-x} + C_2 e^{2x} \)

\( y_p \): matches the form of \( f(x) = 3e^x \)

\( y_p = Ae^x \)

\( y_p' = Ae^x \)

\( y_p'' = Ae^x \)

Sub into \( y'' - y' - 2y = 3e^x \)

\[ Ae^x - Ae^x - 2Ae^x = 3e^x \]\[ -2Ae^x = 3e^x \quad A = -\frac{3}{2} \]

\( y = C_1 e^{-x} + C_2 e^{2x} - \frac{3}{2} e^x \)

PAGE 5

Method of Undetermined Coefficients: Trigonometric Functions

  • deriv of polynomial → polynomial
  • deriv of exponential → exponential

we need the derivs of yp to keep the same form for this method to work

if \( f(x) = \cos x \) and we guess \( y_p = A \cos x \)

\[ y_p' = -A \sin x \]

NOT cosine any more!

same if \( f(x) = \sin x \)

however, if we always guess \( y_p = A \cos x + B \sin x \)

then

\[ y_p' = -A \sin x + B \cos x \]

remains combo of cosine and sine (great!)

So, even if right side only has cosine or sine, we ALWAYS include both in \( y_p \).

PAGE 6

example

\[ y'' - y' - 2y = \cos x \]

left side same as last example

so, \( y_c = c_1 e^{-x} + c_2 e^{2x} \)

\( y_p \) needs BOTH cosine and sine

\[ y_p = A \cos x + B \sin x \] \[ y_p' = -A \sin x + B \cos x \] \[ y_p'' = -A \cos x - B \sin x \]
sub into \( y'' - y' - 2y = \cos x \)
\[ -A \cos x - B \sin x + A \sin x - B \cos x - 2A \cos x - 2B \sin x = \cos x \] \[ (-3A - B) \cos x + (-3B + A) \sin x = 1 \cdot \cos x + 0 \cdot \sin x \]
\[ -3A - B = 1 \] \[ -3B + A = 0 \]
… \( A = -\frac{3}{10} \quad B = -\frac{1}{10} \)

\[ y = c_1 e^{-x} + c_2 e^{2x} - \frac{3}{10} \cos x - \frac{1}{10} \sin x \]

PAGE 7

Example: Non-Homogeneous Differential Equations

\[ y'' - y' - 2y = x e^{3x} \]

The general solution is given by \( y = y_c + y_p \), where the complementary solution is:

\[ y_c = c_1 e^{-x} + c_2 e^{2x} \]

Determining the Form of \( y_p \)

Given the non-homogeneous term:

\[ f(x) = x e^{3x} \] \[ = x e^{3x} + 0 \cdot e^{3x} = (x + 0) e^{3x} \]

Here, \( (x + 0) \) is a 1st-order polynomial and \( e^{3x} \) is the exponential part.

Therefore, \( y_p \) matches the form:

\[ y_p = (Ax + B) e^{3x} \]
  • \( y_p' = \dots \)
  • \( y_p'' = \dots \)

Substitute these into the original equation \( y'' - y' - 2y = x e^{3x} \). After solving for coefficients:

\[ y_p = \left( \frac{1}{4}x - \frac{5}{16} \right) e^{3x} \]

Final General Solution

\[ y = c_1 e^{-x} + c_2 e^{2x} + \left( \frac{1}{4}x - \frac{5}{16} \right) e^{3x} \]
PAGE 8

Problem: Overlap with Complementary Solution

Problem: \( f(x) \) matches the form of at least one of the functions in \( y_c \).

Example

\[ y'' + 100y = \cos(10x) \]

Finding \( y_c \):

\[ r^2 + 100 = 0 \implies r = \pm 10i \] \[ y_c = c_1 \cos(10x) + c_2 \sin(10x) \]

Given \( f(x) = \cos(10x) \), a standard guess would be:

\[ \text{guess } y_p = A \cos(10x) + B \sin(10x) \]

Note: This guess is the same as \( y_c \)! They are not linearly independent.

The Fix

Same as with repeated roots: toss \( x \) at it until the problem goes away.

Correct Form:

\[ y_p = Ax \cos(10x) + Bx \sin(10x) \]

Then substitute into the equation as usual.