Linear Function Grapher y = ax + b (Free Online Tool)
Free tool to plot y = ax + b instantly. Enter slope a and intercept b, calculate y for any x, and hover the graph to read exact coordinates.
What the graph of a linear function is
A linear function is written y = ax + b, and its graph is always a straight line. The a is the slope, which settles how much y changes when x increases by one; the b is the intercept, which settles the height at which the line crosses the y-axis. Fix those two numbers and the line is fixed with them, which is why drawing one needs no more than a slope and an intercept.
This tool draws the line from just those two figures and works out the y-intercept and the x-intercept alongside it. The x-intercept comes from solving y = 0, that is x = −b ÷ a; when the slope is zero the line runs parallel to the x-axis, so “none” is shown instead. Enter any x and the y at that point is calculated too, and hovering over the graph brings up the coordinates at that position in a tooltip. The range of x on display can be changed, so you can zoom in near the origin or look at a region well away from the intercept.
How to use the linear graph
- Enter the slope and the intercept Put in a and b and the line is drawn at once. A negative a gives a line that falls from left to right.
- Set the range of x Give xMin and xMax to show only the stretch you want to see. If xMin is not below xMax there is no range to speak of, and an error says so.
- Find y for a particular x Type a number into the x field and the matching y is calculated — more exact than reading it off the graph by eye.
- Check the intercepts The y-intercept and the x-intercept appear on their own. On a horizontal line, where the slope is zero, there is no crossing of the x-axis, so the x-intercept reads “none”.
- Read coordinates off the graph Hover over the line and the point’s (x, y) appears in a tooltip — handy when you want a rough value quickly.
Tips for getting more out of it
- Slope a represents how much y changes when x increases by 1. If a > 0, the line slopes upward; if a < 0, it slopes downward.
- Intercept b is the point where the graph crosses the y-axis (the y-intercept). It equals the value of y when x = 0.
- The x-intercept (where the graph crosses the x-axis) is found by solving y = 0: x = −b ÷ a. If a = 0, there is no intersection (horizontal line), unless b = 0, in which case y = 0 (along the x-axis).
- Hover over the graph to see the (x, y) coordinates of that point in a tooltip. To find y for a specific x, enter the x value in the input field on the left.
Where the linear graph helps
Studying school mathematics
Redraw the line while changing the slope or the intercept a little at a time and you can see with your own eyes how a change in the numbers shows up in the line’s direction and position. It also serves for checking textbook exercises.
Marking your own homework
Confirm whether the x-intercept and y-intercept you worked out, or the y for a particular x, come to the same thing.
Projecting anything that grows at a steady rate
A tariff of “b as a standing charge plus a per unit”, or a distance covered at a constant speed, is a linear function: anything that rises in proportion can be written this way.
Examining how two lines relate
Keep the slope and change only the intercept and the lines run parallel; change the sign of the slope and the way they meet changes. It helps in seeing that the solution of a pair of simultaneous equations is the point where they cross.
Comparing with a curve
To set it against a curve, use the quadratic graph; to go a degree higher still, the cubic graph.
Terms used with linear functions
- Linear function
- A function of the form y = ax + b with a not zero. It takes its name from x appearing to the first power, and its graph is always a straight line.
- Slope
- The a in the formula: the rise in y when x increases by one. Positive, the line rises to the right; negative, it falls; zero, it is horizontal. The larger the magnitude, the steeper the line.
- y-intercept
- The y-coordinate of the point at which the graph meets the y-axis, which is the b in the formula. It is the same as the value of y when x is set to zero.
- x-intercept
- The x-coordinate of the point at which the graph meets the x-axis. Solving y = 0 gives x = −b ÷ a. When the slope is zero the line is parallel to the x-axis, so no such point exists.
- Direct proportion
- A function of the form y = ax — a linear function whose intercept is zero. Its graph always passes through the origin, and a linear function can be seen as that graph shifted b along the y-axis.
- Rate of change
- The ratio of the increase in y to the increase in x. In a linear function it is the same wherever you measure it, and that value is exactly the slope a.
FAQ
Side Note — Why a Linear Function Is Called "Linear"
The function y = ax + b is called a "linear function" because its graph is always a straight line. The word "linear" comes from the Latin "linearis," meaning "of a line." Strictly speaking, mathematicians sometimes distinguish "linear" (b = 0, passing through the origin) from "affine" (b ≠ 0), but in everyday usage and in most school curricula, both are called linear functions.
Linear functions are used as foundational models in physics, economics, statistics, and many other fields. For example, "if you travel at 60 km/h, the distance y after t hours is y = 60t" is a linear function with slope 60 and intercept 0. Linear regression (least squares) is also a technique for finding the best-fitting linear function y = ax + b for a given dataset.