Some examples of basic vector arithmetic and numeric vectors.

{1, 2, 3}

{1, 2, 3} + {4, 5, 6}

3{1,2, 3}

3*{1, 2, 3}

Dot products are indicated either by a “.” operator or the built-in function Dot.

{1, 2, 3}.{4, 5, 6}

Dot[ {1,2,3}, {3,4,5}]

Use the built-in function Cross to calculate cross products.

Cross[ {1,2,0},{0,1,2}]

The magnitude of a vector is found by the Norm function.

Norm[ {1,2,2}]

Vectors can have expressions as well as numbers as their components, thus letting you write vector-valued functions.

{ t^2, t, Sin[t]}.{t, Sqrt[t], Cos[t]}

The built-in D function takes a derivative, of either a scalar or vector function. Notice that it takes the variable to differentiate with respect to as its second argument.

D[ 3x^2, x ]

D[ {x^2, 3x, x+x^3}, x ]

The Integrate function evaluates both indefinite and definite integrals. For indefinite integrals, the second argument is the variable to integrate with respect to. For definite integrals, the second argument is a triple containing the variable and the lower and upper bounds of integration.

Integrate[ 3x^2, x ]

Integrate[ 3x^2, {x,0,2} ]

Integrate[ {t^2, Sin[t]}, t]

Integrate[ {y^2, Sin[y]}, {y,0,Pi} ]