Tuesday, May 13, 2025

Revisiting the Method Of Variation Of Parameters To Solve Differential Equations

 In variation of parameters, the method entails replacing the constants in the complementary function with undetermined functions of the independent variable, x.   Then determining these latter functions so that when the modified complementary function is substituted into the given differential equation, f(x) will be obtained.  I now proceed in detailed steps of how solutions are obtained. To approach this and be more compact  in notation I make use of differential operators, e.g. D x u  =     du/ dx

The detailed recipe for solving using variation of parameters is then as follows:

a) We will proceed to differentiate y c   to find x y c     e.g.  d y c / dx

In doing so we understand there will appear terms which contain ci'(x).  We always set this combination of terms equal to zero.

b) As we differentiate again, i.e. to find x y c  we again set the resulting combination of terms containing ci'(x) equal to zero.

c) We continue this process through x n-1  y c .

d) We then find xn y c    and substitute all the preceding values into the given differential equation.  Since  is the complementary function, the results of this substitution will contain only the terms of  xn c which appear because all the ci are functions of x.

e) The equations obtained from (d) and the (n-1) conditions imposed via steps a-c then yield a system of n linear equations in the n unknowns ci'(x), (i = 1......n).  This may be solved and integrated to yield the n functions ci(x).

Consider a detailed example and solution below:  

Solve:

d2y/dx 2    + y = tan x

We write the complementary function:

c  = sin x +  c 2  cos x

Assume: yp  = sin x +  v 2  cos x

Where  1 , v 2  will be determined such that this is a particular integral of the original differential equation, e.g.  y" + y  = tan x.   

Then: y'p  =  cos x -  v 2  sin x  +  v' sin x +  v' 2  cos x

Impose the condition that: 

v' sin x +  v' 2  cos x  =  0

ð

y'p  =  cos x -  v 2  sin x 

Then:

y''p  =   - sin x -  v 2  cos x + v'  cos x -  v' 2  sin x  

Subst. back into original DE:   y" + y  = tan x

ð

v'  cos x -  v' 2  sin x  = tan x

Then 2 equations are left from which to determine  v' ,  v' 2:

v' sin x +  v' 2  cos x = 0

v'  cos x -  v' 2  sin x =  tan x

Solving the above simultaneous eqns.:

v' 1  =  sin x

v' 2   =  cos x  - sec x

Integrate:   =   - cos x  +   c 3

v 2  = sin x  - ln |sec x + tan x |  +   c 4

Substitute into:  yp  = sin x +  v 2  cos x

ð

yp  = c sin x +  c 4  cos x - cos x (ln |sec x + tan x 

We now write: 

yp  = A sin x +  B  cos x - cos x (ln |sec x + tan x 

Since we may assign any particular values A, B to the constants: c 3 and c .

Then write: y =  c  +   yp 

ð

y = c sin x +  c 2  cos x  +A sin x +  B  cos x - cos x (ln |sec x + tan x |)

Or:  

y = C sin x +  C 2  cos x  - cos x (ln |sec x + tan x |)

Where:  C 1  =  c    + A,   C 2  =  c 2   + B

Thus we could as well have chosen the constants c 3 and c 4  =  0, for essentially the same result.  I.e. The general solution to the differential equation being:

y = c sin x +  c 2  cos x   - cos x (ln |sec x + tan x |)


Suggested Problem:  

Solve using variation of parameters:

y"  - y  =  2


See for Reference:

And:

And:

Tricks to Solving Higher Order DEs (4): Undetermined Coefficients

No comments: