Variation of Parameters — Theory
1. Standard normalized form
Variation of parameters is used for non-homogeneous second-order linear differential equations.
The standard normalized form is:
\[
y''+P(x)y'+Q(x)y=G(x).
\]
The method assumes that the coefficient of \(y''\) is \(1\). If the original equation has another coefficient,
divide the whole equation by that coefficient first.
2. Associated homogeneous equation
First, ignore the non-homogeneous term \(G(x)\). This gives the associated homogeneous equation:
\[
y''+P(x)y'+Q(x)y=0.
\]
Suppose two independent solutions of the homogeneous equation are:
\[
y_1(x),
\qquad
y_2(x).
\]
Then the homogeneous solution is:
\[
y_h=C_1y_1+C_2y_2.
\]
3. Main idea of variation of parameters
Instead of using constant coefficients \(C_1\) and \(C_2\), variation of parameters replaces them with functions:
\[
y_p=u_1(x)y_1(x)+u_2(x)y_2(x).
\]
The goal is to find \(u_1(x)\) and \(u_2(x)\) so that \(y_p\) solves the non-homogeneous equation.
4. Wronskian
The Wronskian of \(y_1\) and \(y_2\) is:
\[
W=y_1y_2'-y_1'y_2.
\]
The Wronskian measures whether \(y_1\) and \(y_2\) are independent.
If \(W\ne 0\), then the two functions form a valid fundamental pair.
5. Variation-of-parameters formulas
For the normalized equation
\[
y''+P(x)y'+Q(x)y=G(x),
\]
the auxiliary functions satisfy:
\[
u_1'=-\frac{y_2G}{W},
\qquad
u_2'=\frac{y_1G}{W}.
\]
Therefore:
\[
u_1=-\int\frac{y_2G}{W}\,dx,
\qquad
u_2=\int\frac{y_1G}{W}\,dx.
\]
6. Particular solution
Substitute \(u_1\) and \(u_2\) into
\(y_p=u_1y_1+u_2y_2\). This gives:
\[
y_p
=
-y_1\int\frac{y_2G}{W}\,dx
+
y_2\int\frac{y_1G}{W}\,dx.
\]
The general solution is:
\[
y=C_1y_1+C_2y_2+y_p.
\]
7. Applying initial conditions
If initial conditions are given,
\[
y(x_0)=y_0,
\qquad
y'(x_0)=v_0,
\]
then \(C_1\) and \(C_2\) can be found by substituting \(x=x_0\) into the solution and its derivative.
In the calculator, the variation integrals start at \(x_0\), so the particular contribution begins from zero there.
8. Worked example: \(y''+y=\tan x\)
Solve:
\[
y''+y=\tan x.
\]
The associated homogeneous equation is:
\[
y''+y=0.
\]
A fundamental pair is:
\[
y_1=\cos x,
\qquad
y_2=\sin x.
\]
Compute the Wronskian:
\[
W
=
y_1y_2'-y_1'y_2
=
\cos x\cos x-(-\sin x)\sin x
=
\cos^2x+\sin^2x
=
1.
\]
Since \(G(x)=\tan x\), the formulas give:
\[
u_1'=-\sin x\tan x,
\qquad
u_2'=\cos x\tan x.
\]
The second derivative simplifies immediately:
\[
u_2'=\sin x,
\qquad
u_2=-\cos x.
\]
For \(u_1\):
\[
u_1'=-\frac{\sin^2x}{\cos x}
=
\cos x-\sec x.
\]
Therefore:
\[
u_1=\sin x-\ln|\sec x+\tan x|.
\]
Now:
\[
y_p=u_1\cos x+u_2\sin x.
\]
Substitute:
\[
y_p=
\cos x\left(\sin x-\ln|\sec x+\tan x|\right)
-\sin x\cos x.
\]
The \(\sin x\cos x\) terms cancel:
\[
y_p=-\cos x\ln|\sec x+\tan x|.
\]
The general solution is:
\[
y=C_1\cos x+C_2\sin x-\cos x\ln|\sec x+\tan x|.
\]
9. Why the Wronskian matters
The formulas for \(u_1'\) and \(u_2'\) divide by \(W\).
If \(W=0\), the two homogeneous solutions are not independent, and the method cannot be used with that pair.
\[
u_1'=-\frac{y_2G}{W},
\qquad
u_2'=\frac{y_1G}{W}.
\]
So always check \(W\ne 0\) before using the formulas.
11. Common mistakes
- Forgetting to normalize: the coefficient of \(y''\) must be \(1\).
- Using the wrong \(G(x)\): after normalizing, the right side may change.
- Choosing dependent \(y_1,y_2\): the Wronskian must not be zero.
- Mixing signs: \(u_1'\) has the negative sign, \(u_2'\) does not.
- Forgetting the homogeneous part: the final answer is \(y_h+y_p\), not only \(y_p\).
- Confusing \(u_1,u_2\) with constants: they are functions of \(x\), not fixed constants.
- Ignoring singularities: functions like \(\tan x\) and \(\sec x\) are only valid on intervals where they are defined.
- Ignoring graph units: axis tick labels should show numerical values together with units.