HERBERT SPENCER 1820—1903
Evolution…is——a change from an indefinite, incoherent homogeneity,
to a definite coherent heterogeneity.
First Principles (1862), ch.16, 138

Nonhomogeneous Equations, Undetermined Coefficients

Steve Dunbar

Department of Mathematics and Statistics
University of Nebraska-Lincoln
Lincoln, NE 68588-0323
sdunbar@mathlab01.unl.edu

Math 221H, Fall 1993

Covers Nagle & Saff, Sections 4.8, 6.4

The Method of Undetermined Coefficients: Example 1

The goal is to solve a non-homogeneous differential equation 
	
	y'' + 25 y  = 10 cos(7 t)
	y(0) = 0
	y'(0) = 0
	
with the method of undetermined coefficients:

Step 1:  Find the solution of the corresponding homogeneous equation

hsoln = DSolve[ y''[t] + 25 y[t] == 0, y[t], t]

yh = First[ y[t] /. hsoln]

Step 2: Apply annihilator and solve expanded equation

L[f_] := Expand[ D[f,{t,2}] + 49*f]

bigeqn = L[y''[t] + 25*y[t]]  ==  L[Sin[7*t] ]

DSolve[ bigeqn, y[t], t]

Step 3: Identify particular solution and find undetermined coefficients

yp = A Cos[7 t] + B Sin[ 7 t]

D[yp, {t, 2}] + 25 yp

Simplify[%]

uceqns = {-24 A  == 10, -24 B == 0}

Solve[uceqns, {A,B}]

y = yh + yp /. %

y = First[y]

Determine arbitrary coefficients from initial conditions

ic1 = ( y /. t -> 0) == 0

ic2 = ( D[y, t] /. t -> 0) == 0

Solve[ {ic1, ic2}, {C[1], C[2]}]

y = y /. %

y = First[%]

Plot[ y, {t, 0, 10}]

The Method of Undetermined Coefficients: Example 2

The goal is to solve a  very similar non-homogeneous differential equation 
	
	y'' + 25 y  = 10 cos(5 t)
	y(0) = 0
	y'(0) = 0
	
with the method of undetermined coefficients:  The results will be very different
and the differences are important!

Clear[ y,t, hsoln, L, f, bigeqn, yp, A, B,]

Step 1:  Find the solution of the corresponding homogeneous equation

hsoln = DSolve[ y''[t] + 25 y[t] == 0, y[t], t]

yh = First[ y[t] /. hsoln]

Step 2: Apply annihilator and solve expanded equation

L[f_] := Expand[ D[f,{t,2}] + 25*f]

bigeqn = L[y''[t] + 25*y[t]]  ==  L[Sin[5*t] ]

Solve[ r^4 + 50*r^2 + 625 == 0, r]

DSolve[ bigeqn, y[t], t]

Step 3: Identify particular solution and find undetermined coefficients

yp = A*t*Cos[5 t] + B*t*Sin[ 5 t]

D[yp, {t, 2}] + 25 yp

Simplify[%]

uceqns = {-10 A  == 0, 10 B == 10}

Solve[uceqns, {A,B}]

y = yh + yp /. %

y = First[y]

Simplify[ D[y, {t,2}] + 25*y]

Determine arbitrary coefficients from initial conditions

ic1 = ( y /. t -> 0) == 0

ic2 = ( D[y, t] /. t -> 0) == 0

Solve[ {ic1, ic2}, {C[1], C[2]}]

y = y /. %

y = First[%]

Plot[ y, {t, 0, 10}]

Exercise

Solve the non-homogeneous, second-order, initial value problem:
	
	y'' + 25 y = t cos(5 t)
	y(0) = 0
	y'(0) = 0
	
	Notice that because of the structure of the right side, the annihilator will have to be
	(D2 + 25)2