# 4 Sketching Graphs

## 4.1 Straight Lines: $y=ax+b$

A graph shows the way an expression changes over all of it's allowable values, often written as the way $y$ changes for all the allowable values of $x$. If the graph is of a straight line then we would want to know where the line crosses the $x$ and $y$ axes. It doesn't take much imagination to understand what happens for large positive or negative values of $x$.

To sketch a graph create a table of $x$ and the corresponding values of $y$. Choose easy $x$ values and calculate the corresponding values of $y$. If our line is of the form $y = ax + b$ we would let $x = 0$ and find the value of $y$ then we would let $y = 0$ and find the value of $x$. With these two points we understand the behaviour of the line from $-\infty$ to $+\infty$.

For a sanity check we should calculate a third value of $y$ to ensure all three points are co-linear.

As an example consider $y = x + 3$. Start by drawing a table. When $x = 0$ $y = 3$. When $y = 0$ $x = -3$. When $x=1$ $y=4$.

 $x$ -3 0 1 $y$ 0 3 4

Sketch the points on the axes and draw the line through the points.

Example 4.1: Sketch $y = x+3$

Your browser does not support the HTML5 canvas tag.

Another reason for sketching graphs is to find points of intersection. Two straight lines with different gradients will intersect somewhere. Sketching a graph is one way to find where.

As an example consider the lines $y=x-2$ and $y=-2x+3$. If you could travel along the line $y=x-2$ from $-\infty$ to $+\infty$ at every point on the line it is true that $y=x-2$.

If a friend could travel along the line $y=-2x+3$ from $-\infty$ to $+\infty$ at every point on their journey it is true that $y=-2x+3$.

Where the lines cross each other, and at no other point in the universe, both $y=x-2$ and $y=-2x+3$ are simultaneously true. What that means is the $x$ values and the $y$ values are identical at that point. We can sketch the two lines as one way of finding the location of this point of intersection. We will start by drawing a table.

When $x = 0$ $y_1=-2$ and $y_2=3$.
When $x=-1$ $y_1=-3$ and $y_2=5$.
When $x=1$ $y_1=-1$ and $y_2=1$.

 $x$ -1 0 1 $y_1$ -3 -2 -1 $y_2$ 5 3 1

Sketch the points on the axes and draw the lines through the points.

Example 4.2: Find the point of intersection of $y = x-2$ and $y=-2x+3$

Your browser does not support the HTML5 canvas tag.

## 4.2 Higher Order Curves: $y=ax^2+bx+c$

For higher order curves we usually want to know where the curve crosses the axes and the points at which the curve is a maximum or a minimum (called turning points)

We can find the turning points with calculus but we can also find them by sketching the curve.

As before we will create a table of $x$ values and the corresponding $y$ values. As you calculate each $y$ value look at the preceding values to see whether you have crossed an axis or passed a turning point.

Example 4.3: Sketch $y = x^2-2x-1$

 $x$ -1 0 1 2 3 $y$ 2 -1 -2 -1 2
Your browser does not support the HTML5 canvas tag.

The final thing to consider in this section is finding the points of intersection between curves. As an example consider $y=-x^2+2x+11$ and $y=-3x/2+6$

Create a table of enough $x$ and $y$ values then plot the lines.

Example 4.4: Find the points of intersection between $y=-x^2+2x+11$ and $y=-3x/2+6$

 $x$ -2 0 2 4 6 $y_1$ 3 11 11 3 -13 $y_2$ 6 3 0
Your browser does not support the HTML5 canvas tag.

In the examples we have used continuous linear and quadratic lines. Both of these have straight forward algebraic solutions. The techniques we have described, however, work for expressions of any order or class, for continuous and discontinuous lines.

## 4.3 Using Graphs to Analyse Data

Imagine we have a spring and we want to find the spring rate. We could fix one end of the spring to a rigid mounting and apply a series of masses to the other end. If we measure the extension cause by each mass we could get data like the table below.

Table

We choose the mass that is applied so mass is the independent variable ($x$). The mass causes the extension so extension is the dependent variable ($y$). Plotting mass against extension we get a graph like this:

Graph