Math

Linear Function Graph (y = ax + b)

Enter slope a and intercept b to plot the graph of y = ax + b. Calculate y for any x value, and hover over the graph to check coordinates.

Tips

  • 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.

FAQ

A proportional function (y = ax) is a special case of a linear function (y = ax + b) where the intercept b = 0. The graph of a proportional function always passes through the origin (0, 0), while a linear function is shifted vertically by b units.

Set y = 0 and solve: 0 = ax + b gives x = −b ÷ a (when a ≠ 0). This tool calculates and displays the x-intercept automatically. When a = 0 (a horizontal line), the line is parallel to the x-axis and there is no x-intercept — the tool shows "None".

The graph becomes a horizontal line y = b. The value of y is constantly b regardless of x. When b = 0 as well, the graph coincides with the x-axis. Since the line is parallel to the x-axis, there is no x-intercept.

Yes. Just enter the slope a and intercept b to instantly see the graph. It's helpful for middle school and high school linear function topics. You can also calculate y for any x value, and check the x- and y-intercepts. Hovering over the graph shows the coordinates of any point.

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.