3.3 - Plotting linear and quadratic graphs

3.3 - Plotting linear and quadratic graphs

An equation is a compact way to describe many points. You will calculate those points and turn them into straight lines or smooth quadratic curves, including equations that fix one coordinate. A well-chosen table and a few checks help you spot a wrong point before it spoils the graph.

Plot a straight line from an equation

Can a graph pass through every point in your table and still be drawn wrongly? Yes: the way you join the points matters. We will start with a straight line, then see what changes for a curve.

You already know

In (x,y)(x,y), horizontal position comes first. Substitute a negative input using brackets, and read each axis scale before plotting.

A graph contains the coordinate pairs that satisfy its equation. For y=2x−1y=2x-1, the input x=0x=0 gives y=−1y=-1, so (0,−1)(0,-1) is on the graph. The point (0,1)(0,1) is not: it fails the equation.

Linear graph

A linear equation in two variables has a straight-line graph. For y=mx+cy=mx+c, equal increases in xx give equal changes in yy, because the gradient mm is constant.

A table of values lists inputs and their calculated outputs. Choose a regular axis scale that fits every value in the requested interval. The two axes may use different scales, but the spacing along each axis must be consistent. These plotting rules and the form y=mx+cy=mx+c are not in either tier's formulae sheet: learn them.

Worked example 1: turn a table into a line

Question. Draw y=2x−1y=2x-1 for −2≤x≤3-2\leq x\leq3.

Plan. Substitute integer inputs, plot the resulting pairs and join them with a ruler.

y=2(−2)−1=−5first inputy=2(0)−1=−1axis crossingy=2(3)−1=5last input\begin{aligned} y&=2(-2)-1=-5 &&\text{first input}\\ y&=2(0)-1=-1 &&\text{axis crossing}\\ y&=2(3)-1=5 &&\text{last input} \end{aligned}
xx−2-2−1-100112233
yy−5-5−3-3−1-1113355

Mark a small cross at each pair. Draw one straight segment through the points, from the first input to the last.

Why? This equation has a constant change of 22 in yy for every 11 in xx, so a straight line is required.

Answer. The graph is the straight segment from (−2,−5)(-2,-5) to (3,5)(3,5), shown below.

Check. All outputs rise by 22, and the line crosses the vertical axis at (0,−1)(0,-1).

The regular pattern is useful: if one calculated point is off the line, recheck it instead of bending the line to visit it. Two distinct points determine a straight line; a third point checks your arithmetic and plotting.

[DIAGRAM: asset_slug: m049_linear_plot; caption: The six calculated points lie on one straight line from x equals minus 2 to x equals 3; description: Exact equal-unit grid for y equals 2x minus 1, with points minus 2 comma minus 5, minus 1 comma minus 3, 0 comma minus 1, 1 comma 1, 2 comma 3 and 3 comma 5 joined by a straight segment; file: m049_linear_plot.png; recommended_method: matplotlib]
The six calculated points lie on one straight line from x equals minus 2 to x equals 3

Now change only the constant, from −1-1 to 11. Every output is 22 higher, but the change between consecutive outputs remains 22.

Worked example 2: change the constant

Question. Draw y=2x+1y=2x+1 for −2≤x≤3-2\leq x\leq3.

Plan. Calculate the table and use one straight ruler line through the plotted pairs.

y=2(−2)+1=−3first inputy=2(0)+1=1axis crossingy=2(3)+1=7last input\begin{aligned} y&=2(-2)+1=-3 &&\text{first input}\\ y&=2(0)+1=1 &&\text{axis crossing}\\ y&=2(3)+1=7 &&\text{last input} \end{aligned}
xx−2-2−1-100112233
yy−3-3−1-111335577

Choose axes that include y=7y=7, plot all six pairs and join across the stated interval.

Why? The coefficient of xx has not changed, so the graph has the same steepness as example 1.

Answer. A straight segment from (−2,−3)(-2,-3) to (3,7)(3,7), passing through (0,1)(0,1).

Check. Substituting x=2x=2 gives y=5y=5, which agrees with the table and line.

The table is a preparation for drawing, not a replacement for the plotted graph when a paper question asks you to draw it.

Watch out

The line 2(−2)+1=52(-2)+1=5 loses the negative sign. Multiply first: 2(−2)=−42(-2)=-4, then add 11, giving −3-3.

Use the equation to generate two more points with a new constant.

Recognise special straight lines

Some equations describe a line without being written as y=mx+cy=mx+c. Ask what stays fixed, or which coordinate pairs satisfy the equation.

For x=2x=2, every point has horizontal position 22, while its height can vary: the line is vertical. For y=−1y=-1, every point has height −1-1, while its horizontal position can vary: the line is horizontal. More generally, x=kx=k is vertical and y=cy=c is horizontal.

[DIAGRAM: asset_slug: m049_special_lines; caption: A vertical line x equals 2, a horizontal line y equals minus 1, and the diagonal line y equals x; description: Three exact equal-unit coordinate diagrams with x equals 2 vertical, y equals minus 1 horizontal, and y minus x equals 0 identical to y equals x; file: m049_special_lines.png; recommended_method: matplotlib]
A vertical line x equals 2, a horizontal line y equals minus 1, and the diagonal line y equals x

For y=xy=x, the coordinates are equal, so (−2,−2)(-2,-2), (0,0)(0,0) and (2,2)(2,2) are on the line. Adding xx to both sides of y−x=0y-x=0 gives y=xy=x; these are two equations for the same line. These special forms are not in either tier's formulae sheet: learn to recognise them.

An equation of the form ax+by=cax+by=c, where aa and bb are not both zero, also gives a straight line. You can rearrange it to calculate a table. Often, setting one variable to zero gives two convenient axis intercepts, the points where the line meets the axes.

Worked example 3: use two axis intercepts

Question. Draw the line 2x+y=42x+y=4.

Plan. Find a point on each axis, then join them with a ruler.

x=0:y=4vertical-axis crossingy=0:2x=4horizontal-axis crossingx=2divide by 2\begin{aligned} x=0&:\quad y=4 &&\text{vertical-axis crossing}\\ y=0&:\quad 2x=4 &&\text{horizontal-axis crossing}\\ &\quad x=2 &&\text{divide by 2} \end{aligned}

Why? On an axis, one coordinate is zero. This removes a term and makes a point easy to find.

Answer. Plot (0,4)(0,4) and (2,0)(2,0), then draw the straight line through them.

Check. At x=1x=1, y=2y=2, so (1,2)(1,2) lies halfway between those intercepts and satisfies 2(1)+2=42(1)+2=4.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account