Linear function
A linear function is a straight line. Enter the slope and the y-intercept — or two points — and see the line, the table and the intercepts.
The explanation is shown. Quick: a and b or two points. Advanced: also the line of best fit through many points, the slope in several forms and a forecast.
Your numbers
More options: axes
Answer
The equation
y = 2x − 1
x-intercept
(0.5 ; 0)
y-intercept
(0 ; -1)
How to work it out
- 1y = 2x − 1
- 2x-intercept: 0 = 2x + -1 ⇒ x = 0.5
- 3y-intercept: (0 ; -1)
The formula
y = a · x + b
a is the slope: how much y rises when x increases by 1. b is where the line crosses the y-axis.
a = (y₂ − y₁) / (x₂ − x₁)
The slope from two points on the line.
a = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)², b = ȳ − a · x̄
The line of best fit through many points (least squares method — linear regression).
Table
| x | -3 | -2 | -1 | 0 | 1 | 2 | 3 |
|---|---|---|---|---|---|---|---|
| y | -7 | -5 | -3 | -1 | 1 | 3 | 5 |
In depth: more numbers and “what if”
The slope in several forms
| Size | Value |
|---|---|
| Slope a | 2 |
| As a percentage | 200 % |
| Angle of inclination | 63.4° |
| Slope of a perpendicular line | -0.5 |
More: Equations and functions
- EquationsSolve equations and inequalities step by step — and isolate a quantity in a formula.
- Formula with three quantitiesThe formula triangle: find the third quantity in A = B · C — e.g. U = R · I.
- FunctionsQuadratic function, inverse proportionality and power function — with a graph.
- Scale and ratiosFrom drawing to reality, area and volume to scale, the rule of three and dividing in a ratio.
- Two equations with two unknownsSolve a system of equations step by step and see the intersection on the graph.
- Growth and decayPercentage growth, the growth rate from two measurements, and doubling time.