Slope & Quadratic Equation Calculator

Two essential math tools in one: find the slope of a line between two points (with the full line equation), and solve any quadratic equation ax² + bx + c = 0 using the quadratic formula — with the discriminant and complex roots shown step by step.

How the slope calculator works

The slope (or gradient) of a straight line measures how steep it is — how much y changes for each step in x. Given two points (x₁, y₁) and (x₂, y₂), the slope is the “rise over run”:

Slope m = (y₂ − y₁) ÷ (x₂ − x₁)  •  Line: y = mx + b, where b = y₁ − m·x₁

This calculator also returns the y-intercept and the full equation of the line, so you can drop it straight into homework or a graph. A slope of 0 is a flat horizontal line; a vertical line (when x₁ = x₂) has an undefined slope because you can’t divide by zero — the tool tells you when that happens.

How the quadratic formula works

A quadratic equation has the form ax² + bx + c = 0. The quadratic formula finds its roots (the values of x that make it true):

x = (−b ± √(b² − 4ac)) ÷ 2a  •  Discriminant D = b² − 4ac

The discriminant D tells you what to expect before you even finish: if D > 0 there are two different real roots; if D = 0 there’s one repeated real root; and if D < 0 the roots are complex (they include the imaginary unit i = √−1). This solver handles all three cases and shows the complex roots in the form p ± qi.

Worked examples

Slope: for (1, 2) and (4, 11), m = (11 − 2) ÷ (4 − 1) = 9 ÷ 3 = 3, and b = 2 − 3 × 1 = −1, so the line is y = 3x − 1. Quadratic: for x² − 3x + 2 = 0, D = (−3)² − 4·1·2 = 9 − 8 = 1, so x = (3 ± 1) ÷ 2 = 2 or 1.

Discriminant DRootsMeaning
D > 0Two real, distinctParabola crosses x-axis twice
D = 0One real (repeated)Parabola touches x-axis once
D < 0Two complexParabola never touches x-axis

For a quadratic, a must not be 0 — otherwise the equation is linear, not quadratic.

Frequently asked questions

How do I find the slope between two points?

Slope m = (y2 − y1) ÷ (x2 − x1). For (1, 2) and (4, 11), m = 9 ÷ 3 = 3.

What is the equation of a line from two points?

Find m, then y = mx + b with b = y1 − m·x1. For (1, 2) and (4, 11): y = 3x − 1.

How do I solve a quadratic equation?

Use x = (−b ± √(b² − 4ac)) ÷ 2a for ax² + bx + c = 0. The term b² − 4ac is the discriminant.

What does the discriminant tell you?

D = b² − 4ac. D > 0 → two real roots; D = 0 → one repeated root; D < 0 → two complex roots.

Can a slope be zero or undefined?

Yes. A horizontal line has slope 0. A vertical line (x2 = x1) has an undefined slope because you'd divide by zero.

What are complex roots in a quadratic?

When D is negative, the roots take the form p ± qi, where i = √−1. This calculator displays them for you.