Variation of Parameters
students, imagine you already know how to solve some differential equations when the forcing term is simple, like a constant, a polynomial, an exponential, or a sine/cosine wave. But what if the input is more complicated? π― Variation of parameters is a powerful method for finding a particular solution to a nonhomogeneous linear differential equation when the right-hand side is not friendly enough for undetermined coefficients.
What Variation of Parameters Is Trying to Do
A nonhomogeneous linear equation has the form $a_n(x)y^{(n)}+a_{n-1}(x)y^{(n-1)}+\cdots+a_1(x)y'+a_0(x)y=g(x)$, where $g(x)$ is not zero. The associated homogeneous equation is $a_n(x)y^{(n)}+a_{n-1}(x)y^{(n-1)}+\cdots+a_1(x)y'+a_0(x)y=0$.
The general solution of the nonhomogeneous equation is
$$y(x)=y_h(x)+y_p(x),$$
where $y_h(x)$ solves the homogeneous equation and $y_p(x)$ is one particular solution of the full equation.
Variation of parameters builds $y_p(x)$ by letting the constants in the homogeneous solution become functions. That is the big idea π. Instead of saying the coefficients are fixed numbers, we allow them to vary with $x$.
For a second-order equation with homogeneous solution $y_h(x)=c_1y_1(x)+c_2y_2(x)$, variation of parameters looks for
$$y_p(x)=u_1(x)y_1(x)+u_2(x)y_2(x),$$
where $u_1(x)$ and $u_2(x)$ are unknown functions.
This method is useful because it works for many forcing functions $g(x)$, including ones that are difficult or impossible to handle with undetermined coefficients. π
The Main Idea Behind the Method
students, think about solving a puzzle where the shape is already partly known. The homogeneous solutions $y_1(x)$ and $y_2(x)$ give the βshapeβ of all solutions to the simpler equation. The nonhomogeneous term $g(x)$ changes the problem, so we allow the coefficients to adapt as the input changes.
For a second-order linear equation in standard form,
$$y''+p(x)y'+q(x)y=g(x),$$
if $y_1(x)$ and $y_2(x)$ are linearly independent solutions of the homogeneous equation $y''+p(x)y'+q(x)y=0$, then we try
$$y_p(x)=u_1(x)y_1(x)+u_2(x)y_2(x).$$
To make the calculations manageable, we impose an extra condition:
$$u_1'(x)y_1(x)+u_2'(x)y_2(x)=0.$$
This is not the only possible choice, but it is a smart one because it simplifies the derivative of $y_p(x)$.
Differentiate $y_p(x)$:
$$y_p'(x)=u_1'(x)y_1(x)+u_1(x)y_1'(x)+u_2'(x)y_2(x)+u_2(x)y_2'(x).$$
Using the condition $u_1'(x)y_1(x)+u_2'(x)y_2(x)=0$, this becomes
$$y_p'(x)=u_1(x)y_1'(x)+u_2(x)y_2'(x).$$
Differentiating again gives an expression that, after substitution into the differential equation, produces a solvable system for $u_1'(x)$ and $u_2'(x)$.
The Formulas You Use
For the equation
$$y''+p(x)y'+q(x)y=g(x),$$
with linearly independent homogeneous solutions $y_1(x)$ and $y_2(x)$, define the Wronskian
$$W(x)=\begin{vmatrix} y_1(x) & y_2(x) \\ y_1'(x) & y_2'(x) \end{vmatrix}=y_1(x)y_2'(x)-y_1'(x)y_2(x).$$
If $W(x)\neq 0$, then the variation of parameters formulas are
$$u_1'(x)=-\frac{y_2(x)g(x)}{W(x)},$$
$$u_2'(x)=\frac{y_1(x)g(x)}{W(x)}.$$
Then integrate:
$$u_1(x)=\int -\frac{y_2(x)g(x)}{W(x)}\,dx,$$
$$u_2(x)=\int \frac{y_1(x)g(x)}{W(x)}\,dx.$$
Finally,
$$y_p(x)=u_1(x)y_1(x)+u_2(x)y_2(x).$$
Sometimes the integrals are messy, but the method still works if they can be evaluated or simplified. If not, the particular solution may be left in integral form, which is still a valid answer in many contexts.
A Worked Example
Letβs solve
$$y''-y=e^x.$$
First solve the homogeneous equation
$$y''-y=0.$$
Its characteristic equation is
$$r^2-1=0,$$
so
$$r=1,\,-1.$$
Thus the homogeneous solution is
$$y_h(x)=c_1e^x+c_2e^{-x}.$$
Take
$$y_1(x)=e^x,\quad y_2(x)=e^{-x}.$$
Now compute the Wronskian:
$$W(x)=\begin{vmatrix} e^x & e^{-x} \\ e^x & -e^{-x} \end{vmatrix}=-1-1=-2.$$
Use the formulas:
$$u_1'(x)=-\frac{y_2(x)g(x)}{W(x)}=-\frac{e^{-x}e^x}{-2}=\frac{1}{2},$$
$$u_2'(x)=\frac{y_1(x)g(x)}{W(x)}=\frac{e^xe^x}{-2}=-\frac{e^{2x}}{2}.$$
Integrate:
$$u_1(x)=\int \frac{1}{2}\,dx=\frac{x}{2},$$
$$u_2(x)=\int -\frac{e^{2x}}{2}\,dx=-\frac{e^{2x}}{4}.$$
Then the particular solution is
$$y_p(x)=u_1(x)y_1(x)+u_2(x)y_2(x)=\frac{x}{2}e^x-\frac{e^{2x}}{4}e^{-x}.$$
So
$$y_p(x)=\frac{x}{2}e^x-\frac{1}{4}e^x.$$
The term $-\frac{1}{4}e^x$ is actually part of the homogeneous solution, so it can be absorbed into $c_1e^x$. Therefore a simpler particular solution is
$$y_p(x)=\frac{x}{2}e^x.$$
Hence the general solution is
$$y(x)=c_1e^x+c_2e^{-x}+\frac{x}{2}e^x.$$
This example shows an important fact: particular solutions are not unique. Two valid particular solutions can differ by a homogeneous solution.
Why the Wronskian Matters
The Wronskian tells us whether $y_1(x)$ and $y_2(x)$ are linearly independent. If $W(x)\neq 0$, then the pair really gives two different solution directions, and the variation of parameters formulas work.
If $W(x)=0$ at some point, then the formulas can fail there or require a different interval. In standard course problems, the chosen solutions usually have a Wronskian that is nonzero on the interval of interest.
This idea is connected to the structure of linear differential equations. Linearly independent solutions create a basis for the solution space of the homogeneous equation, just like independent vectors create a basis in geometry or linear algebra π.
How It Fits into Nonhomogeneous Linear Equations
Variation of parameters is one of the two major methods for finding particular solutions of nonhomogeneous linear equations. The other common method is undetermined coefficients.
Undetermined coefficients is fast, but it only works well when $g(x)$ has certain simple forms, such as polynomials, exponentials, sines, cosines, or combinations of these.
Variation of parameters is more flexible. It can handle many forcing functions, including those that involve logarithms, tangent, secant, or more complicated expressions.
That makes it a general-purpose tool in the study of nonhomogeneous equations. In mechanical systems, for example, $g(x)$ may represent an external force or driving function. If that force changes in a complicated way, variation of parameters can still produce a solution model.
For instance, in a mass-spring system, a nonhomogeneous equation might describe forced motion. The homogeneous part describes the natural motion, while the particular solution describes the response caused by the external force. In that setting, variation of parameters helps separate natural behavior from forced behavior.
Common Mistakes and Good Habits
students, here are the most important things to watch for:
- Make sure the differential equation is in standard form $y''+p(x)y'+q(x)y=g(x)$ before using the formulas.
- First solve the homogeneous equation and confirm that $y_1(x)$ and $y_2(x)$ are linearly independent.
- Compute the Wronskian carefully: $W(x)=y_1(x)y_2'(x)-y_1'(x)y_2(x)$.
- Use the correct formulas for $u_1'(x)$ and $u_2'(x)$.
- After integrating, build $y_p(x)=u_1(x)y_1(x)+u_2(x)y_2(x)$.
- Remember that any extra homogeneous terms inside $y_p(x)$ can be absorbed into $y_h(x)$.
A good check is to substitute your final answer back into the original equation. If the left-hand side becomes exactly $g(x)$, your solution is correct β .
Conclusion
Variation of parameters is a flexible method for solving nonhomogeneous linear differential equations. Its key idea is simple: instead of using constant coefficients from the homogeneous solution, let them become functions $u_1(x)$ and $u_2(x)$. With the help of the Wronskian, you can find these functions and build a particular solution.
This method matters because it works beyond the limited cases covered by undetermined coefficients. It connects the homogeneous and nonhomogeneous parts of the equation, and it helps describe real systems with forcing terms, such as vibrations, circuits, and other mechanical applications. When the right-hand side is complicated, variation of parameters is one of the most reliable tools in differential equations.
Study Notes
- A nonhomogeneous linear equation has the form $L[y]=g(x)$ with $g(x)\neq 0$.
- The general solution is $y(x)=y_h(x)+y_p(x)$.
- Variation of parameters starts with homogeneous solutions $y_1(x)$ and $y_2(x)$.
- The trial particular solution is $y_p(x)=u_1(x)y_1(x)+u_2(x)y_2(x)$.
- For $y''+p(x)y'+q(x)y=g(x)$, use
$u_1'(x)=-\frac{y_2(x)g(x)}{W(x)}$ and $u_2'(x)=\frac{y_1(x)g(x)}{W(x)}$.
- The Wronskian is $W(x)=y_1(x)y_2'(x)-y_1'(x)y_2(x)$.
- If $W(x)\neq 0$, the solutions are linearly independent.
- Variation of parameters is more general than undetermined coefficients.
- It is especially useful when $g(x)$ is not a simple polynomial, exponential, sine, or cosine.
- In applications, the homogeneous solution represents natural motion and the particular solution represents forced motion.
