Chapter 11
15 min read
Section 100 of 353

Finding Position from Velocity

Applications in Physics and Engineering (Integration)

Learning Objectives

By the end of this section, you will be able to:

  1. Understand the inverse relationship between differentiation and integration through the position-velocity connection
  2. Apply definite integration to find position when given a velocity function and initial conditions
  3. Interpret signed areas under velocity curves as displacements in specific directions
  4. Explain why initial conditions are essential when recovering position from velocity
  5. Connect this concept to real-world problems in physics, engineering, and data science
  6. Implement numerical integration to approximate position from discrete velocity data
Why This Matters: Finding position from velocity is one of the most fundamental applications of integration in physics and engineering. This exact technique powers GPS navigation systems, robotics motion planning, financial cumulative calculations, and even trajectory estimation in autonomous vehicles. Understanding this relationship unlocks the deep connection between rates of change and accumulated quantities.

The Big Picture

In differential calculus, we learned that if s(t)s(t) represents the position of an object at time tt, then its derivative s(t)=v(t)s'(t) = v(t) gives the instantaneous velocity. Differentiation answers the question: How fast is position changing?

Now we reverse the process. Given the velocity function v(t)v(t), can we recover the position function s(t)s(t)? This is the fundamental problem of integral calculus applied to kinematics, and the answer lies in the Fundamental Theorem of Calculus.

Historical Context

The relationship between distance and velocity was understood intuitively long before calculus was formalized. Ancient astronomers like Claudius Ptolemy (c. 100–170 AD) tabulated positions of planets over time, implicitly working with both position and velocity data.

Galileo Galilei (1564–1642) made the crucial insight that for a body falling under constant acceleration, the distance traveled is proportional to the square of time—essentially discovering that integrating a linear velocity gives a quadratic position. His work laid the groundwork for the kinematic equations we use today.

Isaac Newton and Gottfried Leibniz formalized this relationship in the Fundamental Theorem of Calculus, establishing that differentiation and integration are inverse operations. Newton's motivation was largely physical: he needed to understand planetary motion, where position, velocity, and acceleration are intimately connected.

The Core Insight

The key insight is this: velocity tells us how position is changing at each instant. If we know how fast something is moving throughout a time interval, we should be able to figure out how far it has traveled. The integral "accumulates" all these instantaneous changes to recover the total change in position.

Geometrically, the area under the velocity curve between two times t=at = a and t=bt = b equals the displacement (change in position) during that interval.


From Derivatives to Integrals

Let's trace the logical connection between what we know about derivatives and what we're trying to find with integrals.

The Differentiation Direction

Starting from position, we differentiate to get velocity:

s(t)differentiatev(t)=dsdts(t) \xrightarrow{\text{differentiate}} v(t) = \frac{ds}{dt}

For example:

  • If s(t)=t2s(t) = t^2, then v(t)=2tv(t) = 2t
  • If s(t)=sin(t)s(t) = \sin(t), then v(t)=cos(t)v(t) = \cos(t)
  • If s(t)=ets(t) = e^t, then v(t)=etv(t) = e^t

The Integration Direction

Now we reverse the process. Given velocity, we integrate to find position:

v(t)integrates(t)=s(t0)+t0tv(τ)dτv(t) \xrightarrow{\text{integrate}} s(t) = s(t_0) + \int_{t_0}^{t} v(\tau)\,d\tau

Notice that we need two pieces of information:

  1. The velocity function v(t)v(t)
  2. The initial position s(t0)s(t_0) at some reference time t0t_0

This is because indefinite integration introduces an arbitrary constant. The initial condition "pins down" which specific position function we're looking for among the infinitely many parallel curves.


The Mathematical Framework

Position from Velocity Formula: If an object has velocity v(t)v(t) and position s(t0)=s0s(t_0) = s_0 at time t0t_0, then its position at any time tt is:
s(t)=s0+t0tv(τ)dτs(t) = s_0 + \int_{t_0}^{t} v(\tau)\,d\tau

Understanding Each Component

ComponentMeaningPhysical Interpretation
s(t)Position at time tWhere the object is located at time t
s₀ = s(t₀)Initial positionThe starting point or reference position
v(τ)Velocity at time τHow fast the object is moving at time τ
∫ v(τ) dτIntegral of velocityAccumulated change in position (displacement)
τ (tau)Dummy variable of integrationRepresents time as we sum up contributions

Why This Works: The Fundamental Theorem

The Fundamental Theorem of Calculus tells us that if F(x)=f(x)F'(x) = f(x), then:

abf(x)dx=F(b)F(a)\int_a^b f(x)\,dx = F(b) - F(a)

Applied to kinematics: if s(t)=v(t)s'(t) = v(t) (velocity is the derivative of position), then:

t0tv(τ)dτ=s(t)s(t0)\int_{t_0}^{t} v(\tau)\,d\tau = s(t) - s(t_0)

Rearranging gives our formula: s(t)=s(t0)+t0tv(τ)dτs(t) = s(t_0) + \int_{t_0}^{t} v(\tau)\,d\tau.

Displacement vs. Position

It's important to distinguish between:

  • Displacement: The change in position, Δs=s(t)s(t0)=t0tv(τ)dτ\Delta s = s(t) - s(t_0) = \int_{t_0}^{t} v(\tau)\,d\tau. This can be positive, negative, or zero.
  • Position: The actual location, s(t)=s0+(displacement)s(t) = s_0 + \text{(displacement)}. This depends on where we started.
  • Distance traveled: The total path length, t0tv(τ)dτ\int_{t_0}^{t} |v(\tau)|\,d\tau. This is always non-negative.

Interactive: Position from Velocity

Use this interactive visualization to explore how position is recovered from velocity. You can:

  • Select different velocity functions representing various physical scenarios
  • Watch the position curve being traced as time progresses
  • See how the area under the velocity curve corresponds to displacement
  • Change the initial position to see how it shifts the entire position curve
  • Compare the exact displacement with Riemann sum approximations

Interactive: Position from Velocity Explorer

A car traveling at constant speed on a highway

Velocity v(t) — Area under curve = Displacement

Time t (seconds)Velocity v (m/s)3.5-0.5v(t) = 3 m/s

Position s(t) — The antiderivative of v(t)

s₀Time t (seconds)Position s (meters)33.0-3.0s(t) = s₀ + 3t
Current Velocity
3.00 m/s
Current Position
0.00 m
Exact Displacement
0.000 m
Riemann Approx.
0.000 m

Key Insight:

The shaded area under the velocity curve from t = 0 to the current time equals the displacement (change in position). The position function is the antiderivative of velocity:

s(t) = s₀ + ∫₀ᵗ v(τ) dτ


Worked Examples

Example 1: Constant Velocity

Problem: A train travels at a constant velocity of v(t)=25v(t) = 25 m/s. If it starts at position s(0)=100s(0) = 100 m, find its position at t=10t = 10 s.

Solution: Apply the position formula:

s(t)=s(0)+0t25dτ=100+25τ0t=100+25ts(t) = s(0) + \int_{0}^{t} 25\,d\tau = 100 + 25\tau\Big|_0^t = 100 + 25t

At t=10t = 10: s(10)=100+25(10)=350s(10) = 100 + 25(10) = 350 m.

Interpretation: This is just uniform motion. The train travels 250 m in 10 seconds, starting from 100 m, ending at 350 m. The area under the constant velocity line is simply 25×10=25025 \times 10 = 250 m.

Example 2: Constant Acceleration (Free Fall)

Problem: An object is dropped from rest at height s(0)=45s(0) = 45 m. Taking downward as positive and ignoring air resistance, its velocity is v(t)=gt=9.8tv(t) = gt = 9.8t m/s. Find when and where it hits the ground.

Solution: First, find the position function:

s(t)=s(0)+0t9.8τdτ=45+4.9τ20t=45+4.9t2s(t) = s(0) + \int_{0}^{t} 9.8\tau\,d\tau = 45 + 4.9\tau^2\Big|_0^t = 45 + 4.9t^2

Wait—this gives position increasing, but we started at height 45 m. Let's reconsider the coordinate system. If we measure height above ground (positive up), then velocity is negative (downward), so v(t)=9.8tv(t) = -9.8t.

s(t)=45+0t(9.8τ)dτ=454.9t2s(t) = 45 + \int_{0}^{t} (-9.8\tau)\,d\tau = 45 - 4.9t^2

The object hits the ground when s(t)=0s(t) = 0:

454.9t2=0t2=454.99.18t3.03 s45 - 4.9t^2 = 0 \quad\Rightarrow\quad t^2 = \frac{45}{4.9} \approx 9.18 \quad\Rightarrow\quad t \approx 3.03 \text{ s}

Answer: The object hits the ground at t3.03t \approx 3.03 s.

Example 3: Oscillatory Motion

Problem: A mass on a spring has velocity v(t)=2cos(t)v(t) = 2\cos(t) m/s with s(0)=0s(0) = 0 m. Find the position function and determine where the mass is at t=πt = \pi.

Solution:

s(t)=0+0t2cos(τ)dτ=2sin(τ)0t=2sin(t)0=2sin(t)s(t) = 0 + \int_{0}^{t} 2\cos(\tau)\,d\tau = 2\sin(\tau)\Big|_0^t = 2\sin(t) - 0 = 2\sin(t)

At t=πt = \pi: s(π)=2sin(π)=0s(\pi) = 2\sin(\pi) = 0 m.

Interpretation: The mass oscillates sinusoidally. At t=0t = 0 it starts at position 0. As tt increases to π/2\pi/2, velocity is positive so position increases to maximum s=2s = 2 m. Then velocity becomes negative, and by t=πt = \pi, the mass has returned to position 0.


Signed Areas and Direction of Motion

The integral v(t)dt\int v(t)\,dt gives a signed result. This is crucial for understanding motion:

Velocity SignArea ContributionEffect on Position
v(t) > 0Positive areaPosition increases (moving forward)
v(t) < 0Negative areaPosition decreases (moving backward)
v(t) = 0No areaPosition momentarily stationary

Example: Motion with Direction Change

Consider a particle with velocity v(t)=t2v(t) = t - 2 m/s and s(0)=5s(0) = 5 m.

  • For 0t<20 \leq t < 2: v(t)<0v(t) < 0, so the particle moves backward
  • At t=2t = 2: v(2)=0v(2) = 0, the particle momentarily stops
  • For t>2t > 2: v(t)>0v(t) > 0, the particle moves forward

The position function is:

s(t)=5+0t(τ2)dτ=5+τ222τ0t=5+t222ts(t) = 5 + \int_0^t (\tau - 2)\,d\tau = 5 + \frac{\tau^2}{2} - 2\tau\Big|_0^t = 5 + \frac{t^2}{2} - 2t

At t=2t = 2: s(2)=5+24=3s(2) = 5 + 2 - 4 = 3 m (minimum position).

The particle moved backward from s=5s = 5 to s=3s = 3 (displacement of 2-2 m), then continues forward.


The Role of Initial Conditions

Why do we need an initial condition? Consider the velocity v(t)=3t2v(t) = 3t^2. The indefinite integral is:

3t2dt=t3+C\int 3t^2\,dt = t^3 + C

The constant CC represents infinitely many possible position functions, all with the same velocity. Geometrically, these are parallel curves shifted vertically:

  • s(t)=t3s(t) = t^3 (passes through origin)
  • s(t)=t3+5s(t) = t^3 + 5 (starts 5 units higher)
  • s(t)=t310s(t) = t^3 - 10 (starts 10 units lower)

The initial condition s(t0)=s0s(t_0) = s_0 selects the unique curve passing through the point (t0,s0)(t_0, s_0).

Physical Intuition: Knowing how fast you're traveling (velocity) doesn't tell you where you are—it only tells you how your position is changing. You need a starting point to determine your actual location.

Real-World Applications

1. GPS Navigation and Dead Reckoning

When GPS signals are temporarily lost (e.g., in a tunnel), navigation systems use dead reckoning: integrating velocity (from wheel sensors or accelerometers) to estimate position changes. The last known GPS position serves as the initial condition.

2. Robotics and Autonomous Vehicles

Self-driving cars continuously integrate velocity measurements from encoders and IMUs (inertial measurement units) to track position. This is fused with sensor data using algorithms like Kalman filtering, which fundamentally relies on the position-velocity integration relationship.

3. Rocket Trajectory Analysis

During powered flight, rocket velocity changes continuously due to thrust and gravity. Engineers integrate the velocity profile to determine trajectory and landing location. The initial position is the launch pad coordinates.

4. Financial Cumulative Returns

In finance, if r(t)r(t) represents the instantaneous rate of return, the cumulative return (analogous to position) is:

R(T)=0Tr(t)dtR(T) = \int_0^T r(t)\,dt

Starting from an initial investment V0V_0, the portfolio value "position" evolves based on integrating returns.

5. Medical Dosing and Drug Concentration

If r(t)r(t) represents the rate at which a drug is absorbed into the bloodstream, the total drug concentration is the integral of this absorption rate. Initial condition is the drug level before dosing.


Connection to Machine Learning

The position-from-velocity concept appears in several machine learning contexts:

1. Cumulative Rewards in Reinforcement Learning

In RL, an agent receives rewards r(t)r(t) over time. The cumulative reward (return) is exactly an integral:

Gt=tγτtr(τ)dτG_t = \int_t^{\infty} \gamma^{\tau - t} r(\tau)\,d\tau

where γ\gamma is a discount factor. This is the "position" (cumulative value) given the "velocity" (instantaneous reward).

2. Neural ODEs (Ordinary Differential Equations)

Neural ODEs parameterize the derivative of hidden states: dhdt=fθ(h,t)\frac{dh}{dt} = f_\theta(h, t). To compute the hidden state at time TT, we integrate:

h(T)=h(0)+0Tfθ(h(t),t)dth(T) = h(0) + \int_0^T f_\theta(h(t), t)\,dt

This is exactly finding "position" (hidden state) from "velocity" (the neural network output).

3. Diffusion Models

In diffusion-based generative models, the score function xlogp(x)\nabla_x \log p(x) plays the role of "velocity" in data space. Sampling involves integrating a stochastic differential equation to move from noise to data—essentially recovering position from a learned velocity field.

4. Time Series Integration

When predicting future values of an integrated time series (like total sales from daily sales rates), models must account for the cumulative nature. LSTM networks with integration layers explicitly model this accumulation.


Python Implementation

Here's how to numerically integrate velocity to find position using Python:

Finding Position from Velocity in Python
🐍python
5

Define the velocity function. Here we use constant acceleration: v(t) = 2t + 3.

9

Set initial conditions: starting time, starting position, and ending time.

14

Analytical solution: integrate v(t) = 2t + 3 to get t² + 3t, add initial position s₀.

19

scipy.integrate.quad computes the definite integral numerically with high accuracy.

27

cumulative_trapezoid builds up the integral step by step - useful for plotting position over time.

33

Real-world function: integrate discrete velocity measurements from sensors using the trapezoidal rule.

43

Trapezoidal rule approximates area under curve between two points as a trapezoid.

49

Simulate noisy sensor data to demonstrate practical integration challenges.

89 lines without explanation
1import numpy as np
2import matplotlib.pyplot as plt
3from scipy import integrate
4
5# Define the velocity function
6def v(t):
7    """Velocity: v(t) = 2t + 3 (constant acceleration)"""
8    return 2*t + 3
9
10# Initial conditions
11t0 = 0          # Start time
12s0 = 5          # Initial position (meters)
13t_end = 5       # End time
14
15# Method 1: Analytical solution
16# s(t) = s0 + ∫[t0 to t] v(τ) dτ = s0 + ∫(2τ + 3)dτ = s0 + t² + 3t
17def s_exact(t):
18    return s0 + t**2 + 3*t
19
20# Method 2: Numerical integration with scipy.integrate.quad
21def s_numerical(t):
22    if t == t0:
23        return s0
24    displacement, _ = integrate.quad(v, t0, t)
25    return s0 + displacement
26
27# Method 3: Cumulative integration for array of times
28t_array = np.linspace(t0, t_end, 100)
29v_array = v(t_array)
30
31# Use cumulative trapezoidal rule
32displacement_array = integrate.cumulative_trapezoid(
33    v_array, t_array, initial=0
34)
35s_cumulative = s0 + displacement_array
36
37# Method 4: From discrete velocity measurements (sensor data)
38def integrate_discrete_velocity(times, velocities, s0):
39    """
40    Integrate discrete velocity measurements using trapezoidal rule.
41    Returns array of positions at each time point.
42    """
43    n = len(times)
44    positions = np.zeros(n)
45    positions[0] = s0
46
47    for i in range(1, n):
48        dt = times[i] - times[i-1]
49        # Trapezoidal rule: area = (v1 + v2)/2 * dt
50        displacement = (velocities[i-1] + velocities[i]) / 2 * dt
51        positions[i] = positions[i-1] + displacement
52
53    return positions
54
55# Simulate noisy sensor data
56np.random.seed(42)
57t_sensor = np.linspace(0, 5, 51)  # 10 Hz sampling
58v_sensor = v(t_sensor) + np.random.normal(0, 0.3, len(t_sensor))
59s_from_sensor = integrate_discrete_velocity(t_sensor, v_sensor, s0)
60
61# Visualize all methods
62fig, axes = plt.subplots(2, 1, figsize=(10, 8))
63
64# Plot 1: Velocity
65axes[0].plot(t_array, v(t_array), 'b-', linewidth=2, label='v(t) = 2t + 3')
66axes[0].scatter(t_sensor, v_sensor, c='orange', s=20, alpha=0.6,
67                label='Noisy measurements')
68axes[0].fill_between(t_array, 0, v(t_array), alpha=0.2, color='blue')
69axes[0].set_xlabel('Time (s)')
70axes[0].set_ylabel('Velocity (m/s)')
71axes[0].set_title('Velocity vs Time (Area = Displacement)')
72axes[0].legend()
73axes[0].grid(True, alpha=0.3)
74
75# Plot 2: Position
76axes[1].plot(t_array, s_exact(t_array), 'g-', linewidth=2,
77             label='Exact: s(t) = 5 + t² + 3t')
78axes[1].plot(t_array, s_cumulative, 'b--', linewidth=2,
79             label='Numerical (cumulative trapezoid)')
80axes[1].plot(t_sensor, s_from_sensor, 'r-', linewidth=1.5,
81             alpha=0.7, label='From noisy sensor data')
82axes[1].axhline(y=s0, color='gray', linestyle=':', label=f'Initial s₀ = {s0}')
83axes[1].set_xlabel('Time (s)')
84axes[1].set_ylabel('Position (m)')
85axes[1].set_title('Position vs Time (Integral of Velocity)')
86axes[1].legend()
87axes[1].grid(True, alpha=0.3)
88
89plt.tight_layout()
90plt.show()
91
92# Print comparison at t = 5
93print(f"At t = 5 s:")
94print(f"  Exact position:     {s_exact(5):.4f} m")
95print(f"  Numerical (quad):   {s_numerical(5):.4f} m")
96print(f"  Cumulative trapz:   {s_cumulative[-1]:.4f} m")
97print(f"  From sensor data:   {s_from_sensor[-1]:.4f} m")

Common Pitfalls

PitfallWhat Goes WrongHow to Avoid It
Forgetting initial conditionsGetting a family of curves instead of one specific positionAlways include s(t₀) = s₀ when setting up the problem
Confusing displacement with distanceNegative velocities cancel positive ones in displacementUse |v(t)| for total distance; signed integral for displacement
Wrong coordinate systemSigns get mixed up (e.g., up vs down positive)Establish coordinate system first; velocity sign should match direction
Integrating from wrong starting pointDisplacement calculated from wrong referenceAlways integrate from t₀ where you know s(t₀)
Numerical integration driftSmall errors accumulate over many time stepsUse higher-order methods (RK4), reset with external measurements
Units mismatchPosition in wrong unitsCheck: [velocity] × [time] = [distance]
Pro Tip: When velocity changes sign during your interval, split the integral at those times. This helps both in understanding the physics (direction changes) and avoiding computational issues.

Summary

In this section, we learned how to use integration to recover position from velocity—the fundamental inverse operation to differentiation in kinematics.

Key Formulas

FormulaMeaning
s(t) = s₀ + ∫[t₀ to t] v(τ) dτPosition from velocity with initial condition
Δs = ∫[a to b] v(t) dtDisplacement (signed change in position)
Distance = ∫[a to b] |v(t)| dtTotal path length (always non-negative)
v(t) = ds/dt ⟺ s = ∫v dt + CDifferentiation and integration are inverse operations

Key Concepts

  • The area under the velocity curve equals displacement
  • Positive velocity → position increasing; negative velocity → position decreasing
  • Initial conditions are essential to determine the specific position function
  • This relationship underlies GPS, robotics, financial models, and ML architectures

Problem-Solving Strategy

  1. Establish coordinates: Which direction is positive?
  2. Identify velocity function v(t)v(t) and initial condition s(t0)=s0s(t_0) = s_0
  3. Set up the integral: s(t)=s0+t0tv(τ)dτs(t) = s_0 + \int_{t_0}^{t} v(\tau)\,d\tau
  4. Evaluate the integral (analytically or numerically)
  5. Check your answer: Does the position function match known points?

Knowledge Check

Test your understanding of finding position from velocity:

Knowledge Check

Question 1 of 8

If a particle has velocity v(t) = 4t m/s and starts at position s(0) = 2 m, what is its position at t = 3 s?

Loading comments...