TExcelTAD
Home › Calculus in Depth › Derivatives and Integrals of Vector Functions

Derivatives and Integrals of Vector Functions

The derivative of a vector function is again a vector: it points along the curve and its length is the speed at which the curve is traced. This lesson defines it as a limit, proves that it can be computed component by component, establishes the product rules for dot and cross products, and integrates vector functions to recover positions from velocities.

For a first look at velocity vectors along curves, see Motion; the plane case is in Calculus with Parametric Curves.

The derivative

For a vector function r\mathbf{r}, define

r′(t)=drdt=lim⁡h→0r(t+h)−r(t)h\mathbf{r}'(t) = \frac{d\mathbf{r}}{dt} = \lim_{h \to 0} \frac{\mathbf{r}(t + h) - \mathbf{r}(t)}{h}

when the limit exists. Geometrically, r(t+h)−r(t)\mathbf{r}(t + h) - \mathbf{r}(t) is a secant vector from one point of the curve to a nearby one; dividing by hh rescales it, and as h→0h \to 0 it turns into the tangent vector r′(t)\mathbf{r}'(t).

Theorem (componentwise). If r(t)=⟨f(t),g(t),h(t)⟩\mathbf{r}(t) = \langle f(t), g(t), h(t) \rangle with f,g,hf, g, h differentiable, then r′(t)=⟨f′(t),g′(t),h′(t)⟩\mathbf{r}'(t) = \langle f'(t), g'(t), h'(t) \rangle.

Proof: the difference quotient is

r(t+Δ)−r(t)Δ=⟨f(t+Δ)−f(t)Δ,g(t+Δ)−g(t)Δ,h(t+Δ)−h(t)Δ⟩\frac{\mathbf{r}(t + \Delta) - \mathbf{r}(t)}{\Delta} = \left\langle \frac{f(t+\Delta) - f(t)}{\Delta}, \frac{g(t+\Delta) - g(t)}{\Delta}, \frac{h(t+\Delta) - h(t)}{\Delta} \right\rangle

and the limit of a vector function is the vector of component limits.

Vocabulary:

Term Definition
tangent vector at P=r(t)P = \mathbf{r}(t) r′(t)\mathbf{r}'(t), provided r′(t)\mathbf{r}'(t) exists and r′(t)≠0\mathbf{r}'(t) \ne \mathbf{0}
unit tangent vector T(t)=r′(t)/∥r′(t)∥\mathbf{T}(t) = \mathbf{r}'(t) / \lVert \mathbf{r}'(t) \rVert
tangent line at PP the line through PP with direction r′(t)\mathbf{r}'(t): L(s)=r(t)+s r′(t)\mathbf{L}(s) = \mathbf{r}(t) + s\,\mathbf{r}'(t)
smooth parametrisation r′\mathbf{r}' is continuous and r′(t)≠0\mathbf{r}'(t) \ne \mathbf{0} on the interval
piecewise smooth made of finitely many smooth pieces joined continuously

The condition r′≠0\mathbf{r}' \ne \mathbf{0} matters. ⟨t3,t2,0⟩\langle t^3, t^2, 0 \rangle is differentiable everywhere, but r′(0)=0\mathbf{r}'(0) = \mathbf{0} and the curve (a semicubical parabola) has a sharp cusp at the origin. A zero derivative lets a curve turn on the spot, so "differentiable" alone does not mean "no corners".

python · try it yourself
import sympy as sp

t = sp.symbols("t")
r = sp.Matrix([sp.exp(t), t * sp.cos(t), 1 + t**2])
dr = r.diff(t)
print("r'(t) =", list(dr))

t0 = 0
P, v = r.subs(t, t0), dr.subs(t, t0)
T = v / v.norm()
print("point P =", list(P), " r'(0) =", list(v))
print("unit tangent T(0) =", list(sp.simplify(T)))

s = sp.symbols("s")
print("tangent line L(s) =", list(P + s * v))
r'(t) = [exp(t), -t*sin(t) + cos(t), 2*t]
point P = [1, 0, 1]  r'(0) = [1, 1, 0]
unit tangent T(0) = [sqrt(2)/2, sqrt(2)/2, 0]
tangent line L(s) = [s + 1, s, 1]

The second derivative is r′′=(r′)′\mathbf{r}'' = (\mathbf{r}')'; for a moving particle r′\mathbf{r}' is velocity and r′′\mathbf{r}'' acceleration (next lessons).

Differentiation rules

Let u,v\mathbf{u}, \mathbf{v} be differentiable vector functions, cc a scalar, ff a differentiable real function.

1. [u+v]′=u′+v′2. [c u]′=c u′3. [f u]′=f′ u+f u′4. [u⋅v]′=u′⋅v+u⋅v′5. [u×v]′=u′×v+u×v′(order matters!)6. [u(f(t))]′=f′(t) u′(f(t))(chain rule)\begin{aligned} \text{1. } [\mathbf{u} + \mathbf{v}]' &= \mathbf{u}' + \mathbf{v}' \\ \text{2. } [c\,\mathbf{u}]' &= c\,\mathbf{u}' \\ \text{3. } [f\,\mathbf{u}]' &= f'\,\mathbf{u} + f\,\mathbf{u}' \\ \text{4. } [\mathbf{u} \cdot \mathbf{v}]' &= \mathbf{u}' \cdot \mathbf{v} + \mathbf{u} \cdot \mathbf{v}' \\ \text{5. } [\mathbf{u} \times \mathbf{v}]' &= \mathbf{u}' \times \mathbf{v} + \mathbf{u} \times \mathbf{v}' && \text{(order matters!)} \\ \text{6. } [\mathbf{u}(f(t))]' &= f'(t)\,\mathbf{u}'(f(t)) && \text{(chain rule)} \end{aligned}

Proof of rule 4: write u=⟨u1,u2,u3⟩\mathbf{u} = \langle u_1, u_2, u_3 \rangle, v=⟨v1,v2,v3⟩\mathbf{v} = \langle v_1, v_2, v_3 \rangle. Then u⋅v=∑uivi\mathbf{u} \cdot \mathbf{v} = \sum u_i v_i is a real function, and by the ordinary product rule

(u⋅v)′=∑(ui′vi+uivi′)=u′⋅v+u⋅v′(\mathbf{u} \cdot \mathbf{v})' = \sum (u_i' v_i + u_i v_i') = \mathbf{u}' \cdot \mathbf{v} + \mathbf{u} \cdot \mathbf{v}'

Rule 5 has the same proof applied to each component of the cross product (each is a sum of products like u2v3−u3v2u_2v_3 - u_3v_2); the order of factors is kept because the cross product is anticommutative.

Corollary (constant length ⇒\Rightarrow perpendicular). If ∥r(t)∥=c\lVert \mathbf{r}(t) \rVert = c for all tt, then r′(t)⊥r(t)\mathbf{r}'(t) \perp \mathbf{r}(t).

r⋅r=c2(constant)differentiate: r′⋅r+r⋅r′=2 r⋅r′=0so r(t)⋅r′(t)=0\begin{aligned} &\mathbf{r} \cdot \mathbf{r} = c^2 && \text{(constant)} \\ &\text{differentiate: } \mathbf{r}' \cdot \mathbf{r} + \mathbf{r} \cdot \mathbf{r}' = 2\,\mathbf{r} \cdot \mathbf{r}' = 0 \\ &\text{so } \mathbf{r}(t) \cdot \mathbf{r}'(t) = 0 \end{aligned}

A curve on a sphere centred at the origin always moves tangent to the sphere. Applied to the unit tangent (∥T∥=1\lVert \mathbf{T} \rVert = 1), it gives T′⊥T\mathbf{T}' \perp \mathbf{T}, which is how the normal vector is defined in Arc Length and Curvature. Applied to velocity, a particle moving at constant speed has acceleration perpendicular to its velocity.

python · try it yourself
import sympy as sp

t = sp.symbols("t", real=True)
# a curve on the sphere of radius 3 (a "baseball seam"-like path)
r = 3 * sp.Matrix([sp.cos(t) * sp.cos(sp.sin(2*t)), sp.sin(t) * sp.cos(sp.sin(2*t)), sp.sin(sp.sin(2*t))])
print("|r|^2 simplifies to:", sp.simplify(r.dot(r)))
print("r . r' simplifies to:", sp.simplify(r.dot(r.diff(t))))

u = sp.Matrix([t, t**2, 1])
v = sp.Matrix([sp.sin(t), 0, t])
lhs = u.cross(v).diff(t)
rhs = u.diff(t).cross(v) + u.cross(v.diff(t))
print("cross-product rule holds:", sp.simplify(lhs - rhs) == sp.zeros(3, 1))
|r|^2 simplifies to: 9
r . r' simplifies to: 0
cross-product rule holds: True

Integrals

Integrals are also taken componentwise:

∫abr(t) dt=⟨∫abf(t) dt,∫abg(t) dt,∫abh(t) dt⟩\int_a^b \mathbf{r}(t)\,dt = \left\langle \int_a^b f(t)\,dt, \int_a^b g(t)\,dt, \int_a^b h(t)\,dt \right\rangle

This agrees with the Riemann-sum definition lim⁡∑r(ti∗) Δt\lim \sum \mathbf{r}(t_i^*)\,\Delta t, since a sum of vectors is summed by components. The Fundamental Theorem of Calculus carries over: if R′=r\mathbf{R}' = \mathbf{r} then ∫abr(t) dt=R(b)−R(a)\int_a^b \mathbf{r}(t)\,dt = \mathbf{R}(b) - \mathbf{R}(a). Indefinite integrals have a constant vector C\mathbf{C} instead of a constant number, and one initial condition (a vector) fixes all three constants at once.

python · try it yourself
import sympy as sp

t = sp.symbols("t")
v = sp.Matrix([2 * t, sp.cos(t), 1 / (1 + t)])      # velocity
r0 = sp.Matrix([1, 0, -2])                          # position at t = 0

R = v.applyfunc(lambda c: sp.integrate(c, (t, 0, t)))  # ∫₀ᵗ v
r = r0 + R
print("r(t) =", list(r))
print("check r'(t) == v(t):", sp.simplify(r.diff(t) - v) == sp.zeros(3, 1))
print("displacement over [0, pi]:", list(R.subs(t, sp.pi)))
r(t) = [t**2 + 1, sin(t), log(t + 1) - 2]
check r'(t) == v(t): True
displacement over [0, pi]: [pi**2, 0, log(1 + pi)]

Note: Integration does not commute with taking lengths: ∥∫r dt∥≤∫∥r∥ dt\left\lVert \int \mathbf{r}\,dt \right\rVert \le \int \lVert \mathbf{r} \rVert\,dt, with equality only when r\mathbf{r} keeps a fixed direction. Applied to velocity, this says displacement is at most the distance travelled.

In software

  • Tangents for orientation. Games orient a vehicle, a camera on a rail or a projectile's sprite along T=r′/∥r′∥\mathbf{T} = \mathbf{r}'/\lVert \mathbf{r}' \rVert. A zero derivative (a "stopped" spline segment, two equal control points of a Bézier curve) makes T\mathbf{T} undefined, the source of sudden flips; engines guard it with a fallback direction.
  • Smoothness classes. Splines are judged by which derivatives are continuous across joints: C0C^0 (no gaps), C1C^1 (no kinks in velocity), C2C^2 (no jumps in acceleration, felt as jerks in a camera move). Catmull-Rom splines are C1C^1; cubic B-splines are C2C^2.
  • Velocity to position. Physics engines integrate velocity to get position each frame, a numerical version of r(t)=r0+∫v dt\mathbf{r}(t) = \mathbf{r}_0 + \int \mathbf{v}\,dt; see Integrators.
  • Automatic differentiation. Libraries like JAX or PyTorch differentiate vector-valued functions with exactly the componentwise rule; for f:R→Rnf: \mathbb{R} \to \mathbb{R}^n the derivative is a column of nn partial derivatives (a Jacobian with one column).

Exercises

Exercise 1: Derivative and unit tangent

For r(t)=⟨t2,e2t,tsin⁡t⟩\mathbf{r}(t) = \langle t^2, e^{2t}, t\sin t \rangle, find r′(t)\mathbf{r}'(t) and T(0)\mathbf{T}(0).

Answer

r′(t)=⟨2t,2e2t,sin⁡t+tcos⁡t⟩\mathbf{r}'(t) = \langle 2t, 2e^{2t}, \sin t + t\cos t \rangle; T(0)=⟨0,1,0⟩\mathbf{T}(0) = \langle 0, 1, 0 \rangle.

Solution
ddt t2=2tddt e2t=2e2tddt tsin⁡t=sin⁡t+tcos⁡t(product rule)r′(0)=⟨0,2,0⟩,∥r′(0)∥=2,T(0)=⟨0,1,0⟩\begin{aligned} \tfrac{d}{dt}\, t^2 &= 2t \\ \tfrac{d}{dt}\, e^{2t} &= 2e^{2t} \\ \tfrac{d}{dt}\, t\sin t &= \sin t + t\cos t && \text{(product rule)} \\ \mathbf{r}'(0) &= \langle 0, 2, 0 \rangle, \quad \lVert \mathbf{r}'(0) \rVert = 2, \quad \mathbf{T}(0) = \langle 0, 1, 0 \rangle \end{aligned}

Exercise 2: Tangent line

Find the tangent line to r(t)=⟨1+t3,te−t,sin⁡2t⟩\mathbf{r}(t) = \langle 1 + t^3, te^{-t}, \sin 2t \rangle at the point (1,0,0)(1, 0, 0).

Answer

L(s)=⟨1,s,2s⟩\mathbf{L}(s) = \langle 1, s, 2s \rangle.

Solution

(1,0,0)(1, 0, 0) is r(0)\mathbf{r}(0). r′(t)=⟨3t2,e−t(1−t),2cos⁡2t⟩\mathbf{r}'(t) = \langle 3t^2, e^{-t}(1 - t), 2\cos 2t \rangle, so r′(0)=⟨0,1,2⟩\mathbf{r}'(0) = \langle 0, 1, 2 \rangle. The line is (1,0,0)+s⟨0,1,2⟩(1, 0, 0) + s\langle 0, 1, 2 \rangle.

Exercise 3: A definite integral

Evaluate ∫01⟨3t2,1/(1+t),e2t⟩ dt\int_0^1 \langle 3t^2, 1/(1 + t), e^{2t} \rangle\,dt.

Answer

⟨1,ln⁡2,(e2−1)/2⟩≈⟨1,0.6931,3.1945⟩\langle 1, \ln 2, (e^2 - 1)/2 \rangle \approx \langle 1, 0.6931, 3.1945 \rangle.

Solution
∫013t2 dt=[t3]01=1∫0111+t dt=[ln⁡(1+t)]01=ln⁡2∫01e2t dt=[e2t/2]01=(e2−1)/2\begin{aligned} \int_0^1 3t^2\,dt &= \Big[t^3\Big]_0^1 = 1 \\ \int_0^1 \frac{1}{1+t}\,dt &= \Big[\ln(1+t)\Big]_0^1 = \ln 2 \\ \int_0^1 e^{2t}\,dt &= \Big[e^{2t}/2\Big]_0^1 = (e^2 - 1)/2 \end{aligned}
python · try it yourself
import sympy as sp
t = sp.symbols("t")
res = [sp.integrate(c, (t, 0, 1)) for c in [3*t**2, 1/(1 + t), sp.exp(2*t)]]
print(res, [round(float(x), 4) for x in res])
[1, log(2), -1/2 + exp(2)/2] [1.0, 0.6931, 3.1945]

Exercise 4: Constant speed

Prove: if a particle moves with constant speed, ∥r′(t)∥=c\lVert \mathbf{r}'(t) \rVert = c, then its acceleration is perpendicular to its velocity.

Answer

r′′(t)⋅r′(t)=0\mathbf{r}''(t) \cdot \mathbf{r}'(t) = 0 for all tt.

Solution

Apply the corollary to the vector function r′\mathbf{r}' instead of r\mathbf{r}:

r′⋅r′=c2ddt: r′′⋅r′+r′⋅r′′=2 r′⋅r′′=0\begin{aligned} &\mathbf{r}' \cdot \mathbf{r}' = c^2 \\ &\tfrac{d}{dt}:\ \mathbf{r}'' \cdot \mathbf{r}' + \mathbf{r}' \cdot \mathbf{r}'' = 2\,\mathbf{r}' \cdot \mathbf{r}'' = 0 \end{aligned}

So the acceleration can only change the direction of motion, not the speed, the situation of uniform circular motion.

Exercise 5: Derivative of a triple product (code)

Show that ddt[u⋅(v×w)]=u′⋅(v×w)+u⋅(v′×w)+u⋅(v×w′)\frac{d}{dt} [\mathbf{u} \cdot (\mathbf{v} \times \mathbf{w})] = \mathbf{u}' \cdot (\mathbf{v} \times \mathbf{w}) + \mathbf{u} \cdot (\mathbf{v}' \times \mathbf{w}) + \mathbf{u} \cdot (\mathbf{v} \times \mathbf{w}'), and check it with SymPy for u=⟨t,1,0⟩\mathbf{u} = \langle t, 1, 0 \rangle, v=⟨0,t2,1⟩\mathbf{v} = \langle 0, t^2, 1 \rangle, w=⟨1,0,et⟩\mathbf{w} = \langle 1, 0, e^t \rangle.

Answer

Here u⋅(v×w)=t3et+1\mathbf{u} \cdot (\mathbf{v} \times \mathbf{w}) = t^3e^t + 1, and both sides equal 3t2et+t3et3t^2e^t + t^3e^t. The identity follows from rules 4 and 5.

Solution

By rule 4, [u⋅(v×w)]′=u′⋅(v×w)+u⋅(v×w)′[\mathbf{u} \cdot (\mathbf{v} \times \mathbf{w})]' = \mathbf{u}' \cdot (\mathbf{v} \times \mathbf{w}) + \mathbf{u} \cdot (\mathbf{v} \times \mathbf{w})', and by rule 5, (v×w)′=v′×w+v×w′(\mathbf{v} \times \mathbf{w})' = \mathbf{v}' \times \mathbf{w} + \mathbf{v} \times \mathbf{w}'. Distribute the dot product.

python · try it yourself
import sympy as sp
t = sp.symbols("t")
u, v, w = sp.Matrix([t, 1, 0]), sp.Matrix([0, t**2, 1]), sp.Matrix([1, 0, sp.exp(t)])
lhs = sp.expand(u.dot(v.cross(w)).diff(t))
rhs = sp.expand(u.diff(t).dot(v.cross(w)) + u.dot(v.diff(t).cross(w)) + u.dot(v.cross(w.diff(t))))
print(lhs, "|", sp.simplify(lhs - rhs))
t**3*exp(t) + 3*t**2*exp(t) | 0

Test yourself

If ∥r(t)∥\lVert \mathbf{r}(t) \rVert is constant, which statement is always true?

  1. r′(t)=0\mathbf{r}'(t) = \mathbf{0}
  2. r′(t)\mathbf{r}'(t) is parallel to r(t)\mathbf{r}(t)
  3. r(t)⋅r′(t)=0\mathbf{r}(t) \cdot \mathbf{r}'(t) = 0
  4. ∥r′(t)∥\lVert \mathbf{r}'(t) \rVert is constant

What is the correct derivative of u(t)×v(t)\mathbf{u}(t) \times \mathbf{v}(t)?

  1. u′×v′\mathbf{u}' \times \mathbf{v}'
  2. u′×v+u×v′\mathbf{u}' \times \mathbf{v} + \mathbf{u} \times \mathbf{v}'
  3. v′×u+v×u′\mathbf{v}' \times \mathbf{u} + \mathbf{v} \times \mathbf{u}'
  4. u′⋅v+u⋅v′\mathbf{u}' \cdot \mathbf{v} + \mathbf{u} \cdot \mathbf{v}'

r(t)=⟨t3,t2,0⟩\mathbf{r}(t) = \langle t^3, t^2, 0 \rangle is differentiable everywhere. Why is it not a smooth parametrisation near t=0t = 0?

  1. Because r(0)=0\mathbf{r}(0) = \mathbf{0}
  2. Because r′(0)=0\mathbf{r}'(0) = \mathbf{0}, so the curve can form a cusp
  3. Because its components are polynomials
  4. Because r′′\mathbf{r}'' does not exist