BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyThe High School: physics from the very first step

Graphs, straight lines and slope

Reading a graph, the straight line y = mx + c, the slope as rise over run with its units, and direct proportion as a straight line through the origin.

You need this first

Full reading path (3 pages)
  1. Powers of ten and scientific notation (hs-0)
  2. Units and the SI system (hs-0)
  3. Solving and rearranging formulas (hs-0)
On this page · 9 sections
  1. Reading a graph
  2. The straight line
  3. The slope as rise over run
  4. A slope has units
  5. Measured points and the line of best fit
  6. When the graph is not straight
  7. Direct proportion
  8. Try it
  9. Summary

A graph turns a table of numbers into a picture. One glance shows whether a quantity grows or shrinks, steadily or not, and where something special happens. Physics uses graphs all the time, and the simplest one, the straight line, is the most important. This lesson is about reading graphs and about the one number that describes a straight line: its slope.

Reading a graph#

A graph has two axes. The horizontal axis usually shows the quantity you choose or control, such as time; the vertical axis shows the quantity that depends on it, such as position. Each point on the graph is a pair of values (x,y)(x, y): go xx along and yy up. The axes cross at the origin, the point (0,0)(0, 0).

In physics, each axis is labelled with a quantity and its unit, as in "time (s)" and "position (m)". A graph with unlabelled axes cannot be read.

The straight line#

A straight line is the graph of an equation of the form

Straight line
y=m x+cy = m\,x + c
In words

y equals m x plus c

Source: Siyavula, Mathematics Grade 10, Chapter 6: Functions, 6.2 Linear functions, Sec. 6.2, Functions of the form y = mx + c

The two constants each have a job:

  • cc is the intercept: the value of yy where the line crosses the yy-axis, at x=0x = 0. Changing cc slides the line up or down without tilting it.
  • mm is the slope, also called the gradient. It sets how steep the line is. If mm is positive the line rises from left to right; if it is negative the line falls; if m=0m = 0 the line is horizontal.

Try the sliders: they change mm and cc and redraw the line from its equation. (Some books and the simulation below write the intercept as bb, as in y=mx+by = mx + b; it is the same thing.)

The line y=mx+cy = mx + c, computed from its equation. It crosses the yy-axis (x=0x = 0) at y=cy = c. The slider mm tilts the line; cc moves it up or down.

The slope as rise over run#

To find the slope from two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) on the line, divide the change in yy (the rise) by the change in xx (the run):

Slope between two points
m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}
In words

m equals the quantity y two minus y one, all over the quantity x two minus x one

It does not matter which point you call 1 and which 2, as long as you use the same order on top and below. For a straight line it does not matter which two points you pick either: the slope is the same everywhere along it. That is exactly what makes a line straight.

Two special cases: a horizontal line has rise 0, so slope 0. A vertical line has run 0, and dividing by zero is not allowed, so its slope is undefined.

Worked example

The equation of a line through two points

A straight line passes through (2,7)(2, 7) and (6,19)(6, 19). Find its equation.

Slope

m=19−76−2=124=3m = \dfrac{19 - 7}{6 - 2} = \dfrac{12}{4} = 3.

Intercept

Put the slope and one point into y=mx+cy = mx + c: 7=3⋅2+c7 = 3 \cdot 2 + c, so c=7−6=1c = 7 - 6 = 1. The line is y=3x+1y = 3x + 1.

Check

The other point must fit as well: 3⋅6+1=193 \cdot 6 + 1 = 19. It does.

A slope has units#

In maths, xx and yy are bare numbers. In physics, each axis carries a unit, and so does the slope: its unit is the unit of the vertical axis divided by the unit of the horizontal axis. That turns a slope into a physical quantity, a rate: how fast one quantity changes as the other increases.

Worked example

A cyclist's speed from a graph

A cyclist rides along a straight road. At time 0 s she is 20 m from a lamp post; at 10 s she is 80 m from it, and the position–time graph between these moments is a straight line. What is her speed?

Rise and run

The rise is 80−20=6080 - 20 = 60 m, the run is 10−0=1010 - 0 = 10 s.

Slope with units

Slope =60 m/10 s=6.0= 60\ \text{m} / 10\ \text{s} = 6.0 m/s. Metres divided by seconds: the slope of a position–time graph is a speed.

The equation of the line

The intercept is the position at time 0, 20 m, so position =20 m+(6.0 m/s)×time= 20\ \text{m} + (6.0\ \text{m/s}) \times \text{time}. At 5.0 s this gives 20+6.0×5.0=5020 + 6.0 \times 5.0 = 50 m, halfway between, as a straight line should.

The cyclist's position, computed from position = 20 m + (6.0 m/s) × time. The slope, 6.0 m/s, is her speed; the intercept, 20 m, is where she started.

Measured points and the line of best fit#

Real measurements never lie exactly on a line: each has a small error. When the points lie roughly along a straight line, draw the line of best fit: one straight line that passes as close as possible to all the points, with about as many points above it as below. Do not join the dots one by one.

To find its slope, pick two points on the line you drew, not two of the measured points, and take them far apart. Over a long run, the small error in reading each point off the graph matters much less than over a short run.

When the graph is not straight#

A steady speed gives a straight position–time graph. If the speed changed, the graph would curve, and its steepness would differ from place to place. Measuring the steepness of a curve is where calculus begins.

Direct proportion#

Two quantities are directly proportional when one is a fixed number times the other:

Direct proportion
y=k xy = k\,x
In words

y equals k x

The constant kk is the constant of proportionality. Doubling xx doubles yy, and halving xx halves yy. The graph is a straight line through the origin: it is y=mx+cy = mx + c with c=0c = 0 and slope m=km = k.

Be careful with the words: every proportional relation is linear, but not every linear relation is proportional. The cyclist's position is linear in time but not proportional to it, because the line starts at 20 m, not at 0.

A quick test for proportion with measured data: divide each yy by its xx. If the ratio is the same every time, the quantities are proportional and the ratio is kk. For example, the mass of water is proportional to its volume. With the density from lesson 0.2, 1.0 × 10³ kg/m³, every litre (L, 10−310^{-3} m³) has a mass of 1.0 kg, so 2.5 L of water has a mass of 2.5 kg.

Try it#

In the simulation you can drag a line, read off its slope and intercept, and find the equation of a line through two points.

Graphing Lines. Simulation by PhET Interactive Simulations, University of Colorado Boulder, licensed under CC BY-NC 4.0 (https://phet.colorado.edu). Open full screen

Summary#

  • Label each axis with a quantity and its unit; each point is a pair (x,y)(x, y).
  • A straight line is y=mx+cy = mx + c: mm is the slope and cc the intercept on the yy-axis.
  • Slope = rise over run, m=(y2−y1)/(x2−x1)m = (y_2 - y_1)/(x_2 - x_1); horizontal lines have slope 0, vertical lines an undefined slope.
  • In physics a slope has units and is a rate; the slope of a position–time graph is a speed.
  • Direct proportion, y=kxy = kx, is a straight line through the origin.

Symbols on this page

Show the 15 symbols used here
×\times times.
Times (multiplication). Between two vectors: the cross product. Say it: “times”.
⋅\cdot dot.
Times (multiplication). Between two vectors: the dot product. Say it: “times”.
HH H.
The Hubble constant: how fast galaxies move away per unit of distance, v = H d. Unit: km/s/Mpc. Say it: “H”.
cc c.
The intercept of a straight line: the value of y where it crosses the y-axis (x = 0). Say it: “c”.
kk k.
The constant of proportionality in y = kx. Say it: “k”.
xx x.
The quantity on the horizontal axis of a graph; a point is (x, y). Say it: “x”.
yy y.
The quantity on the vertical axis of a graph; on a straight line, y = mx + c. Say it: “y”.
dd d.
Distance: in Hubble's law, the distance to a galaxy. Unit: m (here Mpc). Say it: “d”.
mm m.
The slope (gradient) of a straight line: rise over run. Say it: “m”.
vv v.
Speed: in Hubble's law, the speed at which a galaxy moves away. Unit: m/s (here km/s). Say it: “v”.
bb b.
Another letter for the intercept of a straight line, as in y = mx + b (used by the simulation); the same as c. Say it: “b”.
x1x_{1} x 1.
The x value of the first of two points on a line. Say it: “x one”.
x2x_{2} x 2.
The x value of the second of two points on a line. Say it: “x two”.
y1y_{1} y 1.
The y value of the first of two points on a line. Say it: “y one”.
y2y_{2} y 2.
The y value of the second of two points on a line. Say it: “y two”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 13 words used here

New here

graph.
The picture of a function: the curve y = f(x) for one variable, or the surface z = f(x, y) for two.
gradient.
The vector of a function's partial derivatives; it points the way the function increases fastest, and its length is that fastest rate.
best-fit line.
The straight line that passes as close as possible to a set of data points, usually chosen by least squares.
proportional.
Of two quantities: always in the same ratio, so that doubling one doubles the other.

Also used

linear.
Of a relation or equation: using only first powers of the unknowns, so doubling the cause doubles the effect and effects simply add. Explained in Solving and rearranging formulas.
density.
How much of something (mass, charge, energy, particles or probability) there is in each unit of volume, area, length or other variable. Explained in Density and pressure.
Hubble's law.
The rule that galaxies move away from us with speeds proportional to their distances: twice as far, twice as fast. Explained in Towards the universe: from atoms to the observable universe.
galaxy.
A huge system of stars, gas and dust, from thousands to over a trillion stars, held together by gravity inside a dark matter halo. Explained in Towards the universe: weighing the Sun and the Galaxy with orbits.
Hubble constant.
Today's expansion rate of the universe: how much faster a galaxy recedes for each extra unit of distance, in km/s per megaparsec. Explained in Towards the universe: redshift, stretched light from moving sources.

Academic

special case.
One particular example of a general rule, obtained by fixing some of its quantities.
error.
The difference between a measured or computed value and the true one; often how large that difference may be.
read off.
To take a value directly from a graph, table or formula, without further calculation.
accuracy.
Closeness to the true value: an accurate measurement or calculation gives a result near the right answer.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Where this leads

In cosmology

Pages that build on this

Practise

Check your understanding

  1. A line passes through (1,4)(1, 4) and (5,12)(5, 12). What is its slope?
  2. For the line y=−3x+6y = -3x + 6, which statement is true?
  3. On a graph of position (in m) against time (in s), a straight line rises 30 m in 6 s. What does its slope tell you?
  4. Which graph shows that yy is directly proportional to xx?
  5. What is the slope of a horizontal line?
0 of 5 answered

Flashcards

1 / 5