Linear Methods of Applied Mathematics

Linear Equations and Linear Operators

(c) Copyright 1994-1997 by Evans M. Harrell II and James V. Herod. 
     All rights reserved.

Notes for the instructor.

This contains calculations and examples which correlate with chapter 6 of the WWW text by Harrell and Herod.  Students can be encouraged to cut and paste from this notebook to do homework.

Instructions

This notebook uses Mathematica  to perform calculations for Harrell and Herod's hypertext book, Linear Methods of Applied Mathematics.   The student needs only a basic knowledge of Mathematica  to use the notebook, which is designed both to show how to work problems in the text and to provide a template for using Mathematica  to work other problems of the student's own design.  

Calculations will be performed when the reader presses enter in a given calculation cell (bold print).  It is best to activate the cells in order, so that Mathematica  will be able to call on operators and functions defined in earlier cells.  Red color coding is used to warn the reader when a given calculation relies on an earlier one.

Defining differential operators with Mathematica.

A convenient way to set up differential operators in Mathematica is to define them with the variable being a function name - without the variable [x]. When the operator is applied, be sure to apply it to u[x] with the variable written explicitly.

The operator of eq. (1.1) can be defined as follows:

A[u_] := D[u,{x,2}] + D[u,x] + 2 u

To test it, activate the following cell:

A[u[x]]

Linear operators and matrices

In the text, we make an analogy between linear operators and matrices.  

Open these cells to review the notion of a null space of a matrix

Mathematica  defines a vector as a list of numbers, enclosed in braces {...}.  A matrix, like the one of eq. (1.2), is a list of lists.  Since lists are enclosed in braces, there are two layers of braces:

MM := {{1,-2,1},{1,-2,1},{1,-2,1}}

v := {x,y,z}

The null space of a matrix is the set of vectors which the matrix sends to 0.  To solve for the null space, we can use the Solve command:

Solve[MM.v == {0,0,0}, v]

Alternatively, there is a built-in command for finding the null space:

NullSpace[MM]

Notice that Solve gives a relationship among the components of a vector in 
the null space, but NullSpace produces something else, namely a basis for the previous output.  In order to check, we use the following syntax, where % 
refers to the previous calculation and you need [[...]] to select an entry in a 
double list {{...}}.

%[[1,1]] == 2 %[[1,2]] - %[[1,3]]

%%[[2,1]] ==2 %%[[2,2]] - %%[[2,3]]

Model problem I.9 is to solve the differential equation A[u] = 0. This linear, homogeneous problem is equivalent to finding the null space of the differential operator A.

The equation could be solved with the command DSolve (see below), but to understand it in detail let's do it by making a guess at the form of a solution, u = exp(m x).  We then apply A to the guess:

A[E^(m x)]

Solve[% == 0, m]

Thus two independent solutions, in complex form, are exp(-x/2 ± i Sqrt[7] x/2).  They form a basis of the null space.

Model Problem I.10 is an inhomogeneous matrix problem, using the matrix defined above.

The syntax for solving the problem with Mathematica  is straightforward:

Solve[MM.v == {1,1,1}, v]

Analogously, Model Problem I.11 is an inhomogeneous ordinary differential equation, which can be solved with the command DSolve:

DSolve[A[u[x]] == E^(2 x), u[x],x]