Prof. Vladimir Dobrushkin
Department of Mathematics

 MTH243 (Calculus for Functions of Several Variables) SAGE. Chapter 13: Vectors Vladimir A. Dobrushkin,Lippitt Hall 202C, 874-5095,dobrush@uri.edu In this course we will use Sage computer algebra system (CAS), which is a free software. The Sage projects are created to help you learn new concepts. Sage is very useful in visualizing graphs and surfaces in three dimensions. Matlab (commercial software) is also available at engineeering labs. Its free version is called Octave. The university has a license for computer algebra system Mathematica, so it is free to use for its students. A student can also use free CASs: SymPy (based on Python), or Maxima.

## Section 13.1. Displacement Vectors

In engineering and mathematics, it is a custom to represent vectors as columns, which are denoted by lower case letters in bold font. Operation of transformation column vecors as rows is called transposition and denoted by letter "T" or prime. In some cases and areas such as probablity, row vectors are used. To distinguish row vectors from column vectors, we write an arrow above the vector, so
${\bf v}^T = \vec{v} = [\,a, b, c \,] .$

Vectors in the Wolfram Language are represented as lists, written and displayed horizontally. For example, the column vector

${\bf v} = \begin{bmatrix} a \\ b \\ c \end{bmatrix}$
where a, b, and c could be any expressions, numerical or algebraic, would be entered and named via the command
v = {a, b, c}
Therefore, Mathematica does pay attention whether a vector is a column vector or a row vector. To specify the column vector, one should define it as a matrix
v = {{a}, {b}, {c}}
Vector addition and scalar multiplication are then very natural. If u and v are two lists of equal length, then
$3{\bf u} + (-2){\bf v}$

will compute the correct vector and return it as a list. If u and v have different sizes, then Mathematica will complain about “objects of unequal length.”

figure
p1 = [0 0 0];
p2 = [2 0 0];
p3 = [2 2 0];
p4 = [0 2 0];

x = [p1(1) p2(1) p3(1) p4(1)];
y = [p1(2) p2(2) p3(2) p4(2)];
z = [p1(3) p2(3) p3(3) p4(3)];

fill3(x, y, z, 1);
xlabel('x'); ylabel('y'); zlabel('z');
title('13.35 Parallelogram')

figure
X = [0;1;1;0;0];
Y = [0;0;1;1;0];
Z = [0;0;0;0;0];
figure;
hold on;
plot3(X,Y,Z);
plot3(X,Y,Z+1);
set(gca,'View',[-28,35]);
for k=1:length(X)-1
plot3([X(k);X(k)],[Y(k);Y(k)],[0;1]);
end
title('Figure 13.48')

We plot boxes:
Graphics3D[{Cuboid[{0, 0, 0}, {2, 3, 4}]}]
\[ScriptCapitalR] = Parallelepiped[{0, 0, 0}, {{1, 0, 0}, {1, 1, 0}, {0, 1, 1}}]; {Graphics3D[{Yellow, \[ScriptCapitalR]}], Graphics3D[{EdgeForm[Thick], Red, \[ScriptCapitalR]}], Graphics3D[{Opacity[0.25], Blue, \[ScriptCapitalR]}], Graphics3D[{EdgeForm[Directive[Thick, Dotted]], FaceForm[None], \[ScriptCapitalR]}]}
Graphics3D[{Opacity[0.25], {Cuboid[{0, 0, 0}, {2, 3, 1}]}}]

## Section 13.2. Vectors in General

Two individuals played a key role in the creation of modern vector analysis. They were an American scientist Josiah Willard Gibbs from Yale, Connecticut, and an English self-taught electrical engineer, mathematician, and physicist Oliver Heaviside (1850--1925), who independently developed the system that is almost universally taught at the present time.

## Section 13.3. The Dot Product

Dot product is found in 1901 in Vector Analysis by J. Willard Gibbs (1839--1903) and his former student Edwin Bidwell Wilson (1879--1964).

## Section 13.4. The Cross Product

Example 1. Plotting the Graph of the Function $$F (x, y) = x^2+y^2$$
Plot3D[(x^2 + y^2), {x, -3, 3}, {y, -3, 3}, Axes -> True, PlotStyle -> Green]

Now we create a new graph: $$g (x, y) = x^2 + y^2 + 3$$
Plot3D[(x^2 + y^2 + 3), {x, -3, 3}, {y, -3, 3}, Axes -> True]
Another graph of $$h(x, y) = 5 - x^2 - y^2$$
Plot3D[(5 - x^2 - y^2), {x, -3, 3}, {y, -3, 3}, Axes -> True, PlotStyle -> Orange]
One more: $$k (x, y) = x^2 + (y - 1)^2$$
Plot3D[(x^2 + (y - 1)^2), {x, -3, 3}, {y, -3, 3}, PlotStyle -> None]
Example 2. Plotting the Graph of the Function $$G(x,y)=e^{-(x^2+y^2)}$$
Plot3D[(E^-(x^2 + y^2)), {x, -5, 5}, {y, -5, 5}, PlotStyle -> Opacity[.8]]
Cross Sections and the Graph of a Function where x=2
Plot3D[{(x^2 + y^2), (4 + y^2)}, {x, -3, 3}, {y, -3, 3}]