\magnification=\magstep1
\overfullrule=0pt
\centerline{Mathematics 41, section 1 -- Multivariable Calculus}
\centerline{Lab 4 -- Applications of Partial Derivatives}
\centerline{October 7, 1999}
\bigskip
\noindent
{\it Goals}
\bigskip
Today, we will study how Maple can be used to compute partial
derivatives of functions of several variables, and we will look
at two examples of {\it partial differential equations} (or ``PDE'')
that are used to model real-world phenomena such as {\it heat conduction\/}, 
and {\it vibrations of a string\/}.
\bigskip
\noindent
{\it New Maple}
\bigskip
In addition to the graphing routines we have used so far, Maple
also contains extensive facilities for symbolic computation, including
computation of partial derivatives of functions defined by expressions.
The command for this is called {\tt diff}.  The format is 
\medskip
\centerline{\tt diff(expression,variable);}
\medskip
\noindent
For instance, if
we have a function of two variables defined by a command such as the 
following:
\medskip
\centerline{\tt f := (x,y) -> cos(x*y\^{}2 - exp(sin(x)));}
\medskip
\noindent
then we can compute its first order partial derivatives 
${\partial f\over \partial x}$ and ${\partial f\over \partial y}$
using the 
commands {\tt diff(f(x,y),x);} and {\tt diff(f(x,y),y);}, respectively.
Try these and verify the results by hand.  

You can also use {\tt diff} to compute second- and higher-order partial
derivatives.  The ``brute force'' method for this is by ``nesting''.
For example, to compute ${\partial^2 f\over \partial x^2}$,
we could compute {\tt diff(diff(f(x,y),x),x);}, since 
$${\partial^2 f\over \partial x^2} = 
{\partial \over \partial x}\left({\partial f\over \partial x}\right).$$
There is also a shortcut method for computing higher order derivatives.
you can get more information on that by consulting Maple's online
help pages (use: Help/Topic Search on ``diff''.)
\bigskip
\noindent
{\it Lab Problem A}
\bigskip
Use the Maple {\tt diff} command to find all the first and second order
partials of each of the following functions.  Verify the results 
by computing the partial derivatives by hand and comparing with 
Maple's output.  If Maple simplifies its result to a different
form, explain how your answer and Maple's are the same.
\medskip
\item{1)}  $f(x,y) = \arctan(xy) - e^{-(x^2 + y^2)}$.
\item{2)}  $f(x,y) = \cos(\sin(x/y) - xy^2)$
\item{3)}  $f(x,y) = \ln(x - 4^{xy})$
\bigskip
\noindent
{\it Partial Differential Equations -- Heat Conduction and Vibrations of Strings}
\bigskip
Let $u(x,t)$ represent the temperature at position $x$, and time $t$
in a long thin wire extending from $x = 0$ to $x = L$.
Assuming that the lateral surface of the wire is insulated, that the material of 
the wire has constant thermal properties, and that there are no heat sources
in the wire, then it can be shown that the temperature function
satisfies the following relation, called the {\it heat equation}:
$${\partial u \over \partial t} = k {\partial^2 u \over \partial x^2},\leqno(1)$$
where $k$ is a constant called the {\it thermal diffusivity}.  This is 
an example of a ``partial differential equation'' -- a relation between
the partial derivatives of the function $u$.  For example,
$u(x,t) = e^{-kt}\cos(x)$ is a solution of (1), because
$${\partial u \over \partial t} = -k e^{-kt}\cos(x)$$
while 
$${\partial^2 u \over \partial x^2} = - e^{-kt}\cos(x).$$
So ${\partial u \over \partial t} = k {\partial^2 u \over \partial x^2}$.
The partial derivatives can be checked by Maple as above!
\bigskip
\noindent
{\it Lab Problem B}
\bigskip
Verify that each of the following functions satisfies the heat
equation (1) and answer the questions connected with them:
\item{1)} $u_1(x,t) = a x + b$ ($a$, $b$ constant).  What is "special"
about this type of solution?  (What happens to the temperature at 
each $x$ as $t$ changes?)
\item{2)}  $u_2(x,t) = x(x^2 + 6kt)$.
\item{3)}  $u_3(x,t) = e^{-kt} \sin(x)$.
\item{4)}  
$$u_4(x,t) = {1\over \sqrt{t}} e^{-x^2\over 4kt}$$
Note that $u_4$ is not defined at $t = 0$.  Plot $u_4(x,t)$ 
using the {\tt plot3d} command
with $k = 1$ for $x \in [-10,10]$, and $t \in [.01,10]$, and describe
what is happening as $t$ increases. (You may take as known that heat 
energy flows from areas of high temperature to areas of low temperature.) 
What do you think the graph of $\lim_{t\to 0^+} u_4(x,t)$ looks like?  
What does the slice of the graph $z = u_4(x,t)$ in 
the plane $x = 1$ look like?  What does the shape of this slice
mean physically?  Explain.
\bigskip
Let $u(x,t)$ represent the vertical displacement at position $x$, and time $t$
of a long thin string (like a piano or guitar string)
extending from $x = 0$ to $x = \pi$.  Assume the ends of the string are 
fixed, but the rest of it can vibrate. It can be shown that the displacement
function
satisfies the following relation, called the {\it wave equation}:
$${\partial^2 u \over \partial t^2} = 
c^2 {\partial^2 u \over \partial x^2},\leqno(2)$$
where $c$ is a constant.  This is another
example of a ``partial differential equation'' -- a relation between
the partial derivatives of the function $u$.
\bigskip
\noindent
{\it Lab Problem C}
\bigskip
Verify that each of the following functions satisfies the wave equation (2)
and answer the accompanying questions:
\item{1)} $u_m(x,t) = \sin(m x)\cos(m c t)$, and 
$v_m(x,t) = \sin(m x)\sin(m c t)$, where $m\ge 1$ is any integers.
\item{2)}  Show that the following ``linear combination'' of 
$u_m(x,t)$ and $v_m(x,t)$  also satisfies the wave equation (2):
$$u(x,t) = u_1(x,t) + 4 v_3(x,t) - 3 u_4(x,t) = 
\sin(x)\cos(ct) + 4\sin(3x)\sin(3ct) - 3\sin(4x)\cos(4ct).$$
This combination might represent a particular motion of a vibrating 
string.
\item{3)}  Take $c = 1$, and plot the linear combination from part 2
using {\tt plot3d}.  Explain the motion of the vibrating string
by taking the vertical slices of the graph in planes defined by $t = $ constant.
\bigskip
\noindent
{\it Assignment}
\bigskip
Individual write-ups due in class on Friday, October 15.
\bye



