Variation of constants

Variation of constants is the method that produces a particular solution of a non-homogeneous linear ODE without guessing any ansatz.

Consider a linear system of first order with constant coefficients (see system of first order linear ODEs- real case)

X′(t)=AX(t)+F(t),A∈Rn×n

where F(t) is a given function. By superposition, the general solution is

X(t)=Xh(t)+Xp(t)

where Xh is the general solution of the homogeneous system X′=AX and Xp is one particular solution of the full system. (The homogeneous part is a vector space, see solution space of an ODE.)

Let ϕ1,…,ϕn be n linearly independent solutions of X′=AX, collected as columns in the fundamental matrix

Φ(t)=(|||ϕ1ϕ2⋯ϕn|||)

It satisfies Φ′=AΦ and, by construction, detΦ(t)≠0.

Theorem
Let Φ(t) be a fundamental matrix of the homogeneous system X′=AX. Then a particular solution of the non-homogeneous system X′=AX+F is given by

Xp(t)=Φ(t)∫Φ−1(t)F(t)dt

◼

Proof
Guess a particular solution with the shape of a homogeneous one, but let the constants vary with t:

Xp(t)=c1(t)ϕ1(t)+c2(t)ϕ2(t)=Φ(t)c(t)

Observe that

Xp′−AXp=Φ′c+Φc′−AΦc=(Φ′−AΦ)c⏟=0+Φc′=Φc′

The homogeneous part of the ansatz cancels, exactly because Φ was built out of solutions of X′=AX. What survives is Φc′, and the requirement Xp′−AXp=F becomes the ordinary system

Φc′=F⟹c′=Φ−1F⟹c(t)=∫Φ−1(t)F(t)dt

Putting Xp=Φc back gives the formula.◼

Remark

For

y(n)+pn−1(t)y(n−1)+⋯+p0(t)y=r(t)

set X=(y,y′,…,y(n−1))T, so that X′=AX+F with A the companion matrix and F=(0,…,0,r)T. Then detΦ(t) is exactly the Wronskian of the homogeneous basis ϕ1,…,ϕn, and the method is the "variation of parameters" of the scalar literature.