Variation of Parameters Solver: ODEs for Advanced High School+ & College

Variation of Parameters Solver

Variation of Parameters Solver

Solve $ay” + by’ + cy = g(t)$ for complex forcing functions like $\tan(t)$, $\sec(t)$, or $\ln(t)$.

System (LHS)

ay” + by’ + cy = g(t)

Forcing Function g(t)

Initial Conditions

*Initial conditions set at t=1 for stability with ln(t) or 1/t.

Calculated Basis & Wronskian

Basis y₁
$$ y_1 = \cos(t) $$
Basis y₂
$$ y_2 = \sin(t) $$
Wronskian (W)
$$ W = 1 $$

Variation Formulas

Particular Solution Setup
$$ y_p = -y_1 \int \frac{y_2 g(t)}{aW} dt + y_2 \int \frac{y_1 g(t)}{aW} dt $$

Numeric Solution Graph

Total y(t)
Forcing g(t)
Time (t) →

Understanding Variation of Parameters

The Method of Undetermined Coefficients is powerful but limited: it only works when the forcing function $g(t)$ is a polynomial, exponential, sine, cosine, or a sum/product of these. What happens if $g(t) = \sec(t)$ or $g(t) = \ln(t)$?

This is where Variation of Parameters shines. It is a general method that works for any continuous forcing function. The idea is to replace the constants $c_1$ and $c_2$ in the homogeneous solution with unknown functions $u_1(t)$ and $u_2(t)$: $$ y_p(t) = u_1(t)y_1(t) + u_2(t)y_2(t) $$

We find these unknown functions by calculating the Wronskian, $W(t) = y_1 y_2′ – y_1′ y_2$, and solving the following integrals:

$$ u_1(t) = \int \frac{-y_2(t)g(t)}{a \cdot W(t)} dt, \quad u_2(t) = \int \frac{y_1(t)g(t)}{a \cdot W(t)} dt $$

Although the integrals can sometimes be difficult to evaluate analytically, this tool performs Numerical Integration to graph the exact behavior of the system, showing you the response even when a closed-form solution is messy or impossible.

FAQ

Why use this instead of Undetermined Coefficients?
Use Variation of Parameters when $g(t)$ is not one of the “nice” functions (poly, exp, sin, cos). For example, finding the response to a $1/t$ force requires this method.
What is the Wronskian?
The Wronskian is a determinant used to check if a set of functions is linearly independent. In this method, it appears in the denominator of our integrals. If $W(t) = 0$, the solutions are dependent, and the method fails (though this won’t happen for valid fundamental sets).

UNDERGRADUATE