Graphs of Equations and Coordinate Geometry

☰ Contents

Coordinate geometry is one idea repeated: a curve is the set of points that satisfy an equation. Once a shape has an equation, questions about the shape become questions about algebra, and algebra can be checked.

That is the whole trade Descartes proposed. Distance becomes Pythagoras, "the line is a tangent" becomes "the discriminant is zero", and a geometric argument that needed a clever construction becomes a calculation anyone can carry out.

What do coordinates actually do?

Coordinates give every point in the plane a unique address, so a shape can be described and measured without being drawn. The plane is two number lines at right angles, crossing at the origin, (0, 0). A pair (x, y) means go across x, then up y, with negative values going left or down. See the coordinate plane. The point (3, 4) is 3 across and 4 up, and Pythagoras gives its distance from the origin: 3 × 3 + 4 × 4 = 25, which is 5 squared, so the distance is 5. The across and up steps are at right angles, so they form the shorter sides of a right triangle. Order matters: (3, 4) and (4, 3) are different points, and x always comes first. A midpoint averages each coordinate: from (2, 6) to (8, 10), the midpoint is (5, 8), because (2 + 8) ÷ 2 = 5 and (6 + 10) ÷ 2 = 8.

(3, 5) is three across and five up; (5, 3) is a different point entirely.

xy(4, 2)(2, 4)
Order matters: (2, 4) is a different point. Across comes first, up second. Full lesson: The Coordinate Plane

What is gradient, and why does a negative gradient go downhill?

Gradient measures steepness: it is how much y changes for each step of 1 in x. Between two points, divide the change in y by the change in x. From (2, 1) to (6, 9), the gradient is (9 − 1) ÷ (6 − 2) = 2, so the line climbs 2 for every 1 across. See gradient from two points. A negative gradient means y falls as x rises, so the line runs downhill from left to right. From (1, 7) to (4, 1), the change in y is 1 − 7 = −6 over a change in x of 3, so the gradient is −6 ÷ 3 = −2. The sign comes from the subtraction, so take both differences in the same order. A horizontal line has gradient 0, and a vertical line has none, since its change in x is zero. Swapping the order of both points gives the same result: (1 − 9) ÷ (2 − 6) = 2.

Δx = 2.6Δy = 1.8(0, 2)m = Δy / Δx = 1.8 / 2.6 = 0.69

moving right is Δx > 0, and the line climbs, so Δy > 0 and m = Δy/Δx = 0.69 is positive

Swing the point until the line is level

From (1, 4) to (3, 10): the rise is 6, the run is 2, so the gradient is 3. From (0, 7) to (2, 1): the rise is −6, the run is 2, so the gradient is −3.

xyrun 3rise 6
Across from 1 to 4 is a run of 3. Up from 2 to 8 is a rise of 6. Full lesson: Gradient from Two Points
The sign is not a separate rule that has to be remembered. Going right makes the run positive, so the sign of the fraction is entirely decided by whether y went up or down. A gradient of −3 and a gradient of 3 describe equally steep lines; the minus is a direction, not a size. This is also why swapping which point you call "first" changes nothing — both differences flip sign, and the fraction is unmoved.

Now you

xy(2, 11)(5, 2)

What is the gradient of the line through (2, 11) and (5, 2)?

xy(0, 6)(2, 0)

What is the gradient of the line through (0, 6) and (2, 0)?

What does y = mx + c mean?

In y = mx + c, m is the gradient and c is the y-intercept, where the line crosses the y-axis. For y = 3x − 2, the line crosses the y-axis at (0, −2) and climbs 3 for every 1 across. Putting x = 0 leaves y = c, and each step of 1 in x adds m to y. See y = mx + c. To find the equation from two points, work out m, then substitute a point to find c. Through (1, 5) and (3, 9), m is (9 − 5) ÷ (3 − 1) = 2, and (1, 5) gives 5 = 2 + c, so c = 3 and the line is y = 2x + 3. Another form must be rearranged first: 2y = 4x + 6 has gradient 2, not 4, once both sides are divided by 2. Test the equation with the second point: 2 × 3 + 3 = 9.

12345−224xy

passing through (2, 3) forces 2m + c = 3, so each intercept c fixes m = (3 − c) / 2

Make the line pass through (2, 3)

xyy = x + 2
This line crosses the y-axis at 2, so the y-intercept is c = 2. Full lesson: y = mx + c

It is not the only form, and the others are not decoration. Writing a line as Ax + By = C handles the one case y = mx + c cannot — a vertical line, whose gradient is undefined — and is the shape simultaneous equations naturally arrive in. Point-slope form is the fastest route when you know a gradient and one point, which is the situation almost every tangent question hands you.

xy(2, 3)
This line has gradient 2 and passes through (2, 3). Those two facts fix it completely. Full lesson: Point-Slope Form of a Line

Those three forms are one line wearing different clothes, and coordinate geometry is the lesson that ties them together before the harder work starts.

How do you find the equation of a line through two points?

  1. Find the gradient from the two points.
  2. Put that gradient and either point into y − y₁ = m(x − x₁).
  3. Rearrange into whichever form the question wants.

Through (1, 4) and (3, 10): gradient 3, so y − 4 = 3(x − 1), giving y = 3x + 1. The equation of a line through two points works this through, including the check worth doing every time — substitute the other point and confirm it fits.

xy(1, 3)(3, 7)
So y = 2x + 1. Check it with the other point: 2 × 3 + 1 = 7. Full lesson: The Equation of a Line Through Two Points

Now you

−101234−3−2−10123456789xy

Which equation is this line?

xy(2, 6)

A line with gradient 2 passes through (2, 6). What is c in y = 2x + c?

When are two lines parallel or perpendicular?

Two lines are parallel when their gradients are equal, and perpendicular when their gradients multiply to −1. So y = 2x + 1 and y = 2x − 5 are parallel: both climb 2 for every 1 across. A line perpendicular to them has gradient −1/2, because 2 × −1/2 = −1. See gradients of parallel and perpendicular lines. Turning a line through a right angle swaps its rise and run and changes one sign: 1 across and 2 up becomes 2 across and 1 down. So flip the fraction and change its sign, and 3/4 becomes −4/3. A horizontal and a vertical line are perpendicular, but the product rule cannot show it, since a vertical line has no gradient. The line through (4, 1) perpendicular to y = 2x + 1 is y = −x/2 + 3, since −1/2 × 4 + 3 = 1. Multiply a pair of gradients to confirm: 3/4 × −4/3 = −1.

2.51.71.7−2.5m₁ = 1.7/2.5 = 0.68m₂ = −2.5/1.7 = −1.47m₁ × m₂ = −1

m₁ = 0.68, m₂ = −1.47: turning the slope triangle a quarter turn swaps its run and rise and negates one of them, so m₂ = −1/m₁ and m₁ × m₂ = −1

Turn the line to 45° and read both gradients

Turn a line a quarter turn and its rise becomes its run. A step of 2 across and 1 up becomes a step of 1 across the other way and 2 up — so a gradient of ½ becomes −2. You have inverted the fraction and flipped the sign, and doing both to a number and multiplying gives −1 every time. The one exception is a horizontal line meeting a vertical one, where the gradient of the vertical line does not exist to be multiplied.
xy
Rotate one line by 90°: 2 up for 1 across becomes 1 down for 2 across, a gradient of −½. Full lesson: Gradients of Parallel and Perpendicular Lines

Midpoints and distances

The midpoint is the average of the two points, taken coordinate by coordinate. The midpoint of a segment makes the reason plain: the halfway point across is the average of the x values, and the same holds going up.

M (0, 0)d = √(4² + 2²) = 4.47M = ((−2 + 2)/2, (−1 + 1)/2)

AB is the diagonal of a 4 by 2 box, √(4² + 2²) = 4.47; M = (0, 0) is the average of the x-coordinates and the average of the y-coordinates, found separately

Make the box 3 by 4 and read the distance

xy(1, 2)(5, 8)(3, 5)
Halfway across is (1 + 5) ÷ 2 = 3, and halfway up is (2 + 8) ÷ 2 = 5. Full lesson: The Midpoint of a Segment

Distance is Pythagoras with the right-angled triangle left implicit. The distance between two points builds it: the horizontal gap and the vertical gap are the two short sides, and the straight-line distance is the hypotenuse. From (1, 2) to (4, 6): 3 across, 4 up, so the distance is 5.

xy34
Going 3 across and 4 up makes a right triangle, with the straight line as its hypotenuse. Full lesson: The Distance Between Two Points

Now you

xy(1, 0)(4, 4)

How far is it from (1, 0) to (4, 4)?

xy(0, 1)(3, 5)

How far is it from (0, 1) to (3, 5)?

What do the standard curves look like?

Most graphs belong to a few standard families, and each can be recognized from its equation before you plot a point. A straight line has no power of x above 1. A quadratic, with an x² term, is a parabola: symmetric, with one turning point, opening upward when that coefficient is positive. See quadratic graphs. The curve y = x² − 4 turns at (0, −4) and crosses the x-axis at 2 and −2, since 2 × 2 − 4 = 0. A cubic can bend twice and runs from one corner of the plane to the opposite one; see quadratic and cubic graphs. The highest power sets the shape, because for large x it outgrows the other terms. A negative leading coefficient flips the picture: y = −x² opens downward. Plotting a few points confirms a sketch. On the same parabola, x = 3 gives 3 × 3 − 4 = 5, and x = −3 gives the same value, as the symmetry says.

−3−2−1123−6−4−2246xy√Δ = 2.83x = −1.41x = +1.4122 distinct real roots

the roots sit √Δ = 2.83 apart

Drag the vertex until the discriminant is zero

xylowest
So the curve falls, turns, then climbs. That turning point is the vertex. Full lesson: Quadratic Graphs

Reciprocal graphs are the first curve with a hole in the middle of it: y = 1/x has no value at x = 0 and hugs both axes without ever touching them. That behavior is the reader's first meeting with an asymptote, and it comes back in force in rational functions.

The modulus curves are the ones that look strange and are not. The graph of y = |x| is a V, because the modulus leaves positive inputs alone and reflects negative ones upward. Taking the modulus of a whole expression applies that reflection to any curve — whatever was below the axis flips above it — while replacing x with a modulus does something quite different, throwing away the left half of the graph and replacing it with a mirror image of the right. Two similar-looking notations, two unrelated pictures.

xy
y = |x| is a V: two straight rays meeting at the origin. Full lesson: The Graph of y = |x|

How do you find where two graphs cross?

To find where two graphs cross, set their equations equal and solve: a crossing point satisfies both equations at once. For y = 2x + 1 and y = 7 − x, setting 2x + 1 = 7 − x gives 3x = 6, so x = 2, and either equation gives y = 5. See simultaneous equations for the algebra and intersections of graphs for reading a sketch. That point lies on both graphs. The number of solutions is the number of crossings. When one graph is a curve, the algebra gives a quadratic, with two crossings, one or none: y = x² and y = x + 2 meet where x² − x − 2 = 0, at x = 2 and x = −1, the points (2, 4) and (−1, 1). A crossing read from a graph is only an estimate, so confirm it in both equations: 2 × 2 + 1 = 5 and 7 − 2 = 5.

x² = 2x + cx² − 2x − 1 = 0Δ = 4 + 4c = 8two crossingsc = 1

c = 1: Δ = 8 > 0, so x² − 2x − c = 0 has two roots, x = −0.41 and x = 2.41, one for each crossing

Slide the line down until it only just touches the parabola

xyy = xy = 4 − x(2, 2)
The lines cross once, at (2, 2). That pair sits on both of them. Full lesson: Simultaneous Equations
This is why "no real solution" is not a failure of the method. Two graphs that miss each other cannot produce an intersection, and the algebra says so honestly by handing back a negative discriminant. The algebra and the picture never disagree; when they seem to, one of them has been read wrong.

What is the equation of a circle?

A circle of radius r centered at (a, b) has the equation (x − a)² + (y − b)² = r². It is Pythagoras: for any point (x, y) on the circle, the horizontal and vertical distances to the center are the shorter sides of a right triangle, and the radius is the hypotenuse. See the equation of a circle. So the circle centered at (2, −1) with radius 5 is (x − 2)² + (y + 1)² = 25. Each bracket's sign is the opposite of the center's coordinate, a common slip. The steps change when the equation arrives expanded, as in x² + y² − 4x + 2y − 20 = 0: complete the square on the x terms and on the y terms to get back to the bracket form. Test a point you expect on the circle: (5, 3) is 3 across and 4 up from the center, and 3 × 3 + 4 × 4 = 25.

radius 3

C = 2πr is linear in r and A = πr² is quadratic, so doubling r doubles C and quadruples A

Double the radius

across² + up²
write the legs in x and y
Pythagoras on that triangle is the equation of every point on the circle. Full lesson: The Equation of a Circle

Another expanded circle is x² + y² − 6x + 4y − 3 = 0, and completing the square finds its center and radius.

Two follow-up questions come up constantly. The tangent to a circle at a point uses one fact — a tangent is perpendicular to the radius at the point of contact — so the tangent's gradient is the negative reciprocal of the radius' gradient, and no calculus is needed. Where a line meets a circle substitutes the line into the circle and reads the discriminant of the quadratic that falls out: two roots for a chord, one for a tangent, none for a miss.

Now you

the right-hand side is r², not r

What is the radius of (x + 3)² + (y + 2)² = 16?

hold it against the general form

What is the center of (x + 2)² + (y − 4)² = 9?

Ellipses and hyperbolas

An ellipse is a circle that has been stretched by different amounts in each direction, and its equation records both stretches. The equation of an ellipse gives x²/a² + y²/b² = 1, where a and b are the distances from the center to the curve along each axis; setting a = b recovers the circle exactly.

F₁F₂d₁ = 7.3d₂ = 2.7d₁ + d₂ = 10ellipsehyperbola

d₁ + d₂ = 10 wherever P sits on the ellipse: a string of fixed length pinned at the two foci, and 2a = 10 is its length

Switch to the hyperbola and put P on a vertex

xy(5, 0)(0, 3)
Give the two terms different denominators and the circle stretches into an ellipse. Full lesson: The Equation of an Ellipse

Change that plus to a minus and the curve breaks in two. The equation of a hyperbola explains why: x²/a² − y²/b² = 1 has no solutions at all for small x, so a whole band down the middle of the plane is empty, and the two branches that remain run away toward a pair of straight-line asymptotes. That is the same escape-to-infinity behavior reciprocal graphs show, in a more symmetric setting.

Graphs that describe a journey

On a distance-time graph the gradient is speed, because a change in distance divided by a change in time is exactly what speed means. Distance-time graphs reads them the other way as well: a flat section is a stop, and a steeper line is a faster stretch.

ss = 15vv = 10aa = −101 s2 s3 s4 s

v = 20 − 10t > 0: the ball is rising, and a = −10 is pulling its speed down

Set t to where the velocity crosses zero

Speed-time graphs change what the features mean. Here the gradient is acceleration and the area underneath is the distance traveled — a rectangle of speed × time is a distance, and the same holds for any shape underneath the curve.

xy
Under a climbing line the area is a triangle: half of 4 × 80 = 160, the distance covered. Full lesson: Speed-Time Graphs

The general version of this is the average rate of change over an interval: the gradient of the straight line joining two points on any curve, which says how fast the quantity changed on average between them. Shrink that interval toward nothing and you have the central idea of differential calculus, which is where this thread continues.

The mistakes worth naming

From here the two natural neighbors are quadratics and polynomials, which is the algebra behind every parabola on this page, and functions and rational functions, which takes the transformation ideas further. Related guides: Graph Theory, Networks and Voronoi Diagrams and Scatter Plots, Correlation and Regression.

Your turn

Three to try — tap what you get.

The gradient of y = 3x − 2

Where does y = 2x + 1 cross the y-axis?

The midpoint of (2, 4) and (6, 8)

Questions and answers

Why does a negative gradient mean the line goes down?
Because gradient is the change in y divided by the change in x, and moving right means the change in x is positive. If the fraction is negative, the change in y must therefore be negative — so as you go right, you go down. A gradient of minus 3 says that every step right is three steps down, which is the same steepness as plus 3, just tilted the other way.
How do you find the equation of a line through two points?
Find the gradient first by dividing the difference in the y values by the difference in the x values, then substitute either point into y − y₁ = m(x − x₁). For (1, 4) and (3, 10) the gradient is 6/2 = 3, and the equation is y − 4 = 3(x − 1), which is y = 3x + 1. Using the other point gives the same line, which is a useful check.
Why do perpendicular gradients multiply to minus 1?
Rotating a line by a right angle swaps the horizontal and vertical steps and reverses one of their signs. A run of 2 and a rise of 1 becomes a run of minus 1 and a rise of 2, so a gradient of one half becomes minus 2. Multiplying the old gradient by the new one always gives minus 1, because you have flipped the fraction and changed the sign.
What is the equation of a circle?
A circle of radius r centered at the point (a, b) has the equation (x minus a) squared plus (y minus b) squared equals r squared. It is Pythagoras' theorem written as an equation: the left-hand side is the squared distance from the center to the point (x, y), and a circle is precisely the set of points whose distance from the center is r.
How do you tell an ellipse from a hyperbola?
Look at the sign between the two squared terms. An ellipse has a plus — x squared over a squared plus y squared over b squared equals 1 — and is a closed oval. A hyperbola has a minus and is two separate open branches that head off toward a pair of straight-line asymptotes. Both reduce to a circle-like symmetry, but the minus sign is what lets the curve escape to infinity.
What does the area under a speed-time graph mean?
It is the distance traveled. Speed multiplied by time gives distance, and on a graph a height multiplied by a width is an area, so the two are the same calculation. The gradient of the same graph gives acceleration, because that is a change in speed divided by a change in time. One graph therefore answers two different questions depending on whether you measure its slope or its area.
Mr. Chalk