Exact Solution of Second Order
Linear Constant Coefficient 
Autonomous Equations

by
K. D.  Stroyan
University of Iowa

copyright 1997 by Academic Press, Inc. - All rights reserved.

Special Mathematica Functions

Needs["Graphics`Colors`"];

Notebook Overview

This NoteBook deals with the specialized, but very important problem:

x[0] == x0,
	x'[0] == y0,
	a x''[t] + b x'[t] + c x[t] == 0

which is studied extensively in Chapter 23 of the text.  The solutions of this equation are linear combinations of the exponential functions

x1[t] = Exp[ r1 t]
	x2[t] = Exp[ r2 t]

where  r1  and  r2  are solutions of the "characteristic equation"

a (r^2) + b r + c == 0

The point of the chapter is that we can reduce solution of the second order equation to the algebra of solving this equation, followed by the algebra of solving for the initial values.

One very important new idea beyond just wallowing in algebra is that when  r1  and  r2  are complex numbers, the exponential solutions can also be written in terms of sine and cosine,

EULER'S FORMULA (in general):

Exp[ a t + I b t ] = Exp[ a t] (Cos[ b t] + I Sin[ b t ])

or

(e^(a t  +  i b t )) =  
        (e^(a t)) 
          (Cos[ b t]  +  i Sin[ b t ])

References to the Text

This NoteBook goes with Chapter 23 and 24 of the text.

Step-by-step

The General Characteristic Equation

Clear[a, b, c, x, t]; charRoots = Solve[a (r^2) + b r + c == 0, r]

An Example with Real Roots

a = 1; b = 1; c = -6; charRoots

One Solution

soln1=DSolve[
		{x[0] == 1,x'[0]==0,a x''[t]+b x'[t]+c x[t]==0},x[t],t]

A Second Solution

soln2=DSolve[
		{x[0] == 0,x'[0]==1,a x''[t]+b x'[t]+c x[t]==0},x[t],t]

A Plot of the Solutions

Plot[x[t] /. soln1, {t, 0, 10}]; Plot[x[t] /. soln2, {t, 0, 10}];

Practice Exercise

The two fundamental solutions of this problem are

x1[t] = Exp[-3 t]
and
	x2[t] = Exp[ 2 t]

Find the initial conditions that we should have given Mathematica in order to have soln1 and soln2 come out with these answers.  Then re-solve and re-plot these solutions.

One Solution

soln1=DSolve[
	{x[0] == ?,
x'[0]==??,
	a x''[t]+b x'[t]+c x[t]==0},x[t],t]

A Second Solution

soln1=DSolve[
	{x[0] == ?,
x'[0]==??,
	a x''[t]+b x'[t]+c x[t]==0},x[t],t]

A Plot of the Solutions

Plot[x[t]/.soln1,{t,0,10}];
Plot[x[t]/.soln2,{t,0,10}];

Repeated Roots

a = 1; b = 2; c = 1;
charRoots

One Solution

soln1 = DSolve[{
x[0]==1,
x'[0]==0,
a x''[t]+b x'[t]+c x[t]==0},x[t],t]

A Second Solution

soln2 = DSolve[{
x[0]==0,
x'[0]==1,
a x''[t]+ b x'[t]+ c x[t]==0},x[t],t]

A Plot of the Solutions

Plot[x[t]/.soln1,{t,0,10}];
Plot[x[t]/.soln2,{t,0,10}];

Practice Exercise

The two fundamental solutions of this problem are

x1[t] = Exp[-t]
and
	x2[t] = t Exp[-t]

Find the initial conditions that we should have given Mathematica in order to have soln1 and soln2 come out with these answers.  Then re-solve and re-plot these solutions.

Complex Roots

a = 1; b = 1; c = 1;
charRoots

One Solution

soln1 = DSolve[{
x[0]==1,
x'[0]==0,
a x''[t]+b x'[t]+c x[t]==0},x[t],t]

A Second Solution

soln2 = DSolve[{
x[0]==0,
x'[0]==1,
a x''[t]+ b x'[t]+ c x[t]==0},x[t],t]

A Plot of the Solutions

Plot[x[t]/.soln1,{t,0,10}];
Plot[x[t]/.soln2,{t,0,10}];

Practice Exercise

The two fundamental solutions of this problem are

x1[t] = Exp[-t/2] Cos[ Sqrt[3] t/2]
and
	x2[t] = Exp[-t/2] Sin[ Sqrt[3] t/2]

Find the initial conditions that we should have given Mathematica in order to have soln1 and soln2 come out with these answers.  Then re-solve and re-plot these solutions.

Combined Computation

\(Clear[a, b, c, x, t]; 
charRoots = Solve[a\ r\^2 + b\ r + c == 0, r]\)a = 1; b = 0; c = 1; charRootssoln=DSolve[{x[0] == 1,x'[0]==0,a x''[t]+b x'[t]+c x[t]==0},x[t],t];
x1[t_]  =  Flatten[x[t] /. soln]soln=DSolve[{x[0] == 0,x'[0]==1,a x''[t]+b x'[t]+c x[t]==0},x[t],t];
x2[t_]  =  Flatten[x[t] /. soln]Plot[{x1[t], x2[t]}, {t, 0, 10}, PlotStyle -> {Red, Blue}];

Exercises

Exercise 23.7.1

Solve the initial value problems

x[0] = 1,
	x'[0] = 1,
	a x''[t] + b x'[t] + c x[t] == 0

For a = 1; b = 0; c = -4;

For a = 1; b = 3; c = 2;

For a = 1; b = 2; c = 2;

For a = 1; b = 2; c = 1;