I've been learning about position vectors, and how their derivatives show the velocity (first derivative), and acceleration (second derivative) of a moving body.
From Mechanics I learned that, the area beneath the curve of the velocity vs time graph gives the displacement.
Now in Calculus I'm learning that, if you take the magnitude of the velocity vector you get the speed of the object. What I would like to know is how is this concept still true in more complex scenarios, where the acceleration of an object is not constant. For instance, take a look at the following graph. It is clear to me, that the area under the velocity curve is still equal to the displacement. But, how can you represent the speed of this object?
Velocity is a vector quantity. Imagine that a vector can be represented as an arrow. The arrow, then, has a direction and magnitude. Speed is the length of velocity's arrow, or in other words, speed is the magnitude of velocity. Formally, we can write this as
$$\text{velocity} = \vec{v}(t)$$ $$\text{speed} = |\vec{v}(t)|$$
In cases of nonconstant acceleration, the above still holds. The instantaneous velocity is $\vec{v}(t) = \frac{d\vec{r}(t)}{dt}$. You have likely seen one-dimensional examples, and in those cases we can say our object travels in the x-direction: $\hat{r}=\hat{x}$. In this case it is common to drop the vector notation and just write: $v_x(t) = \frac{dx}{dt}$
One way to visualize vectors is with a vector field plot. Say we wish to describe the velocity of the wind in some region. First we set up coordinate axes. Then at each point we place an arrow: the orientation indicates the wind's direction and the length represents the wind speed. In the picture below, we have such a vector field of wind velocity as a function of position at some given time. The picture depicts Hurricane Katrina.
image source