Let's start with the idea of line's slope, or its rate of change. For instance, let's look at this graph of a car's position as it drives along a road (x is time in hours; y is the car's distance from the middle of the road, in miles).

The above line's slope is, of course, 2, so we can say that the car is travelling at 2 mph.

What if the car changes speed?

We can't give a slope for the entire graph, but if we look at the graph it's pretty clear that it has different slopes at different points. On the left half the slope is 0.5, and on the slope is 2. In other words, on the left half of the graph the car is travelling at 0.5 mph, and on the right half it is travelling at 2 mph.

In this case, the different slopes are pretty clear. But a more formal definition is useful in other cases: when a graph has no single slope, we can talk about the slope that we would get if we extend one part of the graph out into an infinite line, like this:

What if the car's movement looked like this?

While the graph has no single slope, the car still has a speed at each point. To see that speed, we can do something similar to the last graph, by drawing a line that touches the graph at a specific point. Also, note that when the car is going backwards, its speed is negative.

Try dragging the orange dot to see the slope at different points.

OK, so now we have a way to find the car's speed at a specific point. We can now graph the car's speed:

The green line here represents the slope of the blue line, or the speed of the car. Note that when the car is going backwards, the car's speed is negative, and when the car is going forwards, the car's speed is positive.

If we call the car's position at at time x (the blue line) f(x), then the car's speed at x (the green line) is called f'(x). In other words, f'(x) is the rate of change of f. This is also called the derivative of f.