Differential Equations

Brown University Applied Mathematics


Variation of Parameters

To solve any non-homogeneous solution, we will need to add the homogeneous solution to the particular solution. The method of Undetermined Coefficients is an easy way to find the particular solution for your final answer. The steps to following this method are generally:

  1. Calculate the Wronskian W(t) between all of your homogeneous solutions (discussed in the section on Operators and Linear independence)
  2. Solve for the particular equation in the form $y_{p} = -y1(t)\int \frac{y2(t)f(t)}{W(t)}dt +y2(t)\int \frac{y1(t)f(t)}{W(t)}dt$

  3. Simplify your answer if needed
  4. Add the particular equation to the homogeneous equation to obtain the full solution.

MuPAD Examples

Solve the equation y''-3y'-18y=t

 

Homogeneous Solution

reset()

eq1 := y''(x)-3*y'(x) -18*y(x)

(D@@2)(y)(x) - 3*D(y)(x) - 18*y(x)

char_eq1 := r^2 -3*r-18

r^2 - 3*r - 18

rsol := solve(%, r)

{-3, 6}

y1(x) := exp(rsol[2]*x)

exp(6*x)

y2(x) := exp(rsol[1]*x)

exp(-3*x)

homog := C1*y1(x)+C2*y2(x)

C2*exp(-3*x) + C1*exp(6*x)

 

Particular Solution

f(x) := x

x

wronskian(x) := y1(x)*diff(y2(x), x) - (diff(y1(x), x)*y2(x))

-9*exp(3*x)

partic := -y1(x)*int((y2(x)*f(x)/wronskian(x)),x) + y2(x)*int((y1(x)*f(x)/wronskian(x)),x)

1/108 - x/18

 

Final Solution

fullsol := homog+partic

C2*exp(-3*x) - x/18 + C1*exp(6*x) + 1/108

 

Solve the equation y''+y=1+tan(x) where -pi/2 < x < pi/2

 

Homogeneous Solution

reset()

eq1 := y''(x)+y(x)

(D@@2)(y)(x) + y(x)

char_eq1 := r^2 +1

r^2 + 1

rsol := solve(%, r)

{-I, I}

y1(x) := exp(rsol[2]*x)

exp(x*I)

y2(x) := exp(rsol[1]*x)

exp(-x*I)

homog := C1*y1(x)+C2*y2(x)

C1*exp(x*I) + C2*exp(-x*I)

 

Particular Solution

assume(x < PI/2)

assume(x > -PI/2)

f(x) := 1+tan(x)

tan(x) + 1

wronskian(x) := y1(x)*diff(y2(x), x) - (diff(y1(x), x)*y2(x))

-2*I

partic := -y1(x)*int((y2(x)*f(x)/wronskian(x)),x) + y2(x)*int((y1(x)*f(x)/wronskian(x)),x)

exp(-x*I)*(exp(x*I)*(1/2 + (- I/2)) + arctan(exp(x*I))*I) + exp(x*I)*(exp(-x*I)*(1/2 + I/2) - arctan(exp(-x*I))*I)

simplify(%)

1 - exp(x*I)*arctan(exp(-x*I))*I + exp(-x*I)*arctan(exp(x*I))*I

furtherSimplified := 1-cos(x)*ln(sec(x)+tan(x))

1 - cos(x)*ln(tan(x) + 1/cos(x))

 

Final Solution

fullsol := homog+furtherSimplified

1 + C1*exp(x*I) + C2*exp(-x*I) - cos(x)*ln(tan(x) + 1/cos(x))


Home

< Previous

Next >