# A Gentle Introduction To Vector Valued Functions

Last Updated on March 16, 2022

Vector valued functions are often encountered in machine learning, computer graphics and computer vision algorithms. They are particularly useful for defining the parametric equations of space curves. It is important to gain a basic understanding of vector valued functions to grasp more complex concepts.

In this tutorial, you will discover what vector valued functions are, how to define them and some examples.

After completing this tutorial, you will know:

• Definition of vector valued functions
• Derivatives of vector valued functions

Letâ€™s get started.

A gentle iIntroduction to vector valued functions. Photo by Noreen Saeed, some rights reserved

## Tutorial Overview

This tutorial is divided into two parts; they are:

1. Definition and examples of vector valued functions
2. Differentiating vector valued functions

## Definition of a Vector Valued Function

A vector valued function is also called a vector function. It is a function with the following two properties:

1. The domain is a set of real numbers
2. The range is a set of vectors

Vector functions are, therefore, simply an extension of scalar functions, where both the domain and the range are the set of real numbers.

In this tutorial we’ll consider vector functions whose range is the set of two or three dimensional vectors. Hence, such functions can be used to define a set of points in space.

Given the unit vectors i,j,k parallel to the x,y,z-axis respectively, we can write a three dimensional vector valued function as:

r(t) = x(t)i + y(t)j + z(t)k

It can also be written as:

r(t) = <x(t), y(t), z(t)>

Both the above notations are equivalent and often used in various textbooks.

### Space Curves and Parametric Equations

We defined a vector function r(t) in the preceding section. For different values of t we get the corresponding (x,y,z) coordinates, defined by the functions x(t), y(t) and z(t). The set of generated points (x,y,z), therefore, define a curve called the space curve C. The equations for x(t), y(t) and z(t) are also called the parametric equations of the curve C.

## Examples of Vector Functions

This section shows some examples of vector valued functions that define space curves. All the examples are also plotted in the figure shown after the examples.

### 1.1 A Circle

Let’s start with a simple example of a vector function in 2D space:

r_1(t) = cos(t)i + sin(t)j

Here the parametric equations are:

x(t) = cos(t)

y(t) = sin(t)

The space curve defined by the parametric equations is a circle in 2D space as shown in the figure. If we vary t from -???? toÂ ????, we’ll generate all the points that lie on the circle.

### 1.2 A Helix

We can extend the r_1(t) function of example 1.1, to easily generate a helix in 3D space. We just need to add the value along the z axisÂ that changes with t. Hence, we have the following function:

r_2(t) = cos(t)i + sin(t)j + tk

### 1.3 A Twisted Cubic

We can also define a curve called the twisted cubic with an interesting shape as:

r_3(t) = ti + t^2j + t^3k

Parametric curves

### Want to Get Started With Calculus for Machine Learning?

Take my free 7-day email crash course now (with sample code).

Click to sign-up and also get a free PDF Ebook version of the course.

## Derivatives of Vector Functions

We can easily extend the idea of the derivative of a scalar function to the derivative of a vector function. As the range of a vector function is a set of vectors, its derivative is also a vector.

If

r(t) = x(t)i + y(t)j + z(t)k

then the derivative of r(t) is given by r'(t) computed as:

r'(t) = x'(t)i + y'(t)i + z'(t)k

## Examples of Derivatives of Vector Functions

We can find the derivatives of the functions defined in the previous example as:

### 2.1 A Circle

The parametricÂ equation of a circle in 2D is given by:

r_1(t) = cos(t)i + sin(t)j

Its derivative is therefore computed by computing the corresponding derivatives of x(t) and y(t) as shown below:

x'(t) = -sin(t)

y'(t) = cos(t)

This gives us:

r_1′(t) = x'(t)i + y'(t)j

r_1′(t) = -sin(t)i + cos(t)j

The space curve defined by the parametric equations is a circle in 2D space as shown in the figure. If we vary t from -???? to Ï€, we’ll generate all the points that lie on the circle.

### 2.2 A Helix

Similar to the previous example, we can compute the derivative of r_2(t) as:

r_2(t) = cos(t)i + sin(t)j + tk

r_2′(t) = -sin(t)i + cos(t)j + k

### 2.3 A Twisted Cubic

The derivative of r_3(t) is given by:

r_3(t) = ti + t^2j + t^3k

r_3′(t) = i + 2tj + 3t^2k

All the above examples are shown in the figure, where the derivatives are plotted in red. Note the circle’s derivative also defines a circle in space.

Parametric functions and their derivatives

## More Complex Examples

Once you gain a basic understanding of these functions, you can have a lot of fun defining various shapes and curves in space. Other popular examples used by the mathematical community are defined below and illustrated in the figure.

The toroidal spiral:

r_4(t) = (4 + sin(20t))cos(t)i + (4 + sin(20t))sin(t)j + cos(20t)k

The trefoil knot:

r_5(t) = (2 + cos(1.5t)cos (t)i + (2 + cos(1.5t))sin(t)j + sin(1.5t)k

The cardioid:

r_6(t) = cos(t)(1-cos(t))i + sin(t)(1-cos(t))j

More complex curves

## Importance of Vector Valued Functions in Machine Learning

Vector valued functions play an important role in machine learning algorithms. Being an extension of scalar valued functions, Â you would encounter them in tasks such as multi-class classification and multi-label problems. Kernel methods, an important area of machine learning, can involve computing vector valued functions, which can be later used in multi-task learning or transfer learning.

## Extensions

This section lists some ideas for extending the tutorial that you may wish to explore.

If you explore any of these extensions, I’d love to know. Post your findings in the comments below.

This section provides more resources on the topic if you are looking to go deeper.

### Books

• Thomasâ€™ Calculus, 14th edition, 2017. (based on the original works of George B. Thomas, revised by Joel Hass, Christopher Heil, Maurice Weir)
• Calculus, 3rd Edition, 2017. (Gilbert Strang)
• Calculus, 8th edition, 2015. (James Stewart)

## Summary

In this tutorial, you discovered what vector functions are and how to differentiate them.

Specifically, you learned:

• Definition of vector functions
• Parametric curves
• Differentiating vector functions

## Get a Handle on Calculus for Machine Learning!

#### Feel Smarter with Calculus Concepts

...by getting a better sense on the calculus symbols and terms

Discover how in my new Ebook:
Calculus for Machine Learning

It provides self-study tutorials with full working code on:
differntiation, gradient, Lagrangian mutiplier approach, Jacobian matrix, and much more...