Higher Order Equations

Wronskian

Compute the Wronskian of the functions
a) E^t, E^(-t), E^(2t), E^(-2t)
b) 1, t, Cos[t], Sin[t]

Solution

m ={{ E^t, E^(-t), E^(2t),  E^(-2t) },
    { E^t,-E^(-t),2E^(2t),-2E^(-2t) },
    { E^t, E^(-t),4E^(2t), 4E^(-2t) },
    { E^t,-E^(-t),8E^(2t),-8E^(-2t) }};

Det[m]

w[f1_,f2_,f3_,f4_] :=Det[
{{  f1,         f2,         f3,         f4       },
 {D[f1,t],    D[f2,t],    D[f3,t],    D[f4,t]    },
 {D[f1,{t,2}],D[f2,{t,2}],D[f3,{t,2}],D[f4,{t,2}]},
 {D[f1,{t,3}],D[f2,{t,3}],D[f3,{t,3}],D[f4,{t,3}]}}]

w[E^t, E^(-t), E^(2t),  E^(-2t)]

w[1,t,Cos[t],Sin[t]]

Simplify[%,Trig->True]

Finding n-th roots

Find the 6th roots of -4 and plot them.

Solution

Solve[z^6 == -4]

N[%]

p = {Re[z], Im[z]} /. %

ListPlot[p, AspectRatio->1]

"By hand" :  -4 = 4 (Cos[Pi+2m Pi] + I Sin[Pi+2m Pi])

q = Table[{4^(1/6)Cos[Pi/6 + 2 m Pi/6], 4^(1/6)Sin[Pi/6 + 2 m Pi/6]},
		{m, 0, 5}]

ListPlot[q, AspectRatio->1]

Solving Linear Differential Equations

Find the general solution to

L[f_]:= D[f,{t,5}] - 3D[f,{t,4}] + 3D[f,{t,3}] - 3D[f,{t,2}] + 2D[f,t]

L[y[t]] == 0

Plot a few solutions.

Solution

Using DSolve[]:

Clear[t,y]

DSolve[L[y[t]] == 0, y[t], t]

L[y[t] /. First[%]]

Simplify[%]

Using Characteristic Polynomial:

Factor[r^5 - 3r^4 + 3r^3 - 3r^2 + 2r]

Solve[r^5 - 3r^4 + 3r^3 - 3r^2 + 2r==0]

Solutions are: y1 == 1, y2 == E^t, y3 == E^(2t), y4 = Cos[t], y5 == Sin[t]

General soution is

y = c1 + c2 E^t + c3 E^(2t) + c4 Cos[t] + c5 Sin[t];

g = Flatten[ Table[y /.c3->0, {c1,-1,1},{c2,0,1},{c4,0,1},{c5,0,1}]]

Plot[Evaluate[g],{t,-Pi,Pi}]

Example

Solve the initial value problem
	y''''[t] - 4 y'''[t] + 4y''[t] == 0,
	y[1]==-1, y'[1]==2, y''[1]== 0, y'''[1]==0

Solution

In one step:

Clear[t,y]

DSolve[{y''''[t] - 4 y'''[t] + 4y''[t] == 0,
    y[1]==-1, y'[1]==2, y''[1]== 0, y'''[1]==0}, y[t],t]

Step by step: First find the general solution.

Factor[r^4 - 4r^3 + 4r^2]

Solve[r^4 - 4r^3 + 4r^2==0]

Because of repeated roots the general solution is:

y[t_] = c1 + c2 t + c3 E^(2t) + c4 t E^(2t);

eqns = {y[1]==-1, y'[1]==2, y''[1]== 0, y'''[1]==0}

Solve[eqns]

Specific solution to the initial value problem is thus:

y[t_] = y[t] /. First[%]

Method of Undetermined Coefficients for Non-homogeneous, Constant Coefficient, Linear Differential Equations
    L[y[t]] == g[t]

Idea: For simple functions g[t] we can "guess" the form of particular solution.

Example

Find the general solution of

y''''[t] - y'''[t] == Sin[2t]

Solution

Clear[t,y]

DSolve[y''''[t] - y'''[t]==Sin[2t],y[t],t]

Step by step: First solve the homogeneous equation

L[f_] := D[f,{t,4}] - D[f,{t,3}];
L[y[t]] == 0

Solve[r^4 - r^3 == 0]

The general solution of the homogeneous equation is thus

yc = c1 + c2 t + c3 t^2 + c4 E^t;

L[yc]

To find  a particular solution L[yp] = Sin[2t]try

yp = a Cos[2t] + b Sin[2t];

L[yp]

To get Sin[2t] we must choose a and b such that

eqns = {16 a +  8 b == 0,
        -8 a + 16 b == 1};

Solve[eqns]

yp = yp /. First[%]

The general solution of the original equation is then

y = yc + yp

Example

Find the general solution of

y''''[t] - y[t] == 3t + Cos[t]

Solution

Clear[t,y]

DSolve[y''''[t] - y[t] == 3t + Cos[t], y[t], t]

Step by step: First solve the homogeneous equation

Clear[t,y]

L[f_] := D[f,{t,4}] - f;
L[y[t]] == 0

Solve[r^4 - 1 == 0]

The general solution of the homogeneous equation is

yc = c1 E^t + c2 E^(-t) + c3 Cos[t] + c4 Sin[t]

L[yc]

To find a particular solution, L[yp] == 3 t + Cos[t] try

yp = a t + b Cos[t] + c Sin[t];

L[yp]

The Cos[t] and Sin[t] terms vanish because they satisfy L[y[t]] == 0. To get a particular solution to "survive" the linear operator L multiply Cos[t] and Sin[t] by t:

yp = a t + b t Cos[t] + c t Sin[t];

L[yp]

To get 3 t + Cos[t] take

{a -> -3, c -> -1/4, b -> 0};

The general solution of the original equation is thus

y[t_] = yc + yp /. %

Example

Find the general solution of

y'''[t] - 2y''[t] + y'[t] == t^3 + 2 E^t

Solution

Clear[t,y]

DSolve[y'''[t] - 2y''[t] + y'[t] == t^3 + 2 E^t, y[t], t]

Step by step: First solve the homogeneous equation

L[f_] := D[f,{t,3}] - 2D[f,{t,2}] + D[f,t]

L[y[t]] == 0

Solve[r^3 - 2r^2 + r == 0]

The solution of the homogeneous equation is thus

yc = c1 + c2 E^t + c3 t E^t;

To find a particular solution to  L[y] == t^3 + 2 E^t try

yp = a + b t + c t^2 + d t^3 + k E^t;

L[yp] //Simplify

We cannot solve for the constants to make this equal t^3 + 2 E^t. The reason:

{L[t], L[t^2], L[t^3], L[E^t], L[t E^t]}//Simplify

The linear operator L lowers the degree of any polynomial it acts on by one because r == 0 is a root of the characteristic equation. To make the polynomial "survive" L to the correct degree we need to start with a polynomial of 4th degree. Also, since L[E^t] == 0, L[t E^t] == 0, we need to try t^2 E^t instead of just E^t or t E^t in order for the function to "survive" L and produce a term like E^t.

yp = t(a + b t + c t^2 + d t^3) + k t^2 E^t;

L[yp] //Simplify

To make this equal t^3 + 2E^t, choose the constants so that

eqns = {a - 4b + 6 c == 0,
                 2 k == 2,
   2 b - 12 c + 24 d == 0, 
          3 c - 24 d == 0,
                 4 d == 1};

Solve[eqns]

yp = yp /. First[%]

The general solution is thus

y[t_] = yc + yp

General Rules

Let P_m[t] be a given polynomial of degree m, and let Q_m[t], R_m[t] stand for general polynomials of degree m.

g[t] == P_m[t]
  yp == t^s Q_m[t]
   s == number of times 0 is a root of the characteristic equation

g[t] == P_m[t] E^(a t)
  yp == t^s Q_m[t] E^(a t)
   s == number of times a is a root of the characteristic equation


g[t] == P_m[t] E^(a t)(Sin[b t] or Cos[b t])
  yp == t^s E^(a t)(Q_m[t]Cos[b t]+R_m[t]Sin[b t])
   s == number of times a + I b is a root of the characteristic equation