Here’s a realistic integration problem with a $Python$ solution and graphical representation:
Problem
A car is accelerating from rest along a straight road. The acceleration $ a(t) $ (in $ \text{m/s}^2 $) as a function of time $ t $ (in seconds) is given by:
$$
a(t) = 3t - 0.2t^2 \quad \text{for } 0 \leq t \leq 15.
$$
- Find the velocity $ v(t) $ of the car as a function of time by integrating the acceleration.
- Calculate the total distance traveled by the car in the $15$-second interval by integrating the velocity.
- Visualize $ a(t) $, $ v(t) $, and the distance $ s(t) $ on a graph.
Solution Explanation
Integration of Acceleration:
Velocity is the integral of acceleration:
$$
v(t) = \int a(t) , dt + C,
$$
where $ C $ is the integration constant. Since the car starts from rest $( v(0) = 0 $), $ C = 0 $.Integration of Velocity:
Distance is the integral of velocity:
$$
s(t) = \int v(t) , dt.
$$Visualization:
Plot $ a(t) $, $ v(t) $, and $ s(t) $ on the same graph to understand how acceleration, velocity, and distance evolve over time.
Python Implementation
1 | import numpy as np |
Explanation of Code
- Acceleration Function:
$ a(t) = 3t - 0.2t^2 $ defines the instantaneous acceleration. - Integration:
scipy.integrate.quadis used for numerical integration of $ a(t) $ and $ v(t) $.
- Visualization:
- All three functions $ a(t), v(t), s(t) $ are plotted together for easy comparison.
- Total Distance:
- The result of $ s(15) $ gives the total distance traveled by the car in $15$ seconds.
Expected Output

This graph illustrates the relationship between acceleration, velocity, and distance over time for a car accelerating along a straight road:
Red Curve (Acceleration, $ a(t) $):
- The car’s acceleration starts at a high value, increases initially, and then decreases to zero at $ t = 15 $ seconds. This indicates the car is initially speeding up but stops accelerating as $ t $ approaches $15$ seconds.
Blue Curve (Velocity, $ v(t) $):
- Velocity increases over time, but the rate of increase slows down as acceleration decreases. This reflects that while the car continues to gain speed, it does so more gradually as $ t $ approaches $15$ seconds.
Green Curve (Distance, $ s(t) $):
- The distance traveled by the car increases monotonically and steeply. The curvature reflects the combined effect of velocity and acceleration, resulting in greater distances covered as time progresses.
Total Distance Traveled:
- The text at the bottom indicates the total distance traveled by the car in $15$ seconds, which is approximately 843.75 meters.
This visualization effectively demonstrates how changes in acceleration impact velocity and how these two factors contribute to the total distance covered by the car.








