= Variation of parameters
{title2=$y_p=-y_1\int y_2r/W+y_2\int y_1r/W$}
{wiki}
= Variation of constants
{synonym}
Variation of parameters replaces the constants in a complementary solution by functions to construct a particular solution.
For the <inhomogeneous linear differential equation> $y''+py'+qy=r$, assume $p,q,r$ are <continuous functions> on an <interval> $I$, and $y_1,y_2$ are <linearly independent> <homogeneous solutions> there. With $W=W(y_1,y_2)$ and $x_0\in I$, <variation of parameters> constructs the <particular solution>
$$
y_p(x)=-y_1(x)\int_{x_0}^x\frac{y_2(s)r(s)}{W(s)}\,ds+y_2(x)\int_{x_0}^x\frac{y_1(s)r(s)}{W(s)}\,ds.
$$
The <Wronskian> has no zeros on $I$, so these quotients are defined. For $Ay''+By'+Cy=F$, normalize first: $r=F/A$, not $F$.<NIST Digital Library of Mathematical Functions/1 Algebraic and Analytic Methods>[NIST Digital Library of Mathematical Functions; §1.13(iii), equations 1.13.8–1.13.10: normalized inhomogeneous equation and variation-of-parameters formula]{ref}
To derive the formula, write $y_p=u_1y_1+u_2y_2$ and impose $u_1'y_1+u_2'y_2=0$. This auxiliary choice removes extra terms from the first <derivative>. Substitution into the <inhomogeneous linear differential equation> leaves $u_1'y_1'+u_2'y_2'=r$. The two <linear equations> for $u_1',u_2'$ have <determinant> $W$, and <Cramer's rule> gives
$$
u_1'=-\frac{y_2r}{W},\qquad u_2'=\frac{y_1r}{W}.
$$
Integrating from $x_0$ makes $y_p(x_0)=y_p'(x_0)=0$. Arbitrary integration constants contribute only <homogeneous solutions>; adding $c_1y_1+c_2y_2$ supplies the <general solution>.
For a worked example, use the same <homogeneous solutions> $e^{-x},e^{2x}$ and the <forcing term> $r=6e^{3x}$ in $y''-y'-2y=6e^{3x}$. With $x_0=0$ and $W=3e^x$,
$$
u_1'=-2e^{4x},\qquad u_2'=2e^x,\qquad u_1=-\tfrac12(e^{4x}-1),\qquad u_2=2(e^x-1).
$$
Consequently the <particular solution> selected by zero <initial conditions> is
$$
y_p(x)=\tfrac32e^{3x}+\tfrac12e^{-x}-2e^{2x}.
$$
Its value and first <derivative> vanish at zero. Direct substitution confirms the <forcing term>: the <differential operator> $L[y]=y''-y'-2y$ annihilates the last two terms and maps $e^{3x}$ to $4e^{3x}$. The two integrals therefore build a response from known <homogeneous solutions>, even when the <forcing term> has no convenient elementary guess.
Back to article page