Defining and plotting a linear function
Graphical representation and interpretation of the direction coefficient
The graph of an affine function is a straight line
In a coordinate system, the graph of f(x) = a*x + b is a straight line (never a curve). This straight line intersects the y-axis at the point (0; b), which is why b is called the y-coordinate at the origin.
Role of the slope a
The number a indicates the slope of the straight line: by how much the line rises (or falls) when x increases by 1.
- If a > 0, the function is increasing (the line rises from left to right).
- If a < 0, the function is decreasing (the line falls).
- If a = 0, the function is constant (a horizontal line).
Calculating a from two points
If we know two points A(x1; y1) and B(x2; y2) on the line, where x1 is different from x2:
a = (y2 - y1) / (x2 - x1)
Example: A(1; 3) and B(4; 9). We calculate a = (9 - 3) / (4 - 1) = 6/3 = 2. The function is written as f(x) = 2x + b. Substituting A gives: 3 = 2 × 1 + b, so b = 1. Thus f(x) = 2x + 1.
Table of variations
| Sign of a | Change in f | Shape |
|---|---|---|
| a > 0 | increasing | rising |
| a < 0 | decreasing | falling |
| a = 0 | constant | horizontal |
Common pitfall
To plot a straight line, two points are sufficient (and you should always check a third one to be on the safe side). Also, be careful not to swap x and y in the formula for the slope: it is always (change in y) / (change in x), never the other way round.

