How To Solve A Nonhomogeneous Differential Equation

7 min read

Of course. Here is a comprehensive article on how to solve a nonhomogeneous differential equation.


How to Solve a Nonhomogeneous Differential Equation: A Step-by-Step Guide

Nonhomogeneous differential equations are a cornerstone of mathematical modeling, appearing in fields like physics, engineering, and economics to describe systems influenced by external forces or inputs. Unlike their homogeneous counterparts, which describe a system's natural behavior, nonhomogeneous equations capture the system's response to these external influences. On the flip side, mastering their solution is essential for predicting how real-world systems, from a spring-mass system being pushed to an electrical circuit with a voltage source, will behave. This guide provides a clear, step-by-step approach to solving these equations, focusing on the two most common methods: the Method of Undetermined Coefficients and the Method of Variation of Parameters Simple, but easy to overlook..

Understanding the Structure: Homogeneous vs. Nonhomogeneous

First, it's crucial to understand the anatomy of a nonhomogeneous linear differential equation. It typically looks like this:

aₙ(x) yⁿ + aₙ₋₁(x) yⁿ⁻¹ + ... + a₁(x) y' + a₀(x) y = g(x)

Here, y is the unknown function, y', y'', etc., are its derivatives, a₀(x) to aₙ(x) are coefficient functions, and g(x) is the key player: the nonhomogeneous term. Think about it: the presence of g(x) (which is not zero) makes the equation nonhomogeneous. If g(x) = 0, the equation is homogeneous Simple as that..

Some disagree here. Fair enough That's the part that actually makes a difference..

The general solution to a nonhomogeneous equation is built from two parts:

General Solution = Complementary Solution + Particular Solution

  • Complementary Solution (y_c): This is the general solution to the associated homogeneous equation (where g(x) = 0). It represents the system's natural or transient response.
  • Particular Solution (y_p): This is any single solution that satisfies the full nonhomogeneous equation. It represents the system's steady-state or forced response.

Your goal is to find y_c and y_p separately and then add them together. The methods differ primarily in how you find the particular solution, y_p.


Method 1: The Method of Undetermined Coefficients

This method is straightforward but has a limitation: it only works when the nonhomogeneous term g(x) is of a specific form—namely, a polynomial, exponential, sine, cosine, or a combination of these. The core idea is to guess the form of the particular solution y_p based on the form of g(x), with unknown coefficients, and then solve for those coefficients by plugging the guess back into the equation.

Step-by-Step Process:

Step 1: Solve the Homogeneous Equation to Find y_c Ignore g(x) for now. Solve the associated homogeneous equation using characteristic equations (for constant coefficient equations). This gives you y_c = C₁y₁ + C₂y₂ + ..., where y₁, y₂,... are fundamental solutions Surprisingly effective..

Step 2: Guess the Form of y_p Based on g(x) Use the following table to make an initial guess. The unknown coefficients (A, B, C, etc.) are what you need to determine.

If g(x) is... Then the guess for y_p is...
A constant (e.g., 5) A
A polynomial (e.g., 3x² + 2) Ax² + Bx + C
An exponential (e.g.Now, , e^(2x)) Ae^(2x)
A sine or cosine (e. Still, g. Which means , sin(3x)) Acos(3x) + Bsin(3x)
A product (e. Consider this: g. Here's the thing — , x²e^(x)) (Ax² + Bx + C)e^(x)
A sum (e. g.

Step 3: Check for Duplication with y_c This is a critical step. If any term in your guess for y_p is already a solution to the homogeneous equation (i.e., it appears in y_c), you must modify your guess by multiplying by x (or x² if necessary) until there is no duplication.

Step 4: Substitute y_p into the Original Equation Plug your guessed y_p (with its derivatives) into the full nonhomogeneous equation. The terms involving the complementary solution will cancel out, leaving an equation that allows you to solve for the unknown coefficients (A, B, C, etc.) by equating coefficients of like terms.

Step 5: Write the General Solution Combine the complementary solution and the particular solution: y = y_c + y_p.

Example:

Solve: y'' - 3y' + 2y = 6e^(2x)

  1. Find y_c: The homogeneous equation is y'' - 3y' + 2y = 0. The characteristic equation is r² - 3r + 2 = 0, which factors to (r-1)(r-2)=0. So, r = 1, 2. Thus, y_c = C₁e^(x) + C₂e^(2x).
  2. Guess y_p: The nonhomogeneous term is 6e^(2x). Our initial guess is Ae^(2x).
  3. Check for Duplication: Notice that e^(2x) is already a part of y_c. We must multiply our guess by x. So, the modified guess is y_p = Axe^(2x).
  4. Substitute and Solve:
    • y_p' = Ae^(2x) + 2Axe^(2x)
    • y_p'' = 2Ae^(2x) + 2Ae^(2x) + 4Axe^(2x) = 4Ae^(2x) + 4Axe^(2x) Now plug into the original equation: (4Ae^(2x) + 4Axe^(2x)) - 3(Ae^(2x) + 2Axe^(2x)) + 2(Axe^(2x)) = 6e^(2x) Simplify by collecting terms: 4Ae^(2x) + 4Axe^(2x) - 3Ae^(2x) - 6Axe^(2x) + 2Axe^(2x) = 6e^(2x) The xe^(2x) terms cancel: (4A - 6A + 2A)xe^(2x) = 0. We are left with: (4A - 3A)e^(2x) = 6e^(2x) => Ae^(2x) = 6e^(2x). That's why, A = 6. So, y_p = 6xe^(2x).
  5. General Solution: y = y_c + y_p = C₁e^(x) + C₂e^(2x) + 6xe^(2x).

Method 2: The Method of Variation of Parameters

This method

Method 2: The Method of Variation of Parameters

This method is more general than the Method of Undetermined Coefficients. Practically speaking, it works for any linear nonhomogeneous equation with variable coefficients (provided the homogeneous solutions are known) and for nonhomogeneous terms $g(x)$ that are not restricted to polynomials, exponentials, sines, or cosines (e. g., $\tan x$, $\ln x$, $1/x$).

The core idea is to take the complementary solution $y_c = C_1 y_1(x) + C_2 y_2(x)$ and vary the parameters—replacing the constants $C_1$ and $C_2$ with unknown functions $u_1(x)$ and $u_2(x)$. We seek a particular solution of the form: $y_p = u_1(x)y_1(x) + u_2(x)y_2(x)$

To determine $u_1$ and $u_2$, we impose two conditions. The first is that $y_p$ must satisfy the original ODE. The second is a simplifying constraint chosen to make the derivatives manageable: $u_1'y_1 + u_2'y_2 = 0$

With this constraint, the first derivative simplifies to $y_p' = u_1y_1' + u_2y_2'$. Substituting $y_p$, $y_p'$, and $y_p''$ into the standard form ODE $y'' + p(x)y' + q(x)y = g(x)$ and simplifying (using the fact that $y_1$ and $y_2$ satisfy the homogeneous equation) yields a system of two equations for $u_1'$ and $u_2'$:

$ \begin{cases} u_1'y_1 + u_2'y_2 = 0 \ u_1'y_1' + u_2'y_2' = g(x) \end{cases} $

Solving this system using Cramer's Rule introduces the Wronskian, $W(y_1, y_2) = y_1y_2' - y_2y_1'$. Since $y_1$ and $y_2$ are linearly independent solutions, $W \neq 0$. The formulas for the derivatives are:

$u_1' = \frac{-y_2 g(x)}{W}, \quad u_2' = \frac{y_1 g(x)}{W}$

Integrating these gives $u_1$ and $u_2$ (constants of integration are set to zero, as we only need one particular solution) And that's really what it comes down to..

Step-by-Step Algorithm for Variation of Parameters

  1. Standard Form: Ensure the ODE is in the form $y'' + p(x)y' + q(x)y = g(x)$. Crucial: The coefficient of $y''$ must be 1. Divide the whole equation if necessary.
  2. Find $y_1$ and $y_2$: Solve the associated homogeneous equation to get two linearly independent solutions $y_1(x)$ and $y_2(x)$.
  3. Compute the Wronskian: Calculate $W = y_1y_2' - y_2y_1'$.
  4. Find $u_1'$ and $u_2'$: Use the formulas: $u_1' = -\frac{y_2 g(x)}{W}, \quad u_2' = \frac{y_1 g(x)}{W}$
  5. Integrate: Find $u_1 = \int u_1' dx$ and $u_2 = \int u_2' dx$. (Omit constants of integration).
  6. Form $y_p$: Construct $y_p = u_1 y_1 + u_2 y_2$.
  7. General Solution: $y = y_c + y_p = C_1 y_1 + C_2 y_2 + y_p$.

Example:

Solve: $y'' + y = \tan x$ (Note: Undetermined Coefficients fails here because $\tan x$ is not a UC function).

  1. Standard Form: Already $y'' + y = \tan x$. Here $g(x) = \tan x$.
  2. Find $y_1, y_2$: Homogeneous equation: $y'' + y = 0 \rightarrow r^2 + 1 = 0 \rightarrow r = \pm i$. $y_1 = \cos x$, $y_2 = \sin x$. $y_c = C_1 \cos x + C_2 \
Just Added

New on the Blog

Picked for You

Up Next

Thank you for reading about How To Solve A Nonhomogeneous Differential Equation. We hope the information has been useful. Feel free to contact us if you have any questions. See you next time — don't forget to bookmark!
⌂ Back to Home