# Calculus/Vectors
## Two-Dimensional Vectors
### Introduction

In most mathematics courses up until this point, we deal with scalars. These are quantities which only need one number to express. For instance, the amount of gasoline used to drive to the grocery store is a scalar quantity because it only needs one number: 2 gallons.
In this unit, we deal with vectors. A vector is a directed line segment -- that is, a line segment that points one direction or the other. As such, it has an initial point and a terminal point. The vector starts at the initial point and ends at the terminal point, and the vector points towards the terminal point. A vector is drawn as a line segment with an arrow at the terminal point:
The same vector can be placed anywhere on the coordinate plane and still be the same vector -- the only two bits of information a vector represents are the magnitude and the direction. The magnitude is simply the length of the vector, and the direction is the angle at which it points. Since neither of these specify a starting or ending location, the same vector can be placed anywhere. To illustrate, all of the line segments below can be defined as the vector with magnitude $4{\sqrt {2}}$ and angle 45 degrees:
It is customary, however, to place the vector with the initial point at the origin as indicated by the black vector. This is called the standard position.

### Component Form

In standard practice, we don't express vectors by listing the length and the direction. We instead use component form, which lists the height (rise) and width (run) of the vectors. It is written as follows:
${\begin{pmatrix}{\text{run}}\\{\text{rise}}\end{pmatrix}}$
Other ways of denoting a vector in component form include:
$\mathbf {(u_{x},u_{y})}$
$\mathbf {\left\langle u_{x},u_{y}\right\rangle }$
From the diagram we can now see the benefits of the standard position: the two numbers for the terminal point's coordinates are the same numbers for the vector's rise and run. Note that we named this vector $\mathbf {u}$ . Just as you can assign numbers to variables in algebra (usually $x,y,z$), you can assign vectors to variables in calculus. The letters $u,v,w$ are usually used, and either boldface or an arrow over the letter is used to identify it as a vector.
When expressing a vector in component form, it is no longer obvious what the magnitude and direction are. Therefore, we have to perform some calculations to find the magnitude and direction.

### Magnitude

$|\mathbf {u} |={\sqrt {u_{x}^{2}+u_{y}^{2}}}$
where $u_{x}$ is the width, or run, of the vector; $u_{y}$ is the height, or rise, of the vector. You should recognize this formula as the Pythagorean theorem. It is -- the magnitude is the distance between the initial point and the terminal point.
The magnitude of a vector can also be called the norm.

### Direction

$\tan(\theta )={\frac {u_{y}}{u_{x}}}$
where $\theta$ is the counter-clockwise angle made by the vector with the positive $x$-axis. This formula is simply the tangent formula for right triangles.

### Vector Operations

For these definitions, assume:
$\mathbf {u} ={\begin{pmatrix}u_{x}\\u_{y}\end{pmatrix}},\mathbf {v} ={\begin{pmatrix}v_{x}\\v_{y}\end{pmatrix}}$

#### Vector Addition

Vector Addition is often called tip-to-tail addition, because this makes it easier to remember.
The sum of the vectors you are adding is called the resultant vector, and is the vector drawn from the initial point (tip) of the first vector to the terminal point (tail) of the second vector. Although they look like the arrows, the pointy bit is the tail, not the tip. (Imagine you were walking the direction the vector was pointing... you would start at the flat end (tip) and walk toward the pointy end.)
It looks like this:
(Notice, the black lined vector is the sum of the two dotted line vectors!)
Numerically:
${\binom {4}{6}}+{\binom {1}{-3}}={\binom {5}{3}}$
Or more generally:
$\mathbf {u} +\mathbf {v} ={\begin{pmatrix}u_{x}+v_{x}\\u_{y}+v_{y}\end{pmatrix}}$

#### Scalar Multiplication

Graphically, multiplying a vector by a scalar changes only the magnitude of the vector by that same scalar. That is, multiplying a vector by 2 will "stretch" the vector to twice its original magnitude, keeping the direction the same.
$2\cdot {\binom {3}{3}}={\binom {6}{6}}$
Numerically, you calculate the resultant vector with this formula:
$c\mathbf {u} ={\begin{pmatrix}cu_{x}\\cu_{y}\end{pmatrix}}$
$c$
As previously stated, the magnitude is changed by the same constant:
$|c\mathbf {u} |=|c||\mathbf {u} |$
Since multiplying a vector by a constant results in a vector in the same direction, we can reason that two vectors are parallel if one is a constant multiple of the other -- that is, that $\mathbf {u} ||\mathbf {v}$ if $\mathbf {u} =c\mathbf {v}$ for some constant $c$ .
We can also divide by a non-zero scalar by instead multiplying by the reciprocal, as with dividing regular numbers:
${\frac {\mathbf {u} }{c}}={\frac {1}{c}}\mathbf {u} ,c\neq 0$

#### Linear Functions

Given a function $L$ that accepts a vector as input and returns a vector or scalar as the output, function $L$ is considered to be "linear" if the following holds:
* For any vectors $\mathbf {u}$ and $\mathbf {v}$, it is the case that $L(\mathbf {u} +\mathbf {v} )=L(\mathbf {u} )+L(\mathbf {v} )$.
* For any vector $\mathbf {u}$ and scalar $c$, it is the case that $L(c\mathbf {u} )=cL(\mathbf {u} )$.
More generally, when given a function $M$ that has multiple vector valued parameters $\mathbf {u} _{1},\mathbf {u} _{2},...,\mathbf {u} _{n}$, function $M$ is a "multi-linear" function if $M$ is linear with respect to each parameter while holding all other parameters constant:
For each $i=1,2,...,n$ and vectors $\mathbf {u} _{1},\mathbf {u} _{2},\dots ,\mathbf {u} _{n}$:
* For any vector $\mathbf {v}$ from the same vector space as $\mathbf {u} _{i}$, it is the case that $M(\mathbf {u} _{1},...,\mathbf {u} _{i}+\mathbf {v} ,...,\mathbf {u} _{n})=M(\mathbf {u} _{1},...,\mathbf {u} _{i},...,\mathbf {u} _{n})+M(\mathbf {u} _{1},...,\mathbf {v} ,...,\mathbf {u} _{n})$
* For any scalar $c$, it is the case that $M(\mathbf {u} _{1},...,c\mathbf {u} _{i},...,\mathbf {u} _{n})=cM(\mathbf {u} _{1},...,\mathbf {u} _{i},...,\mathbf {u} _{n})$
If $n=2$, then $M$ is "bilinear". Bilinear functions include the dot product and the cross product.

#### Dot Product

The dot product is a way of multiplying two vectors to produce a scalar value. Because it combines the components of two vectors to form a /scalar/, it is sometimes called a scalar product. If you were asked to take the 'dot product of two rectangular vectors' you would do the following:
$\mathbf {u} \cdot \mathbf {v} =u_{x}v_{x}+u_{y}v_{y}$
It is very important to note that the dot product of two vectors does not result in another vector, it gives you a scalar, just a numerical value.
Another common pitfall may arise if your vectors are not in rectangular ('cartesian') format. Sometimes, vectors are instead expressed in polar coordinates, where the first component is the vector's magnitude (length) and the second is the angle from the $x$-axis at which the vector should be oriented. Dot products cannot be performed using the conventional method on these sorts of vectors; vectors in polar format must be converted to their equivalent rectangular form before you can work with them using the formula given above. A common way to convert to rectangular coordinates is to imagine that the vector was projected horizontally and vertically to form a right triangle. You could then use properties of sin and cos to find the length of the two legs the right triangle. The horizontal length would then be the x-component of the rectangular expression of the vector and the vertical length would be the y-component. Remember that if the vector is pointing down or to the left, the corresponding components would have to be negative to indicate that.
With some rearrangement and trigonometric manipulation, we can see that the number that results from the dot product of two vectors is a surprising and useful identity:
$\mathbf {u} \cdot \mathbf {v} =|\mathbf {u} ||\mathbf {v} |\cos(\theta )$
where $\theta$ is the angle between the two vectors.
This provides a convenient way of finding the angle between two vectors:
$\cos(\theta )={\frac {\mathbf {u} \cdot \mathbf {v} }{|\mathbf {u} ||\mathbf {v} |}}$
Notice that the dot product is 'commutative', that is:
$\mathbf {u} \cdot \mathbf {v} =\mathbf {v} \cdot \mathbf {u}$
Also, the dot product of two vectors will be the length of the vector squared:
$\mathbf {u} \cdot \mathbf {u} =u_{x}u_{x}+u_{y}u_{y}=(u_{x})^{2}+(u_{y})^{2}$
and by the Pythagorean theorem,
$(u_{x})^{2}+(u_{y})^{2}=|\mathbf {u} |^{2}$
The dot product can be visualized as the length of a projection of one vector on to the other. In other words, the dot product asks 'how much magnitude of this vector is going in the direction of that vector?'

#### Deriving the Dot Product

Start with the following definition for the dot product: $\mathbf {u} \cdot \mathbf {v} =|\mathbf {u} ||\mathbf {v} |\cos(\theta )$ where $\theta$ is the angle between $\mathbf {u}$ and $\mathbf {v}$.
The formula $\mathbf {u} \cdot \mathbf {v} =u_{x}v_{x}+u_{y}v_{y}$ can be derived from the above definition through various approaches:
Approach #1
One of the more direct approaches is to use the law of cosines. Create a triangle $\Delta AOB$ with vertices $A(u_{x},u_{y})$, $O(0,0)$, and $B(v_{x},v_{y})$. The displacement ${\vec {OA}}=\mathbf {u}$, the displacement ${\vec {OB}}=\mathbf {v}$, and the displacement ${\vec {AB}}=\mathbf {v} -\mathbf {u}$. The angle $\angle AOB=\theta$.
The lengths of the sides of the triangle are $|OA|=|\mathbf {u} |$, and $|OB|=|\mathbf {v} |$, and $|AB|=|\mathbf {v} -\mathbf {u} |$. Applying the law of cosines gives:
$|AB|^{2}=|OA|^{2}+|OB|^{2}-2|OA||OB|\cos(\angle AOB)$ $\iff |\mathbf {v} -\mathbf {u} |^{2}=|\mathbf {u} |^{2}+|\mathbf {v} |^{2}-2|\mathbf {u} ||\mathbf {v} |\cos(\theta )$ $\iff (v_{x}-u_{x})^{2}+(v_{y}-u_{y})^{2}=(u_{x}^{2}+u_{y}^{2})+(v_{x}^{2}+v_{y}^{2})-2|\mathbf {u} ||\mathbf {v} |\cos(\theta )$ $\iff -2u_{x}v_{x}-2u_{y}v_{y}=-2|\mathbf {u} ||\mathbf {v} |\cos(\theta )$ $\iff |\mathbf {u} ||\mathbf {v} |\cos(\theta )=u_{x}v_{x}+u_{y}v_{y}$
Therefore $\mathbf {u} \cdot \mathbf {v} =u_{x}v_{x}+u_{y}v_{y}$.
Approach #2
A more intuitive derivation of $\mathbf {u} \cdot \mathbf {v} =u_{x}v_{x}+u_{y}v_{y}$ uses the fact that the dot product is a bilinear operator. To establish that the dot product is a bilinear operator, the following must be established:
* Holding $\mathbf {u}$ constant, the dot product $\mathbf {u} \cdot \mathbf {v}$ must be linear with respect to $\mathbf {v}$.
* Holding $\mathbf {v}$ constant, the dot product $\mathbf {u} \cdot \mathbf {v}$ must be linear with respect to $\mathbf {u}$.
Since it is readily apparent from the definition $\mathbf {u} \cdot \mathbf {v} =|\mathbf {u} ||\mathbf {v} |\cos(\theta )$ that $\mathbf {u} \cdot \mathbf {v} =\mathbf {v} \cdot \mathbf {u}$, linearity with respect to $\mathbf {v}$ implies linearity with respect to $\mathbf {u}$. It is hence only necessary to establish that the dot product is linear with respect to $\mathbf {v}$ to establish bilinearity.
$\mathbf {u} \cdot \mathbf {v} =|\mathbf {u} ||\mathbf {v} |\cos(\theta )=|\mathbf {u} |{\text{proj}}(\mathbf {v} |\mathbf {u} )$ where ${\text{proj}}(\mathbf {v} |\mathbf {u} )=|\mathbf {v} |\cos(\theta )$ is the "orthogonal projection" of vector $\mathbf {v}$ onto a line $L(\mathbf {u} )$ whose direction is the direction of $\mathbf {u}$. ${\text{proj}}(\mathbf {v} |\mathbf {u} )$ is the component of $\mathbf {v}$ that is parallel to $L(\mathbf {u} )$. By drawing similar triangles, one observes that ${\text{proj}}(\mathbf {v} |\mathbf {u} )$ is linear with respect to $\mathbf {v}$ while $\mathbf {u}$ is held constant. The dot product $\mathbf {u} \cdot \mathbf {v} =|\mathbf {u} |{\text{proj}}(\mathbf {v} |\mathbf {u} )$ is linear with respect to $\mathbf {v}$, and therefore the dot product is a bilinear operator.
The bilinearity of the dot product now enables the derivation:
$\mathbf {u} \cdot \mathbf {v} ={\begin{pmatrix}u_{x}\\u_{y}\end{pmatrix}}\cdot {\begin{pmatrix}v_{x}\\v_{y}\end{pmatrix}}$ $=\left(u_{x}{\begin{pmatrix}1\\0\end{pmatrix}}+u_{y}{\begin{pmatrix}0\\1\end{pmatrix}}\right)\cdot \left(v_{x}{\begin{pmatrix}1\\0\end{pmatrix}}+v_{y}{\begin{pmatrix}0\\1\end{pmatrix}}\right)$ $=\left(\left(u_{x}{\begin{pmatrix}1\\0\end{pmatrix}}+u_{y}{\begin{pmatrix}0\\1\end{pmatrix}}\right)\cdot {\begin{pmatrix}1\\0\end{pmatrix}}\right)v_{x}+\left(\left(u_{x}{\begin{pmatrix}1\\0\end{pmatrix}}+u_{y}{\begin{pmatrix}0\\1\end{pmatrix}}\right)\cdot {\begin{pmatrix}0\\1\end{pmatrix}}\right)v_{y}$ $=\left({\begin{pmatrix}1\\0\end{pmatrix}}\cdot {\begin{pmatrix}1\\0\end{pmatrix}}\right)u_{x}v_{x}+\left({\begin{pmatrix}0\\1\end{pmatrix}}\cdot {\begin{pmatrix}1\\0\end{pmatrix}}\right)u_{y}v_{x}+\left({\begin{pmatrix}1\\0\end{pmatrix}}\cdot {\begin{pmatrix}0\\1\end{pmatrix}}\right)u_{x}v_{y}+\left({\begin{pmatrix}0\\1\end{pmatrix}}\cdot {\begin{pmatrix}0\\1\end{pmatrix}}\right)u_{y}v_{y}$ $=1u_{x}v_{x}+0u_{y}v_{x}+0u_{x}v_{y}+1u_{y}v_{y}$ $=u_{x}v_{x}+u_{y}v_{y}$
Therefore $\mathbf {u} \cdot \mathbf {v} =u_{x}v_{x}+u_{y}v_{y}$.

### Applications of Scalar Multiplication and Dot Product
#### Unit Vectors

A unit vector is a vector with a magnitude of 1. The unit vector of u is a vector in the same direction as $\mathbf {u}$ , but with a magnitude of 1:
The process of finding the unit vector of $\mathbf {u}$ is called normalization. As mentioned in scalar multiplication, multiplying a vector by constant $c$ will result in the magnitude being multiplied by $c$ . We know how to calculate the magnitude of $\mathbf {u}$ . We know that dividing a vector by a constant will divide the magnitude by that constant. Therefore, if that constant is the magnitude, dividing the vector by the magnitude will result in a unit vector in the same direction as $\mathbf {u}$ :
$\mathbf {w} ={\frac {\mathbf {u} }{|\mathbf {u} |}}$
$\mathbf {w}$
$\mathbf {u}$

#### Standard Unit Vectors

A special case of Unit Vectors are the Standard Unit Vectors $\mathbf {i} ,\mathbf {j}$ : $\mathbf {i}$ points one unit directly right in the $x$ direction, and $\mathbf {j}$ points one unit directly up in the $y$ direction:
$\mathbf {i} ={\binom {1}{0}}$
$\mathbf {j} ={\binom {0}{1}}$
Using the scalar multiplication and vector addition rules, we can then express vectors in a different way:
${\binom {x}{y}}=x\mathbf {i} +y\mathbf {j}$
If we work that equation out, it makes sense. Multiplying $x$ by $\mathbf {i}$ will result in the vector ${\binom {x}{0}}$ . Multiplying $y$ by $\mathbf {j}$ will result in the vector ${\binom {0}{y}}$ . Adding these two together will give us our original vector, ${\binom {x}{y}}$ . Expressing vectors using $\mathbf {i} ,\mathbf {j}$ is called standard form.

#### Projection and Decomposition of Vectors

Sometimes it is necessary to decompose a vector $\mathbf {u}$ into two components: one component parallel to a vector $\mathbf {v}$ , which we will call $\mathbf {u} _{\parallel }$ ; and one component perpendicular to it, $\mathbf {u} _{\perp }$ .
Since the length of $\mathbf {u} _{\parallel }$ is $|\mathbf {u} |\cdot \cos(\theta )$ , it is straightforward to write down the formulas for $\mathbf {u} _{\perp }$ and $\mathbf {u} _{\parallel }$ :
$\mathbf {u_{\parallel }} =|\mathbf {u} |*{\frac {(\mathbf {u} \cdot \mathbf {v} )}{(|\mathbf {u} ||\mathbf {v} |)}}*{\frac {\mathbf {v} }{|\mathbf {v} |}}={\frac {\mathbf {u} \cdot \mathbf {v} }{|\mathbf {v} |^{2}}}\mathbf {v}$
and
$\mathbf {u} _{\perp }=\mathbf {u} -\mathbf {u} _{\parallel }$

#### Length of a vector

The length of a vector is given by the dot product of a vector with itself, and $\theta =0\ rad$:
$\mathbf {u} \cdot \mathbf {u} =|\mathbf {u} ||\mathbf {u} |\cos(\theta )=|\mathbf {u} |^{2}$

#### Perpendicular vectors

If the angle $\theta$ between two vectors is 90 degrees or ${\tfrac {\pi }{2}}$ (if the two vectors are orthogonal to each other), that is the vectors are perpendicular, then the dot product is 0. This provides us with an easy way to find a perpendicular vector: if you have a vector $\mathbf {u} ={\begin{pmatrix}u_{x}\\u_{y}\end{pmatrix}}$ , a perpendicular vector can easily be found by either
$\mathbf {v} ={\begin{pmatrix}-u_{y}\\u_{x}\end{pmatrix}}=-{\begin{pmatrix}u_{y}\\-u_{x}\end{pmatrix}}$

### Polar coordinates

Polar coordinates are an alternative two-dimensional coordinate system, which is often useful when rotations are important. Instead of specifying the position along the $x$ and $y$ axes, we specify the distance from the origin, $r$ , and the direction, an angle $\theta$ .
Looking at this diagram, we can see that the values of $x,y$ are related to those of $r$ and $\theta$ by the equations
${\begin{matrix}x=r\cos(\theta )&r={\sqrt {x^{2}+y^{2}}}\\y=r\sin(\theta )&\theta =\arctan \left({\frac {y}{x}}\right)\end{matrix}}$
Because tan$^{-1}$ is multivalued, care must be taken to select the right value.
Just as for Cartesian coordinates the unit vectors that point in the $x$ and $y$ directions are special, so in polar coordinates the unit vectors that point in the $r$ and $\theta$ directions are also special.
We will call these vectors ${\hat {\mathbf {r} }}$ and ${\hat {\boldsymbol {\theta }}}$ , pronounced r-hat and theta-hat. Putting a circumflex over a vector this way is often used to mean the unit vector in that direction.
Again, on looking at the diagram we see,
${\begin{matrix}\mathbf {i} ={\hat {\mathbf {r} }}\cos(\theta )-{\hat {\boldsymbol {\theta }}}\sin(\theta )&{\hat {\mathbf {r} }}={\frac {x}{r}}\mathbf {i} +{\frac {y}{r}}\mathbf {j} \\\mathbf {j} ={\hat {\mathbf {r} }}\sin(\theta )+{\hat {\boldsymbol {\theta }}}\cos(\theta )&{\hat {\boldsymbol {\theta }}}=-{\frac {y}{r}}\mathbf {i} +{\frac {x}{r}}\mathbf {j} \end{matrix}}$

## Three-Dimensional Coordinates and Vectors
### Basic definition

Two-dimensional Cartesian coordinates as we've discussed so far can be easily extended to three-dimensions by adding one more value: $z$ . If the standard $(x,y)$ coordinate axes are drawn on a sheet of paper, the $z$-axis would extend upwards off of the paper.
Similar to the two coordinate axes in two-dimensional coordinates, there are three coordinate planes in space. These are the $xy$-plane, the $yz$-plane, and the $xz$-plane. Each plane is the "sheet of paper" that contains both axes the name mentions. For instance, the $yz$-plane contains both the $y$ and $z$ axes and is perpendicular to the $x$-axis.
Therefore, vectors can be extended to three dimensions by simply adding the $z$ value.
$\mathbf {u} ={\begin{pmatrix}x\\y\\z\end{pmatrix}}$
To facilitate standard form notation, we add another standard unit vector:
$\mathbf {k} ={\begin{pmatrix}0\\0\\1\end{pmatrix}}$
Again, both forms (component and standard) are equivalent.
${\begin{pmatrix}1\\2\\3\end{pmatrix}}=1\mathbf {i} +2\mathbf {j} +3\mathbf {k}$
Magnitude: Magnitude in three dimensions is the same as in two dimensions, with the addition of a $z$ term in the radicand.
$|\mathbf {u} |={\sqrt {u_{x}^{2}+u_{y}^{2}+u_{z}^{2}}}$

## Three dimensions

The polar coordinate system is extended into three dimensions with two different coordinate systems, the cylindrical and spherical coordinate systems, both of which include two-dimensional or planar polar coordinates as a subset. In essence, the cylindrical coordinate system extends polar coordinates by adding an additional distance coordinate, while the spherical system instead adds an additional angular coordinate.

### Cylindrical coordinates

The cylindrical coordinate system is a coordinate system that essentially extends the two-dimensional polar coordinate system by adding a third coordinate measuring the height of a point above the plane, similar to the way in which the Cartesian coordinate system is extended into three dimensions. The third coordinate is usually denoted $h$ (or simply $z$, i.e., same notation as Cartesian coordinate system), making the three cylindrical coordinates $(r,\theta ,h)$ (or $(r,\theta ,z)$).
The three cylindrical coordinates can be converted to Cartesian coordinates by
    ${\begin{aligned}x&=r\cos(\theta )\\y&=r\sin(\theta )\\z&=h\end{aligned}}$

### Spherical coordinates

Polar coordinates can also be extended into three dimensions using the coordinates $(\rho ,\phi ,\theta )$ (or $(\rho ,\varphi ,\theta )$), where $\rho$ is the distance from the origin, $\phi$ (or $\varphi$) is the angle from the $z$-axis (called the colatitude or zenith and measured from 0 to 180°) and $\theta$ is the angle from the $x$-axis (as in the polar coordinates). This coordinate system, called the spherical coordinate system, is similar to the latitude and longitude system used for Earth, with the origin in the centre of Earth, the latitude $\delta$ being the complement of $\phi$ , determined by $\delta =90^{\circ }-\phi$ , and the longitude $l$ being measured by $l=\theta -180^{\circ }$ .
The three spherical coordinates are converted to Cartesian coordinates by
    ${\begin{aligned}x&=\rho \sin(\phi )\cos(\theta )\\y&=\rho \sin(\phi )\sin(\theta )\\z&=\rho \cos(\phi )\end{aligned}}$
    $\rho ={\sqrt {x^{2}+y^{2}+z^{2}}}$
    $\theta =\arctan \left({\frac {y}{x}}\right)$
    $\phi =\arccos \left({\frac {z}{\rho }}\right)$

### Cross Product

The cross product of two vectors is a determinant:
    $\mathbf {u} \times \mathbf {v} ={\begin{vmatrix}\mathbf {i} &\mathbf {j} &\mathbf {k} \\u_{x}&u_{y}&u_{z}\\v_{x}&v_{y}&v_{z}\end{vmatrix}}$
and is also a pseudovector.
The cross product of two vectors is orthogonal to both vectors. The magnitude of the cross product is the product of the magnitude of the vectors and the sin of the angle between them.
    $|\mathbf {u} \times \mathbf {v} |=|\mathbf {u} ||\mathbf {v} |\sin(\theta )$
This magnitude is the area of the parallelogram defined by the two vectors.
The cross product is linear and anticommutative. For any numbers $a,b$ ,
    $\mathbf {u} \times \left(a\mathbf {v} +b\mathbf {w} \right)=a\mathbf {u} \times \mathbf {v} +b\mathbf {u} \times \mathbf {w} \qquad \mathbf {u} \times \mathbf {v} =-\mathbf {v} \times \mathbf {u}$
If both vectors point in the same direction, their cross product is 0.

### Deriving the Cross Product

Start with the following definition for the cross product: $\mathbf {u} \times \mathbf {v} =(|\mathbf {u} ||\mathbf {v} |\sin \theta ){\hat {\mathbf {n} }}$. Vector ${\hat {\mathbf {n} }}$ is a unit length vector that is perpendicular to both $\mathbf {u}$ and $\mathbf {v}$ and oriented according to the "right hand rule". Angle $\theta$ is the counterclockwise angle from $\mathbf {u}$ to $\mathbf {v}$ within the plane that is orthogonal to ${\hat {\mathbf {n} }}$.
The formula $\mathbf {u} \times \mathbf {v} =(u_{y}v_{z}-u_{z}v_{y})\mathbf {i} +(u_{z}v_{x}-u_{x}v_{z})\mathbf {j} +(u_{x}v_{y}-u_{y}v_{x})\mathbf {k}$ can be derived by exploiting the bilinearity of the cross product. To establish the cross product as a bilinear operator, the following must be established:
* Holding $\mathbf {u}$ constant, the cross product $\mathbf {u} \times \mathbf {v}$ must be linear with respect to $\mathbf {v}$.
* Holding $\mathbf {v}$ constant, the cross product $\mathbf {u} \times \mathbf {v}$ must be linear with respect to $\mathbf {u}$.
From the definition $\mathbf {u} \times \mathbf {v} =(|\mathbf {u} ||\mathbf {v} |\sin \theta ){\hat {\mathbf {n} }}$, the anticommutative property of the cross product can be inferred: $\mathbf {u} \times \mathbf {v} =-\mathbf {v} \times \mathbf {u}$ (vector ${\hat {\mathbf {n} }}$ reverses direction when $\mathbf {u}$ and $\mathbf {v}$ are swapped). This means that linearity with respect to $\mathbf {v}$ implies linearity with respect to $\mathbf {u}$. It is hence only necessary to establish that the cross product is linear with respect to $\mathbf {v}$ to establish bilinearity.
$\mathbf {u} \times \mathbf {v} =(|\mathbf {u} ||\mathbf {v} |\sin \theta ){\hat {\mathbf {n} }}=|\mathbf {u} |{\textbf {rotate}}({\textbf {perp}}(\mathbf {v} |\mathbf {u} )|\mathbf {u} )$ where:
* ${\textbf {perp}}(\mathbf {v} |\mathbf {u} )$ is the component of $\mathbf {v}$ that is perpendicular to a line $L(\mathbf {u} )$ whose direction is the direction of $\mathbf {u}$. ${\textbf {perp}}(\mathbf {v} |\mathbf {u} )=(|\mathbf {v} |\sin \theta ){\hat {\mathbf {m} }}$ where vector ${\hat {\mathbf {m} }}$ is a unit length vector that is parallel to ${\textbf {perp}}(\mathbf {v} |\mathbf {u} )$.
* ${\textbf {rotate}}(\mathbf {w} |\mathbf {u} )$ is a 90 degree counterclockwise rotation of $\mathbf {w}$ around $L(\mathbf {u} )$. Note that ${\textbf {rotate}}({\hat {\mathbf {m} }}|\mathbf {u} )={\hat {\mathbf {n} }}$.
It can easily be observed that ${\textbf {perp}}(\mathbf {v} |\mathbf {u} )$ is linear with respect to $\mathbf {v}$ with $\mathbf {u}$ held constant, and that ${\textbf {rotate}}(\mathbf {w} |\mathbf {u} )$ is linear with respect to $\mathbf {w}$ with $\mathbf {u}$ held constant. The cross product $\mathbf {u} \times \mathbf {v} =(|\mathbf {u} ||\mathbf {v} |\sin \theta ){\hat {\mathbf {n} }}=|\mathbf {u} |{\textbf {rotate}}({\textbf {perp}}(\mathbf {v} |\mathbf {u} )|\mathbf {u} )$ is linear with respect to $\mathbf {v}$, and therefore the cross product is a bilinear operator.
The bilinearity of the cross product now enables the derivation:
$\mathbf {u} \times \mathbf {v} =(u_{x}\mathbf {i} +u_{y}\mathbf {j} +u_{z}\mathbf {k} )\times (v_{x}\mathbf {i} +v_{y}\mathbf {j} +v_{z}\mathbf {k} )$ $=v_{x}((u_{x}\mathbf {i} +u_{y}\mathbf {j} +u_{z}\mathbf {k} )\times \mathbf {i} )+v_{y}((u_{x}\mathbf {i} +u_{y}\mathbf {j} +u_{z}\mathbf {k} )\times \mathbf {j} )+v_{z}((u_{x}\mathbf {i} +u_{y}\mathbf {j} +u_{z}\mathbf {k} )\times \mathbf {k} )$ $=u_{x}v_{x}(\mathbf {i} \times \mathbf {i} )+u_{y}v_{x}(\mathbf {j} \times \mathbf {i} )+u_{z}v_{x}(\mathbf {k} \times \mathbf {i} )+u_{x}v_{y}(\mathbf {i} \times \mathbf {j} )+u_{y}v_{y}(\mathbf {j} \times \mathbf {j} )+u_{z}v_{y}(\mathbf {k} \times \mathbf {j} )+u_{x}v_{z}(\mathbf {i} \times \mathbf {k} )+u_{y}v_{z}(\mathbf {j} \times \mathbf {k} )+u_{z}v_{z}(\mathbf {k} \times \mathbf {k} )$ $=u_{x}v_{y}\mathbf {0} +u_{y}v_{x}(-\mathbf {k} )+u_{z}v_{x}\mathbf {j} +u_{x}v_{y}\mathbf {k} +u_{y}v_{y}\mathbf {0} +u_{z}v_{y}(-\mathbf {i} )+u_{x}v_{z}(-\mathbf {j} )+u_{y}v_{z}\mathbf {i} +u_{z}v_{z}\mathbf {0}$ $=(u_{y}v_{z}-u_{z}v_{y})\mathbf {i} +(u_{z}v_{x}-u_{x}v_{z})\mathbf {j} +(u_{x}v_{y}-u_{y}v_{x})\mathbf {k}$
Therefore $\mathbf {u} \times \mathbf {v} =(u_{y}v_{z}-u_{z}v_{y})\mathbf {i} +(u_{z}v_{x}-u_{x}v_{z})\mathbf {j} +(u_{x}v_{y}-u_{y}v_{x})\mathbf {k}$.

### Triple Products

If we have three vectors we can combine them in two ways, a triple scalar product,
$\mathbf {u} \cdot (\mathbf {v} \times \mathbf {w} )$
and a triple vector product
$\mathbf {u} \times (\mathbf {v} \times \mathbf {w} )$
The triple scalar product is a determinant
    $\mathbf {u} \cdot (\mathbf {v} \times \mathbf {w} )={\begin{vmatrix}u_{x}&u_{y}&u_{z}\\v_{x}&v_{y}&v_{z}\\w_{x}&w_{y}&w_{z}\end{vmatrix}}$
If the three vectors are listed clockwise, looking from the origin, the sign of this product is positive. If they are listed anticlockwise the sign is negative.
The order of the cross and dot products doesn't matter.
    $\mathbf {u} \cdot (\mathbf {v} \times \mathbf {w} )=(\mathbf {u} \times \mathbf {v} )\cdot \mathbf {w}$
Either way, the absolute value of this product is the volume of the parallelepiped defined by the three vectors $\mathbf {u} ,\mathbf {v} ,\mathbf {w}$
The triple vector product can be simplified
$\mathbf {u} \times (\mathbf {v} \times \mathbf {w} )=(\mathbf {u} \cdot \mathbf {w} )\mathbf {v} -(\mathbf {u} \cdot \mathbf {v} )\mathbf {w}$
This form is easier to do calculations with.
The triple vector product is not associative.
$\mathbf {u} \times (\mathbf {v} \times \mathbf {w} )\neq (\mathbf {u} \times \mathbf {v} )\times \mathbf {w}$
There are special cases where the two sides are equal, but in general the brackets matter. They must not be omitted.

### Three-Dimensional Lines and Planes

We will use $\mathbf {r}$ to denote the position of a point.
The multiples of a vector, $\mathbf {a}$ all lie on a line through the origin. Adding a constant vector $\mathbf {b}$ will shift the line, but leave it straight, so the equation of a line is,
    $\mathbf {r} =s\mathbf {a} +\mathbf {b}$
This is a parametric equation. The position is specified in terms of the parameter $s$ .
Any linear combination of two vectors, $\mathbf {a} ,\mathbf {b}$ lies on a single plane through the origin, provided the two vectors are not colinear. We can shift this plane by a constant vector again and write
    $\mathbf {r} =s\mathbf {a} +t\mathbf {b} +\mathbf {c}$
If we choose $\mathbf {a} ,\mathbf {b}$ to be orthonormal vectors in the plane (i.e. unit vectors at right angles) then $s,t$ are Cartesian coordinates for points in the plane.
These parametric equations can be extended to higher dimensions.
Instead of giving parametric equations for the line and plane, we could use constraints. E.g., for any point in the $xy$ plane $z=0$
For a plane through the origin, the single vector normal to the plane, $\mathbf {n}$ , is at right angle with every vector in the plane, by definition, so
    $\mathbf {r} \cdot \mathbf {n} =0$
is a plane through the origin, normal to $\mathbf {n}$ .
For planes not through the origin we get
    $(\mathbf {r} -\mathbf {a} )\cdot \mathbf {n} =0\qquad \mathbf {r} \cdot \mathbf {n} =\mathbf {a} \cdot \mathbf {n}$
A line lies on the intersection of two planes, so it must obey the constraint for both planes, i.e.
    $\mathbf {r} \cdot \mathbf {n} =a\qquad \mathbf {r} \cdot \mathbf {m} =b$
These constraint equations con also be extended to higher dimensions.

## Introduction to Vector-Valued Functions

Vector-Valued Functions are functions that instead of giving a resultant scalar value, give a resultant vector value. These aid in the creation of direction and vector fields, and are therefore used in physics to aid with visualizations of electric, magnetic, and many other types of fields. They are of the following form:
$\mathbf {F(t)} ={\begin{pmatrix}\mathbf {a_{1}(t)} \\\vdots \\\mathbf {a_{n}(t)} \end{pmatrix}}$

### Introduction

This page or section of Calculus is a stub. You can help Wikibooks by expanding it.

### Limits, Derivatives, and Integrals

Put simply, the limit of a vector-valued function is the limit of its parts.

#### Proof

Suppose $\lim _{t\to c}\mathbf {F} (t)=\mathbf {L} ={\begin{pmatrix}\mathbf {a_{1}} \\\vdots \\\mathbf {a_{n}} \end{pmatrix}}$
Therefore for any $\varepsilon >0$ there is a $\phi >0$ such that
$0<|t-c|<\phi \implies |\mathbf {F} (t)-\mathbf {L} |<\varepsilon$
But by the triangle inequality $|a_{1}|\leq |\mathbf {F} |\leq |a_{1}|+\cdots +|a_{n}|$
* Triangle Inequality
* The triangle inequality states that $|u+v|\leq |u|+|v|$. This can be used on $n$-dimensional vectors by representing in their independent, unit-vector parts.
* For some $n$-dimensional vector $\mathbf {F} ={\begin{pmatrix}\mathbf {\mu _{1}} \\\vdots \\\mathbf {\mu _{n}} \end{pmatrix}}$, we can compose it of its unit vectors: $\mathbf {F} =\mu _{1}{\hat {\mathbf {i} }}+\mu _{2}{\hat {\mathbf {j} }}+\cdots +\mu _{n}{\hat {\mathbf {z} }}$ and since $|c\mathbf {v} |=c|\mathbf {v} |$, where $c$ is a constant, $|\mathbf {F} |\leq |\mu _{1}|+\cdots +|\mu _{n}|$.
$|a_{1}(t)-a_{1}|\leq |\mathbf {F} (t)-\mathbf {L} |$
So
$0<|t-c|<\phi \implies |a_{1}(t)-a_{1}|<\varepsilon$
Therefore $\lim _{t\to c}a_{1}(t)=a_{1}$
A similar argument can be used through parts $a_{n}(t)$ .
Now let $\lim _{t\to c}\mathbf {F} (t)=\mathbf {L} ={\begin{pmatrix}\mathbf {a_{1}} \\\vdots \\\mathbf {a_{n}} \end{pmatrix}}$ again, and that for any $\varepsilon >0$ there is a corresponding $\phi >0$ such $0<|t-c|<\phi$ implies
$|a_{n}(t)-a_{n}|<{\frac {\varepsilon }{n}}$
Then
$0<|t-c|<\phi \implies |\mathbf {F} (t)-\mathbf {L} |\leq {\frac {\varepsilon _{1}}{n}}+\cdots +{\frac {\varepsilon _{n}}{n}}=\varepsilon$
therefore:
$\lim _{t\to c}\mathbf {F} (t)=\mathbf {L} ={\begin{pmatrix}\mathbf {a_{1}} \\\vdots \\\mathbf {a_{n}} \end{pmatrix}}={\begin{pmatrix}\lim \limits _{t\to c}\mathbf {a_{1}(t)} \\\vdots \\\lim \limits _{t\to c}\mathbf {a_{n}(t)} \end{pmatrix}}$
From this we can then create an accurate definition of a derivative of a vector-valued function:
${\begin{aligned}\mathbf {F} '(t)&=\lim _{h\to 0}{\frac {\mathbf {F} (t+h)-\mathbf {F} (t)}{h}}={\begin{pmatrix}\mathbf {a_{1}(t)} \\\vdots \\\mathbf {a_{n}(t)} \end{pmatrix}}\\&=\lim _{h\to 0}{\frac {{\begin{pmatrix}\mathbf {a_{1}(t+h)} \\\vdots \\\mathbf {a_{n}(t+h)} \end{pmatrix}}-{\begin{pmatrix}\mathbf {a_{1}(t)} \\\vdots \\\mathbf {a_{n}(t)} \end{pmatrix}}}{h}}\\&={\begin{pmatrix}\lim \limits _{h\to 0}{\dfrac {a_{1}(t+h)-a_{1}(t)}{h}}\\\vdots \\\lim \limits _{h\to 0}{\dfrac {a_{n}(t+h)-a_{n}(t)}{h}}\end{pmatrix}}\end{aligned}}$
The final step was accomplished by taking what we just did with limits.
By the Fundamental Theorem of Calculus integrals can be applied to the vector's components.
In other words: the limit of a vector function is the limit of its parts, the derivative of a vector function is the derivative of its parts, and the integration of a vector function is the integration of it parts.

### Velocity, Acceleration, Curvature, and a brief mention of the Binormal

Assume we have a vector-valued function which starts at the origin and as its independent variables changes the points that the vectors point at trace a path.
We will call this vector $\mathbf {r} (t)$ , which is commonly known as the position vector.
If $\mathbf {r}$ then represents a position and t represents time, then in model with Physics we know the following:
    $\mathbf {r} (t+h)-\mathbf {r} (t)$ is displacement.
    $\mathbf {r} '(t)=\mathbf {v} (t)$ where $\mathbf {v} (t)$ is the velocity vector.
    $|\mathbf {v} (t)|$ is the speed.
    $\mathbf {r} ''(t)=\mathbf {v} '(t)=\mathbf {a} (t)$ where $\mathbf {a} (t)$ is the acceleration vector.
The only other vector that comes in use at times is known as the curvature vector.
The vector $\mathbf {T} (t)$ used to find it is known as the unit tangent vector, which is defined as ${\frac {\mathbf {v} (t)}{|\mathbf {v} (t)|}}$ or shorthand $\mathbf {\hat {v}}$ .
The vector normal $\mathbf {N}$ to this then is ${\frac {\mathbf {T} '(t)}{|\mathbf {v} (t)|}}$ .
We can verify this by taking the dot product
$\mathbf {T} \cdot \mathbf {N} =0$
Also note that $|\mathbf {v} (t)|={\frac {ds}{dt}}$
and
$\mathbf {T} (t)={\frac {v}{|v|}}={\frac {\frac {dr}{dt}}{\frac {ds}{dt}}}={\frac {dr}{ds}}$
and
$\mathbf {N} ={\frac {\mathbf {T} '(t)}{|\mathbf {v} (t)|}}={\frac {\frac {dT}{dt}}{\frac {ds}{dt}}}={\frac {dT}{ds}}$
Then we can actually verify:
${\frac {d}{ds}}(\mathbf {T} \cdot \mathbf {T} )={\frac {d}{ds}}(1)$
${\frac {dT}{ds}}\cdot \mathbf {T} +\mathbf {T} \cdot {\frac {dT}{ds}}=0$
$2\mathbf {T} \cdot {\frac {dT}{ds}}=0$
$\mathbf {T} \cdot {\frac {dT}{ds}}=0$
$\mathbf {T} \cdot \mathbf {N} =0$
Therefore $\mathbf {N}$ is perpendicular to $\mathbf {T}$
What this gives rise to is the Unit Normal Vector ${\frac {\frac {dT}{ds}}{\left|{\frac {dT}{ds}}\right|}}$ of which the top-most vector is the Normal vector, but the bottom half $(|{\frac {dT}{ds}}|)^{-1}$ is known as the curvature. Since the Normal vector points toward the inside of a curve, the sharper a turn, the Normal vector has a large magnitude, therefore the curvature has a small value, and is used as an index in civil engineering to reflect the sharpness of a curve (clover-leaf highways, for instance).
The only other thing not mentioned is the Binormal that occurs in 3-d curves $\mathbf {T} \times \mathbf {N} =\mathbf {B}$ , which is useful in creating planes parallel to the curve.
Navigation:
Main Page · Precalculus · Limits · Differentiation · Integration · Parametric and Polar Equations · Sequences and Series · Multivariable Calculus · Extensions · References