\chapter{Summary of Maple Commands}\label{C:Maple_Appendix}

\noi Here is a list of Maple commands used at various points in this text, organized by package name. Each command is accompanied by a brief explanation of its syntax as well as an example. To learn more about a particular command, type \mf{?command name} at the command prompt. To load a particular package, type \mf{with(\emph{package name})}.


%*************************************************************
%*******************Functions****************************
%*************************************************************
\textbf{Functions}\index{Maple!\mf{functions}}

\be

\item \mf{f:=x-> \ma{expression involving x}:}

\noi Constructs a function named \mf{f},
whose rule is governed by the given \ma{expression}.

    \newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{f:=x->x\^{}2 -x;}

    \mo{f:= x\rightarrow x^2-x}
    \item \mf{f(3);}
    \mo{6}
    \end{maplelist}

Functions of more than one variable are similarly defined.

    \newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{f:=(x1,x2)-> x1\^{}2 -x2\^{}2;}

    \mo{ f:=(x_1,x_2)\rightarrow x_1^2-x_2^2}
    \item \mf{f(2,1);}
    \mo{3}
    \end{maplelist}


Piecewise-defined functions can be entered via the \mf{piecewise}\index{Maple!\mf{piecewise}} command, whose
general form is
\newline
\begin{center}
\mf{piecewise(\ma{cond1,expr1,...,condn,
exprn,expr\_otherwise})},
\end{center}
where each condition corresponds to the expression immediately following it.
The conditions are expressed as inequalities and Boolean combinations thereof.

\noi
\emph{Example:}
\begin{maplelist}
\item \mf{f:=x->piecewise(x<=0,-x\^{}2, x>0 and x<=2,x\^{}2, 0);}
\mo{f:=x->piecewise(x< 0,-x^2,x > 0 \mbox{ and } x\leq 2, x^2,0)}
\end{maplelist}

\noi
Defines the function $f$, whose output equals $-x^2$ for negative inputs, $x^2$ for inputs
between 0 and 2, inclusive, and 0 otherwise.

\newpar
The \mf{unapply}\index{Maple!\mf{unapply}} command defines functions as well.

      \newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{f:=unapply(x1\^{}2 -x2\^{}2,[x1,x2]);}

    \mo{f:=(x_1,x_2)\rightarrow x_1^2-x_2^2}
    \end{maplelist}



 \ee

 %*************************************************************
 %*******************Plot Structures****************************
 %*************************************************************

\textbf{Plot Structures}
 \be

%*******************Plot and Plot3d****************************

 \item \mf{plot(\ma{expression,interval,options});}

 \noi Plots\index{Maple!\mf{plot}} an \ma{expression} of a single variable over
 the specified interval using prescribed \ma{options}, such as graph color, etc.

 \newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{f:=x->x\^{}2:}
 \item \mf{plot(f(x),x=-1..3,color=red);}

 \noi Plots the function $f(x)=x^2$ in red
 on the interval $[-1,3]$
 \end{maplelist}

 \newpar
 For a complete list of \mf{plot} options, type \mf{?plot[options]} at the command prompt.

\item \mf{plot3d(\ma{expression,plot region, options});}

 \noi Plots\index{Maple!\mf{plot3d}} an \ma{expression} in two variables using specified
 \ma{plot region} and \ma{options}, which dictate surface type, color, etc.

 \newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{f:=(x1,x2)->x1*x2:}
 \item \mf{plot3d(f(x1,x2),x1=0..2,x2=-2..2,style=wireframe,
 \newline color=blue);}

 \noi Plots the function $f(x_1,x_2)=x_1x_2$ in blue, wireframe style on the region $0 \leq x_1 \leq 2$
     and $-2 \leq x_2 \leq 2$.
 \end{maplelist}

\newpar
 For a complete list of \mf{plot3d} options, type \mf{?plot3d[options]} at the command prompt.


 %*******************Implicitplot****************************

 \item \mf{implicitplot(\ma{relation,options});}

 \noi Plots\index{Maple!\mf{implicitplot}} a \ma{relation} in two variables using specified \ma{options}, which dictate
 plot region, color, etc.

 \newpar
    \emph{Example:}
    \begin{maplelist}
 \item \mf{implicitplot(x1\^{}2-x2\^{}2=1,x1=-5..5,x2=-5..5,color=green,\newline thickness=3);}

     \noi Plots the relation $x_1^2-x_2^2=1$ in green, thickness level 3 on the region $-5 \leq x_1 \leq 5$
     and $-5 \leq x_2 \leq 5$.
 \end{maplelist}

 %*******************ContourPlot****************************

 \item \mf{contourplot(\ma{relation,options});}

 \noi Creates\index{Maple!\mf{contourplot}} a contour plot of an \mf{expression} in two variables using specified \mf{options}, which dictate plot region, color, contour values, etc.

 \newpar
    \emph{Example:}
    \begin{maplelist}
 \item \mf{contourplot(x1\^{}2-x2\^{}2,x1=-5..5,x2=-5..5,color=blue,\newline contours=[-2,-1,0,1,2]);}

     \noi Creates blue contour plot on the region $-5 \leq x_1 \leq 5$
     and $-5 \leq x_2 \leq 5$ of the expression $z=x_1^2-x_2^2$ using $z$ values of $z=-2,-1,0,1,2$.
 \end{maplelist}

 %*******************Inequal****************************

 \item \mf{inequal(\ma{inequalities,options});}

 \noi Plots\index{Maple!\mf{inequal}} the region in the plane consisting of points
 that satisfy the given inequalities. The inequalities must be linear, allow for
 equality,
 and should be enclosed within brackets and separated by commas. The options
 dictate the plot region, the color of the region satisfying the inequalities, (\mf{optionsfeasible}), the color of the boundary of the region, (\mf{optionsclosed}),
 and the color of the points not satisfying at least one inequality, (\mf{optionsexcluded}).
 This command is contained in the \mf{plots} package.

 \newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{with(plots):}
 \item \mf{inequal([x1+x2 <= 3, x2 >= x1], x1 = 0 .. 5, x2 = 0 .. 5, optionsfeasible = (color = red), optionsclosed = (color = green), optionsexcluded = (color = yellow));}

     \noi Plots in red the set of points, $(x_1,x_2)$, that satisfy the
     inequalities, $x_1+x_2 \leq 3$ and $x_2\geq x_1$ and that belong to the plot region
     $0 \leq x_1 \leq 5$
     and $0 \leq x_2 \leq 5$. The boundary of the region is colored green, and the points
     not satisfying at least one inequality are colored yellow.
 \end{maplelist}

 \newpar
This command also has coloring options for situations when at least one inequality is strict, i.e., involves $<$ or $>$ as opposed to $\leq$ or $\geq$.


 %*******************Pointplot****************************

  \item \mf{pointplot(\ma{list\_of\_points,options});}

 \noi Plots\index{Maple!\mf{pointplot}} the specified \ma{list\_of\_points} using specified \ma{options}. Each point should consist of two numbers,
 separated by commas and enclosed within brackets. Then these points themselves
 are separated by commas and enclosed within brackets again. Options permit specifying
 the point color, the point symbol, (asterisk, box, circle, cross, diagonalcross, diamond, point, solidbox, solidcircle, soliddiamond), and the size of this symbol, whose default
 value is 15. This command is contained in the \mf{plots} package.

 \newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{with(plots):}
 \item \mf{pointplot([[-1,3],[0,0],[3,7]],symbol=box,symbolsize=20);}

     \noi Plots, as red boxes, the ordered pairs, $(-1,3)$, $(0,0)$, and $(3,7)$.
     The size of the symbol is slightly larger than the default value.
 \end{maplelist}

 \newpar
A similar command, \mf{pointplot3d}, exists for pointing points in $\R^3$.

 %*******************Display****************************

 \item \mf{display(\ma{plot structures,options});}

 \noi Superimposes\index{Maple!\mf{display}} on a single set of axes, the given \mf{plot structures}, all of which belong to $\R^2$ or all of which belong to $\R^3$, using the specified
 \mf{options}. The plot structures themselves must be separated by commas and
 enclosed within brackets or braces.

 \newpar
 This command, which is located in the \mf{plots} package, is frequently used to superimpose different plot structures that have been previously created and assigned different names.

 \newpar
    \emph{Example:}
   \begin{maplelist}
    \item \mf{with(plots):}
 \item \mf{graph1:=pointplot([[-1,3],[0,0],[3,7]],symbol=box):}
 \item \mf{graph2:=inequal([x1+x2 <= 3, x2 >= x1], x1 = 0 .. 5, 
 \newline x2 = 0 .. 5, optionsfeasible = (color = red), 
 \newline optionsclosed = (color = green), optionsexcluded 
 \newline = (color = yellow)):}
 \item \mf{display([graph1,graph2],axes=framed);}

 \noi Displays the superposition of the set of points specified by \mf{graph1}, along with the region specified by \mf{graph2}.
 \end{maplelist}



 \ee

%*************************************************************
 %*******************Conditional Statements and Loops****************************
 %*************************************************************
\newpage
\textbf{Basic Programming Structures}\index{Maple!basic programming structures}

 \be

 \item \mf{if \ma{condition} then \ma{statement 1} else \ma{statement 2} end if:}

 \noi Performs \ma{statement 1} provided \ma{condition} is true and \ma{statement 2} otherwise.

 \newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{a:=5:}
 \item \mf{if a > 2 then x:=5 else x:=0 end if:}
 \item \mf{x;}
 \mo{5}
 \end{maplelist}

 \item \mf{for \ma{index} from \ma{start} to \ma{finish} by \ma{change} do \ma{statement} end do:}

 \noi Perform \ma{task} specified by \ma{statement}
 using index value \ma{index}, which varies from \ma{start} to \ma{finish} in increments of \ma{change}.

 \newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{for i from 0 to 20 by 5 do print(i) end do;}
    \mo{0}
    \mo{5}
    \mo{10}
    \mo{15}
    \mo{20}
    \end{maplelist}

\item \mf{while \ma{condition} do \ma{statement} end do:}

 \noi Performs \ma{statement} so long as \ma{condition} is true.

 \newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{a:=5:}
 \item \mf{while a < 8 do a:=a+1: print(a): end do:}
 \mo{6}
 \mo{7}
 \mo{8}
 \end{maplelist}

\newpage
\item \mf{proc(\ma{arguments}) local \ma{variables1}: global \ma{variables2}: \ma{task}:
\newline \mf{RETURN}(\ma{output}): end:}

 \noi Performs\index{Maple!procedures (\mf{proc})} programming procedure using input \ma{arguments}. Local variables
 are internal to the procedure and cannot be accessed outside of it; global variables are
 accessible outside the procedure. The procedure returns \ma{output}.

 \newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{PowerCounter:=proc(number, value) local i:global n:
    \newline
    n:=0:
    for i from 0 to 5 do if number\^{}i <= value then 
    \newline n:=n+1: end if:
    \newline
    RETURN(n):
    \newline end:}
    \item PowerCounter(2,33);
    \mo{5}
    \end{maplelist}

 \noi Procedure for determining the number of powers of \mf{number} that
 are less than or equal to \mf{value}, where the powers vary from 0 to 5.


\ee

%*************************************************************
 %*******************Arrays and Lists****************************
 %*************************************************************

\textbf{Arrays and Lists}
 \be

 \item \mf{array(i..j,m..n);}

 \noi Creates\index{Maple!\mf{array}} an array in two integer indices, with the first index ranging from \mf{i}
 to \mf{j} and the second from \mf{m} to \mf{n}.

  \newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{A:=array(0..2,1..3);}
    \mo{array(0..2,1..3,[])}

 \end{maplelist}

 \newpar
 Array entries are frequently assigned values using looping structures.

  \newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{A:=array(0..2,1..3);}
    \item \mf{for i from 0 to 2 do for j from 1 to 3 do 
    \newline A[i,j]:=i+j:od:od:}

 \noi Creates an array, \mf{A}, consisting of 9 entries, where the indices
 vary from 0 to 2 and 1 to 3, respectively. Each entry is the sum of the two
 corresponding indices. For example, $A[0,2]=2$.
 \end{maplelist}

 \item \mf{[\ma{list-entries}];}

 \noi Creates an ordered list\index{Maple!lists} using \ma{list-entries}. The values of \ma{list-entries} must be separated by commas. Values in the list can be extracted using subscripts; the commands \mf{nops}\index{Maple!\mf{nops}} determines the size of the list, and \mf{op}\index{Maple!\mf{ops}} removes the outer brackets.

  \newpar
    \emph{Examples:}
    \begin{maplelist}
    \item \mf{L:=[1,2,4,8,16,32]:}
    \item \mf{L[3];}
    \mo{4}

    \item \mf{nops(L);}
    \mo{6}

    \item \mf{op(L);}

    \mo{1,2,4,8,16,32}
    \item \mf{L:=[blue,red,black,green]:}
    \item \mf{L[3];}
    \mo{black}

    \item \mf{nops(L);}
    \mo{4}

    \item \mf{op(L);}

    \mo{blue,red,black,green}
 \end{maplelist}



 \ee

%*************************************************************
 %*******************Sequences and Sums****************************
 %*************************************************************

 \textbf{Sequences, Sums, and Products}
 \be

 \item \mf{seq(\ma{expression},\ma{index}=\ma{start} to \ma{finish});}

 \noi Creates\index{Maple!\mf{seq}} a sequence of values that results when the integer index value \ma{index},
  which varies between \ma{start} and \ma{finish}, is substituted
 into \ma{expression}.

\newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{seq(3\^{}i,i=-2..3);}

    \mo{ \frac{1}{9}, \frac{1}{3}, 1, 3, 9, 27}

 \end{maplelist}

\item \mf{sum(\ma{expression},\ma{index}=\ma{start} to \ma{finish});}

\noi Computes\index{Maple!\mf{sum}} a closed form for the sum that results when the integer \ma{index} is substituted into \ma{expression}, where \ma{index} varies from \ma{start} to \ma{finish} and the resulting sequence of
values are added together.

\newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{sum((1/2)\^{}i,i=0..infinity);}

    \mo{2}
    \end{maplelist}

\item \mf{add(\ma{expression},\ma{index}=\ma{start} to \ma{finish});}

\noi Computes\index{Maple!\mf{add}} the explicit sum that results when the integer \ma{index} is substituted into \ma{expression}, where \ma{index} varies from \ma{start} to \ma{finish} and the resulting sequence of
values are added together.

\newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{add(2\^{}i,i=-2..6);}

    \mo{ \frac{511}{4}}
    \end{maplelist}


\item \mf{product(\ma{expression},\ma{index}=\ma{start} to \ma{finish});}

\noi Computes\index{Maple!\mf{product}} the explicit product that results when the integer \ma{index} is substituted into \ma{expression}, where \ma{index} varies from \ma{start} to \ma{finish} and the resulting sequence of
values are multiplied together.

\newpar
    \emph{Example:}
    \begin{maplelist}
    \item \mf{product(2\^{}i,i=1..3);}

    \mo{64}
    \end{maplelist}

 \ee


%*************************************************************
%*******************Linear Algebra ****************************
%*********************
\textbf{Linear Algebra}

\noi Commands in this section are contained in the \mf{Linear Algebra} package.

\be

%*******************Vectors****************************
\item \mf{Vector(\ma{entries})}:\index{Maple!\mf{Vector}}

\noi Constructs a vector having components given by \ma{entries}. The entries should be separated by commas and enclosed with brackets. By default, Maple assumes a vector is a column vector. To enter a row vector instead, type \mf{Vector[row](\emph{entries})}.

    \newpar
 \emph{Examples:}
    \begin{maplelist}
    \item \mf{with(LinearAlgebra):}
    \item \mf{Vector([1,2]);}

    \mo{ \begin{bmatrix} 1 \\ 2 \end{bmatrix}}
    \item \mf{Vector[row]([1,2]);}

    \mo{\begin{bmatrix} 1 & 2 \end{bmatrix}}
    \end{maplelist}

    \noi
    Alternatively, a column vector can be entered using $<$, $>$, notation, e.g., \mf{<1,2>}.

 %************************Matrices

\item \mf{Matrix(\ma{m,n,entries});}\index{Maple!\mf{Matrix}}

\noi Constructs an \ma{m}-by-\ma{n} matrix having using prescribed \ma{entries}, which are read by rows. The object \ma{entries} should be separated by commas and enclosed with brackets.

\newpar
 \emph{Example:}
  \begin{maplelist}
  \item \mf{with(LinearAlgebra):}
  \item \mf{Matrix(2,3,[1,4,5,-3,2,5]);}

  \mo{ \begin{bmatrix} 1 & 4 & 5 \\ -3 & 2 & 5 \end{bmatrix}}
   \end{maplelist}


\noi Alternatively, a matrix can be entered by combining vectors and using the symbols
$<$ and $>$. Two vectors are augmented using $|$ and stacked with a comma.

\noi \emph{Example:}
  \begin{maplelist}
  \item \mf{with(LinearAlgebra):}
  \item \mf{v1:=<2,3>:}
  \item \mf{v2:=<-4,0>:}
  \item \mf{<v1|v2>;}

  \mo{ \begin{bmatrix} 2 & -4 \\ 3 & 0 \end{bmatrix}}
  \item \mf{<v1,v2>;}

  \mo{\begin{bmatrix} 2 \\ 3 \\ -4 \\ 0 \end{bmatrix}}
    \end{maplelist}

%*****************Euclidean Norm
\newpage

\item \mf{Norm(\ma{column vector},Euclidean);}

\noi
Computes the Euclidean norm of \mf{vector}, which is entered as a column vector
using $<$, $>$, notation or a Matrix.

\newpar
 \emph{Example:}
  \begin{maplelist}
  \item \mf{with(LinearAlgebra):}
  \item \mf{u:=<3,4>:}
  \item \mf{Norm(u,Euclidean);}
  \mo{5}
  \item \mf{v:=Matrix(2,1,[3,4]):}
\item \mf{Norm(v,Euclidean);}
  \mo{5}
   \end{maplelist}


\noi Note: Maple's \mf{VectorCalculus} package also contains a \mf{Norm}\index{Maple!\mf{Norm}}
command, which accepts a row vector as its argument, as opposed to
a column vector. Because of this fact, and for the sake of uniformity, when
using both packages, we
always load the \mf{LinearAlgebra} package {\underbar{second}}.

%************************Zero Matrices and Vectors

\item \mf{ZeroMatrix(\ma{m,n});}\index{Maple!\mf{ZeroMatrix}}

\noi Constructs an \ma{m}-by-\ma{n} zero matrix; Similarly,
\mf{ZeroVector(\ma{m});} constructs a column vector with \ma{m} entries.

\newpar
 \emph{Example:}
  \begin{maplelist}
  \item \mf{with(LinearAlgebra):}
  \item \mf{ZeroMatrix(2,3);}

  \mo{ \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}}
   \end{maplelist}


%************************Identity Matrices

\item \mf{IdentityMatrix(\ma{m});}\index{Maple!\mf{IdentityMatrix}}

\noi Constructs an \ma{m}-by-\ma{m} identity matrix.

\newpar
 \emph{Example:}
  \begin{maplelist}
  \item \mf{with(LinearAlgebra):}
  \item \mf{IdentityMatrix(2);}

  \mo{ \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}}
   \end{maplelist}

%************************Unit Vector

\item \mf{UnitVector(\ma{m,n});}\index{Maple!\mf{UnitVector}}

\noi Constructs a column vector in $\R^n$ having an entry
of 1 in component \ma{m} and a zero in all other components.

\newpar
 \emph{Example:}
  \begin{maplelist}
  \item \mf{with(LinearAlgebra):}
  \item \mf{UnitVector(2,4);}

  \mo{\begin{bmatrix} 0 \\ 1 \\ 0 \\0 \end{bmatrix}}
   \end{maplelist}

%************************Diagonal Matrix

\item \mf{DiagonalMatrix(\ma{entries});}\index{Maple!\mf{DiagonalMatrix}}

\noi Constructs a square, diagonal matrix using \ma{entries} along the diagonal. The entries should be separated by commas and enclosed with brackets.

\newpar
 \emph{Example:}
  \begin{maplelist}
  \item \mf{with(LinearAlgebra):}
  \item \mf{DiagonalMatrix([1,3,-5]);}

  \mo{\begin{bmatrix} 1 & 0 & 0 \\ 0 & 3 & 0 \\ 0 & 0 & -5 \end{bmatrix}}
   \end{maplelist}

%************************Extract rows and columns

\item \mf{Row(\ma{M,m});}\index{Maple!\mf{Row}}

\noi Extracts, as a row vector, row \ma{m} of the matrix
    \ma{M}. Likewise, \mf{Column(\ma{M,m})} extracts, as a column vector, column \ma{n} of the matrix \ma{M}.

\newpar
 \emph{Example:}
 \begin{maplelist}
 \item \mf{with(LinearAlgebra):}
  \item \mf{A:=Matrix(2,3,[1,4,5,-3,2,5]);}
  \mo{\begin{bmatrix} 1 & 4 & 5 \\ -3 & 2 & 5 \end{bmatrix}}
 \item \mf{Row(A,2);}

 \mo{ \begin{bmatrix} -3 & 2 & 5\end{bmatrix}}
    \end{maplelist}

 %************************Row Operations

\item \mf{RowOperation(\ma{M,operation});}\index{Maple!\mf{RowOperation}}

\noi Performs a specified row operation, dictated by
\ma{operation}, on the
matrix \ma{M}. There are three such operations.

\begin{maplelist}
\item \mf{RowOperation(\ma{M,j,k});}

\noi Multiplies row
\ma{j} of \ma{M} by \ma{k}.
\item \mf{RowOperation(\ma{M},[\ma{i,j}]);}

\noi Interchanges rows \ma{i}
 and \ma{j} of \ma{M}.
\item \mf{RowOperation(\ma{M},[\ma{i,j}],\ma{k});}

\noi Adds  \ma{k}
times row \ma{j} to \ma{i}.
\end{maplelist}

\newpar
\emph{Example:}
 \begin{maplelist}
 \item \mf{with(LinearAlgebra):}
  \item \mf{A:=IdentityMatrix(3);}
  \mo{\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 &1 \end{bmatrix}}
 \item \mf{RowOperation(A,3,4);}

 \mo{ \begin{bmatrix} 1 & 0 & 0 \\
 0 & 1 & 0 \\
 0 & 0 & 4
 \end{bmatrix}}

 \item \mf{RowOperation(A,[1,3]);}

 \mo{\begin{bmatrix} 0 & 0 & 1 \\
 0 & 1 & 0 \\
 1 & 0 & 0
 \end{bmatrix}}

 \item \mf{RowOperation(A,[1,3],-2);}

 \noi Produces the matrix,
 \mo{\begin{bmatrix} 1 & 0 & -2 \\
 0 & 1 & 0 \\
 0 & 0 & 1
 \end{bmatrix}}

\end{maplelist}
Note: The option, \ma{inplace=true}, replaces the value of the matrix with that obtained
by performing the specified row operation. For example, \mf{RowOperation(\ma{M},[\ma{1,2}], \ma{inplace=true})} interchanges rows 1 and 2 of \ma{M} and overwrites the value of \ma{M} with
this new matrix.

%************************Pivot

\item \mf{Pivot(\ma{M,i,j});}\index{Maple!\mf{Pivot}}

\noi Pivots on the entry in row \ma{i}, column
 \ma{j} of the matrix
    \ma{M}.

\newpar
 \emph{Example:}
 \begin{maplelist}
 \item \mf{with(LinearAlgebra):}
  \item \mf{A:=Matrix(3, 3, [1, 4, 5, -3, 2, 5, 7, 0, -1]);}
  \mo{\begin{bmatrix} 1 & 4 & 5 \\ -3 & 2 & 5 \\ 7 & 0 & -1 \end{bmatrix}}
 \item \mf{Pivot(A,1,3);}

 \mo{\begin{bmatrix} 1 & 4 & 5 \\ -4 & -2 & 0 \\ \frac{36}{5} & \frac{4}{5} & 0 \end{bmatrix}}
    \end{maplelist}

%************************Row and Column Dimension

\item \mf{RowDimension(\ma{M});}

\noi Determines the row dimension of the matrix
    \ma{M}. Likewise, 
    \newline \mf{ColumnDimension(\ma{M});} determines the column
    dimension of \ma{M}.

\newpar
 \emph{Example:}
 \begin{maplelist}
 \item \mf{with(LinearAlgebra):}
  \item \mf{A:=Matrix(2,3,[1,4,5,-3,2,5]):}
 \item \mf{RowDimension(A)}

\mo{2}
 \item \mf{ColumnDimension(A)}

\mo{3}
    \end{maplelist}

%************************RREF and REF

\item \mf{GaussianElimination(\ma{M});}

\noi Performs Gaussian elimination
on the matrix  \ma{M} and produces the row echelon form.

\item \mf{ReducedRowEchelonForm(\ma{M});}

\noi Computes the reduced row
echelon form of \ma{M} .

\item \mf{LinearSolve(\ma{A,b,t});}

\noi Solve the matrix equation \ma{Ax=b}, specifying any free variables be labeled using \ma{t} along
with appropriate subscripts.

\newpar
 \emph{Example:}
\begin{maplelist}
\item \mf{A:=Matrix(3,3,[1,1,-1,2,1,1,3,1,3]);}
\mo{A:=\begin{bmatrix} 1 & 1 & -1 \\ 2 & 1 & 1 \\ 3 & 1 & 3 \end{bmatrix}}
\item \mf{b:=<2,1,0>;}
\mo{b:= \begin{bmatrix} 2 \\ 1 \\ 0 \end{bmatrix}}
\item \mf{LinearSolve(A,b,free=t);}
\mo{\begin{bmatrix} -1-2t_3 \\ 3+3t_3 \\ t_3 \end{bmatrix}}
\end{maplelist}
%************************Determinant

\item \mf{Determinant(\ma{M});}\index{Maple!\mf{Determinant}}

\noi Computes
the determinant of the matrix \ma{M}.

%************************Inverse

\item \mf{MatrixInverse(\ma{M});}\index{Maple!\mf{MatrixInverse}}

\noi Calculates
the inverse of the matrix \ma{M}. If the matrix is not invertible, an error message
is returned.

%************************Eigenvalues

\item \mf{Eigenvalues(\ma{M});}:\index{Maple!\mf{Eigenvalues}}

\noi Calculates
the eigenvalues of the matrix \ma{M}.

%************************Eigenvectors

\item \mf{Eigenvectors(\ma{M});}

\noi Calculates
the eigenvectors and corresponding eigenvalues of the matrix \ma{M}. The eigenvalues
are returned as a column vector, and the eigenvectors as corresponding
columns in a matrix.

\newpar
 \emph{Example:}
 \begin{maplelist}
 \item \mf{with(LinearAlgebra):}
  \item \mf{A:=Matrix(3,3,[1, 0, 0, 2, 3, 0, 4, 5, 3]):}
 \item \mf{Eigenvectors(A)}
 \mo{ \begin{bmatrix} 1 \\ 3 \\ 3 \end{bmatrix}, \begin{bmatrix} 2 & 0 & 0 \\ -2 & 0 & 0 \\ 1 & 1 & 0 \end{bmatrix} }

 \noi Thus, the matrix \mf{A} has eigenvectors
 $\ds \begin{bmatrix} 2 \\ -2 \\ 1 \end{bmatrix}$ (corresponding eigenvalue of 1) and
 $\ds \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}$ (corresponding repeated eigenvalue of 3).
\end{maplelist}

 %************************IsDefinite

 \item \mf{IsDefinite(\ma{M,'query'=q});}\index{Maple!\mf{IsDefinite}}

 \noi Tests whether the matrix \ma{M} is
 positive (semi-) definite, negative (semi-) definite, or indefinite. The returned
 value is \emph{true} or \emph{false}, and the parameter
 \ma{q} specifies the matrix form to be determined. Choices
 for \ma{q} consist of \ma{'positive\_definite'},
 \ma{'positive\_semidefinite'},
 \ma{'negative\_definite'}, \ma{'negative\_semidefinite'}, and \mf{'indefinite'}.

\noi
 If the matrix has symbolic
 entries, the command returns conditions on these entries for which \ma{q} is
 satisfied.

\newpar
 \emph{Examples:}
 \begin{maplelist}
 \item \mf{with(LinearAlgebra):}
  \item \mf{A:=Matrix(3,3,[1, 0, 0, 2, 3, 0, 4, 5, 3]):}
 \item \mf{IsDefinite(A,'query'='positive\_definite')}

 \mo{false}
  \item \mf{A:=Matrix(3,3,[1, 0, 0, 2, 3, 0, 4, 5, x]):}
 \item \mf{IsDefinite(A,'query'='positive\_semidefinite');}

 \mo{ 0 \leq -\frac{33}{4} + 2x \mbox{ and }
 0 \leq -\frac{33}{4} + 4x \mbox{ and }
 0 \leq 4 +x }

 \end{maplelist}

\ee

%*************************************************************
%*******************Excel Tools ****************************
%*********************
\textbf{Importing Spreadsheet Data}

\noi This command is contained in the \mf{Exceltools} package.\index{Maple!\mf{ExcelTools}}

\be
\item \mf{Import(``\ma{directory\\filename.xls}'', ''sheetname'',''cellrange'')}:


\noi Imports cells \ma{cellrange}, from worksheet, \ma{sheetname}, of the Excel file, \ma{filename.xls},
located in \ma{directory}. All command arguments are contained in quotation marks, and the data itself
is imported into an array, which can then be converted to a \mf{Matrix} and/or \mf{Vector}
structure.

\newpar
 \emph{Example:}
 \begin{maplelist}
 \item \mf{with(ExcelTools):}
 \item \mf{A:=convert(Import(''c\\file.xls'', ''sheet1'', ''A1:D5''),Matrix):}
\item \mf{B:=convert(Import(''c\\file.xls'', ''sheet1'', ''E1:E5''),Vector):}
 \end{maplelist}

\ee

%*************************************************************
%*******************Excel Tools ****************************
%*********************
\textbf{Basic Statistics Commands}

\noi Commands in this section are contained in the \mf{Statistics} package.

\be
\item \mf{Mean}(\ma{L}):\index{Maple!\mf{Mean}}

\noi Computes the mean value of the entries in the list, \ma{L}.

\item \mf{Variance(\ma{L})}:\index{Maple!\mf{Variance}}

\noi Computes the variance of the entries in the list, \ma{L}.


\newpar
 \emph{Example:}
 \begin{maplelist}
 \item \mf{with(Statistics):}
 \item \mf{L:=[1,2,3,4,5]:}
 \item \mf{Mean(L);}
 \mo{3}
 \item \mf{Variance(L);}
 \mo{2.5}
 \end{maplelist}

\ee


%*************************************************************
%*******************Optimization ****************************
%*********************
\textbf{Linear and Nonlinear Optimization}

\noi Commands in this section are contained in the \mf{Optimization} package.

%*******************LPSolve****************************

\be

\item \mf{LPSolve(\ma{expression, constraints,options})}

\noi Solves\index{Maple!\mf{LPSolve}}
 the linear programming problem consisting of
objective, \ma{expression}, subject to the entries of \ma{constraints}.
The quantity \ma{expression} must be linear in the decision variables, and
\ma{entries} must consist of linear inequalities in the decision variables, separated
by commas and enclosed within brackets. The command permits a variety of \ma{options},
which can specify whether the objective is to be minimized or maximized (the default
goal is minimization), can dictate sign restrictions on decision variables, and
can require one or more decision variables to be integer-valued in the solution. The output
of the command is a list, with the first entry given by the optimal objective value and the second as a vector specifying the corresponding decision variable values.


\newpar
 \emph{Examples:}
 \begin{maplelist}
 \item \mf{with(Optimization):}
 \item \mf{LPSolve(-4*x1-5*x2, [x1+2*x2<=6, 5*x1+4*x2<=20], assume= \newline nonnegative);}
 \mo{ \left[ -19, [x_1=2.6666,x_2=1.6666] \right]}
 \item \mf{LPSolve(-7*x1+2*x2, [4*x1-12*x2 <= 20, -x1+3*x2 <= 3], \newline assume = 'nonnegative', maximize);}
 \mo{\left[2,[x_1=0,x_2=1]\right]}
 \item \mf{LPSolve(3*x1-2*x2, [x1-2*x2 <= 5, -x1+3*x2 <= 3, x1 >= 2], assume = integer);}
 \mo{\left[4,[x_1=2,x_2=1]\right]}
 \item \mf{LPSolve(x1-2*x2, [x1-2*x2 <= 5, -x1+3*x2 <= 3, x1 >= 0], assume = binary);}
 \mo{\left[-2,[x_1=0,x_2=1]\right]}

 \end{maplelist}

\noi
The \mf{LPSolve} command has several other options in addition to those given above.

%*******************LPSolve Matrix Form****************************

\item \mf{LPSolve(\ma{c}, [\ma{A,b}],\ma{options});}

\noi The matrix form\index{Maple!\mf{LPSolve}-matrix form}
 of the \mf{LPSolve} command in which the
LP consists of minimizing \ma{c}$\vecx$ subject
to \ma{A}$\vecx \leq$\ma{b} and the prescribed \ma{options}.
The quantities \ma{c} and \ma{b} are vectors, and
\ma{A} is a matrix whose dimensions are such that the matrix
 vector product, \ma{A}$\vecx$,  is well defined and has the same number of entries as
 \ma{b}.
The output
of the command is a list, with the first entry given by the optimal objective value and the second as a vector representing $\vecx$

\newpar
 \emph{Example:}
 \begin{maplelist}
 \item \mf{with(Optimization):}
 \item \mf{c:=Vector[row]([-7,2]);}
 \mo{c=[-7,2]}
 \item \mf{b:=<20,3>;}
 \mo{b=\begin{bmatrix} 20 \\ 3 \end{bmatrix}}
 \item \mf{A:=Matrix(2,2,[4,-12,-1,3]);}
 \mo{A=\begin{bmatrix} 4 & -12 \\ -1 & 3 \end{bmatrix}}
 \item \mf{LPSolve(c, [A,b], assume = nonnegative,'maximize');}
 \mo{\left[2,\begin{bmatrix} 0 \\ 1 \end{bmatrix}\right]}
 \end{maplelist}

%*******************NLPSolve****************************

\item \mf{NLPSolve(\ma{expression, constraints,options})}\index{Maple!\mf{NLPSolve}}


\noi Similar to the \mf{LPSolve} command, \mf{NLPSolve}
minimizes \ma{expression}, subject to \ma{constraints}, which
consists of a list of inequalities. Both \ma{expression} and
any particular constraint, are permitted to be nonlinear
in the decision variables. The advanced numeric method used by Maple to execute
this command generally returns a local optimal solution. However, if the
problem is convex, this local optimal solution is a global optimal solution as well.

\newpar
 \emph{Example:}
 \begin{maplelist}
 \item \mf{with(Optimization):}
 \item \mf{NLPSolve(x1\^{}2+x2\^{}2+3*x2, [x1\^{}2+x2\^{}2 <= 3, x1-x2 <= 4], 
 \newline assume = nonnegative, 'maximize');}
 \mo{\left[8.19615242273757792, [x_1=0,x_2 = 1.73205080757366470]\right]}
 \end{maplelist}


%*******************QPSolve****************************

\item \mf{QPSolve(\ma{quadratic expression, constraints,options})}\index{Maple!\mf{QPSolve}}


\noi A special case of the \mf{NLPSolve} command is \mf{QPSolve}, which
solves quadratic programming problems.
In this situation, the objective, \ma{quadratic expression}, is
quadratic in the decision variables. Each entry of \ma{constraints} takes the form
of a linear or nonlinear inequality.
\newpage
\newpar
 \emph{Example:}
 \begin{maplelist}
 \item \mf{with(Optimization):}
 \item \mf{QPSolve(x1\^{}2+x2\^{}2+3*x2, [x1+x2 <= 3, x1-x2 <= 4]);}
 \mo{\left[-2.25, [x_1 = 0, x_2 = -1.5]\right]}
 \end{maplelist}


\item \mf{QPSolve([\ma{p,Q}],[\ma{C,d,A,b}],\ma{options});}

\noi This is the matrix form of the QPSolve command, which solves the quadratic programming problem
of minimizing $\ds \frac{1}{2}\vecx^t \mbox{\ma{Q}} \vecx +\mbox{\ma{p}}^t\vecx$ subject to the linear constraints, $\mbox{\ma{A}}\vecx = \mbox{\ma{b}}$ and
$\mbox{\ma{C}}\vecx \leq \mbox{\ma{d}}$. Note that \ma{p}, \ma{b}, and \ma{d} must be entered
as vectors and not as matrices. In addition, if only \ma{C} and \ma{d} are listed within the brackets, Maple
assumes they correspond to the linear inequalities. If the problem involves equality constraints
only, constraints are given by \mf{[\ma{NoUserValue,NoUserValue,A,b}]}.

\newpar
 \emph{Examples:}
 \begin{maplelist}
 \item \mf{with(Optimization):}
 \item \mf{Q:=Matrix(2,2,[2,1,1,3]):}
 \item \mf{p:=<5,-3>:}
    \item \mf{C:=Matrix(2,2,[1,0,0,3]):}
 \item \mf{d:=<3,0>:}
 \item \mf{A:=Matrix(2,2,[4,2,2,1]):}
 \item \mf{b:=<6,3>:}
 \item \mf{QPSolve([p,Q],[C,d,A,b]);}
 \mo{\left[9.75, \begin{bmatrix} 1.5 & 0 \end{bmatrix}\right]}
\item \mf{QPSolve([p,Q],[C,d]);}
 \mo{\left[-6.25, \begin{bmatrix} -2.5 & 0 \end{bmatrix}\right]}
\item \mf{QPSolve([p,Q],[NoUserValue,NoUserValue,A,b]);}
 \mo{\left[3.70, \begin{bmatrix} .4 & 2.2 \end{bmatrix} \right]}
 \end{maplelist}

\ee

%*************************************************************
%*******************Vector Calculus ****************************
%*********************
\textbf{Vector Calculus}

\noi Commands in this section are contained in the \mf{VectorCalculus} package.


%*******************Gradient****************************

\be

\item \mf{Gradient(\ma{expression, variables})}\index{Maple!\mf{Gradient}}


\noi Calculates the gradient vector of the multivariable \ma{expression} with
respect to the variables prescribed by \mf{variables}. The quantity \ma{variables}
consists of comma separated variables enclosed within brackets. The output of the command
is expressed in terms of unit vectors corresponding to each variable. Each such
vector takes the form $\vece_{\mbox{variable}}$

\newpar
 \emph{Example:}
 \begin{maplelist}
 \item \mf{with(VectorCalculus):}
 \item \mf{Gradient(x1\^{}2+2*x1*x2,[x1,x2]);}
 \mo{(2x_1+2x_2)\bar{e}_{x1} + 2x_1\bar{e}_{x2} }
 \end{maplelist}

\item \mf{Jacobian(\ma{expressions, variables})}\index{Maple!\mf{Jacobian}}


\noi Calculates the Jacobian matrix of the multivariable \ma{expressions} with
respect to the variables prescribed by \ma{variables}. The quantity \ma{expressions} consists of comma-separated expressions enclosed within brackets, and \ma{variables}
consists of comma-separated variables enclosed within brackets. The output of the command
is expressed as a matrix.

\newpar
 \emph{Example:}
 \begin{maplelist}
 \item \mf{with(VectorCalculus):}
 \item \mf{Jacobian([x1\^{}2+2x1*x2,4x2\^{}2-3x1*x2] ,[x1,x2]);}
 \mo{\begin{bmatrix} 2x_1+2x_2 & 2x_1 \\ -3x_2 & 8x_2-3x_1 \end{bmatrix} }
 \end{maplelist}

\item \mf{Hessian(\ma{expression, variables})}\index{Maple!\mf{Hessian}}


\noi Calculates the Hessian matrix of the multivariable \mf{expression} with
respect to the variables prescribed by \mf{variables}. The quantity \mf{variables}
consists of comma separated-variables enclosed within brackets.

\newpar
 \emph{Example:}
 \begin{maplelist}
 \item \mf{with(VectorCalculus):}
 \item \mf{Hessian(x1\^{}2+2*x1*x2,[x1,x2]);}
 \mo{\begin{bmatrix} 2 & 2 \\ 2 & 0 \end{bmatrix}}
 \end{maplelist}

\ee

