Vectors:
A scalar quantity:
one that has a single value (magnitude) at a particular point in space.
ex:
distance, speed, electric potential.
A vector:
quantity has both magnitude and direction at each point in space.
ex:
position, velocity, electric field.
the set of N vectors e1, e2, ..., n are said to be lienarly independent if
N
⁄i=0a i i 0
Implies that a = a =...= a = 0
1 2 N
In this case the vectors e ipan an N-dimensional vector space, and they can be chosen as the basis
vectors in that space. An arbitrary vector v can therefore be expressed as
v = N v e = v e + v e + ...+ v e
⁄i=1 i i 1 1 2 2 N n
With not all the constants v iqual to zero. With the choice of basis vectors understood, a vector may be
specified by listing its components
v = Hv1, 2 , ...,Nv L
In Mathematica, we specify vectors as lists of their components
In[30]:

[email protected], v, r, sD;
u = 8u1, u2, u3<
v = 8v1, v2, v3<
r = 81, 1, 1<
s = 8-1, -2, 1<
Out[31]=u1, u2, u3<
Out[32]=v1, v2, v3<
Out[33]=1, 1, 1<
Out[34]=-1, -2, 1<
Addition and subtraction of vectors with the same basis vectors is performed by adding or
subtracting their components
Printed by Wolfram Mathematica Student Edition 2 Untitled-1
u + v
In[35]:=
Out[35]=u1 + v1, u2 + v2, u3 + v3<
In[7]:=+ s
Out[7]=0, -1, 2<
In[8]:=- u
Out[8]=-u1 + v1, -u2 + v2, -u3 + v3<
In[9]:=- s
Out[9]=2, 3, 0<
Multiplication of a vector by a scalar, a, simply scales each of the components by a:
In[10]:=* v
Out[10]=a v1, a v2, a v3<
In[11]:=* r
Out[11]=5, 5, 5<
In[12]:=ê 2
1 1
Out[12]=- , -1, >
2 2
There are two types of vector products. The scalar product, also known as the dot product
is:
In[13]:=v
Out[13]=1 v1 + u2 v2 + u3 v3
In[14]:

[email protected], vD
Out[14]=1 v1 + u2 v2 + u3 v3
In[15]:

[email protected], uD
Out[15]=1 v1 + u2 v2 + u3 v3
In[16]:

[email protected], sD
Out[16]=2
The vector product, also known as the cross product is a vector quantity:
In[17]:

[email protected], vD
Out[17]=-u3 v2 + u2 v3, u3 v1 - u1 v3, -u2 v1 + u1 v2<
In[18]:

[email protected], uD
Out[18]=u3 v2 - u2 v3, -u3 v1 + u1 v3, u2 v1 - u1 v2<
Printed by Wolfram Mathematica Student Edition Untitled-1 3
In[19]:

[email protected], sD
83, -2, -1<
Out[19]=
Note:
the dot product is commutative u ·v = v u
the cross product is not, b/c u x v = -v x u.
The magnitude (norm) of a vector is:
In[20]:

[email protected]
Out[20]=

[email protected] +

[email protected] +

[email protected] 2
In[21]:

[email protected]
Out[21]= 6
A unit vector is a vector with magnitude equal to 1. A unit vector in the direction of u is
obtained by dividing each of the compoents by the magnitude u.
The Normalize command dos this:
In[22]:

[email protected]
v1
Out[22]= ,
2 2 2

[email protected] +

[email protected] +

[email protected]
v2 v3
, >
2 2 2 2 2 2

[email protected] +

[email protected] +