Title: Default for The Straight Line
Course: HELM Workbooks 2023-2024

Feedback shared by this category's questions, if right: Correct answer, well done.
Feedback shared by this category's questions, if wrong: Incorrect answer.

Example

Plot the graphs of the three linear functions \(y=4x-3\), \(y=4x\), and \(y=4x+5\), for \(-2\le x\le 2\).

Solution

For each function, it is necessary to find two points on the line.

For \(y=4x-3\), suppose for the first point we choose \(x=0\), so that \(y=-3\). For the second point, let \(x=2\), so that \(y=5\). The points \((0, -3)\) and \((2, 5)\) can be plotted and joined. This is shown in the following diagram.

[Image]

Q: Exercise

Refer to the previous example.

Given the line L: \(y=ax+b\)

changing the value of b results in a line [[2]]

changing the value of a results in a line [[3]]
- which is perpendicular to L
- which is parallel to L
- with the same y-intercept as L
A: which is perpendicular to L / which is parallel to L

Q: Exercise

Considering the line \(L\): \(y=ax+b\).

Changing the value of \(b\) results in a line [...].

Changing the value of \(a\) results in a line [...].
Also offered: which is perpendicular to L
A: which is parallel to L; with the same y-intercept as L
Feedback: The value of \(a\) gives the gradient of the line and changing it has the possibility of making a line perpendicular to \(L\) (can you recall what we would need to change it to?). However this would not be the case for every value. Changing the value of \(a\) will always leave the \(y\)-intercept unchanged since we get this by evaluating at \(x=0\). In a similar way, if we only change the value of \(b\) then the we change the \(y\)-intercept but not the gradient. We can imagine this as sliding the line up or down the \(y\)-axis and the result will always be parallel to \(L\).

Exercise

State the vertical intercept of each of the following lines:

1. The vertical intercept of the line \([value]\) is
2. The vertical intercept of the line \(\displaystyle [value]\) is
3. The vertical intercept of the line \([value]\) is
4. The vertical intercept of the line \(\displaystyle[value]\) is
Feedback: The vertical intercept is a point where the graph of a function intersects the y-axis of the coordinate system. In a linear function of the form \(y=ax+b\), the vertical intercept is the constant \(b\); so if you have an equation of the form \(y=ax\), the vertical intercept is zero. 1. \([value]\) has vertical intercept at \( y= [value]\). 2. \(\displaystyle [value]\) has vertical intercept at \(y= [value]\). 3. \([value]\) has vertical intercept at \(y= [value]\). 4. \(\displaystyle [value]\) has vertical intercept at \(y= [value]\).

Example

Plot the lines \(y= 3x+ 3\), \(y= 5x+ 3\), and \(y=−2x+ 3\).

Solution

Note that all three lines have the same constant term, that is \(3\). So all three lines pass through the point \((0,3)\), which is the vertical intercept. A further point can be calculated for each of the lines and their graphs are shown in the following graph.

[Image: In this picture we plot the lines y=3x+3, y=5x+3 and y=-2x+3]

Note from the lines in the graph that, with different coefficients of \(x\), the slope of the lines are different. For this reason, the coefficient of \(x\) is called gradient or slope of the line.

In general, for the line \(y=ax+b\), a positive value of \(a\) produces a graph which slopes upwards from left to right. A negative value of \(a\), on the contrary, produces a graph which slopes downwards from left to right. If \(a\) is zero the line is horizontal, namely, its gradient is zero.

In the following figure, we can see how the gradient of the line \(y=ax+b\) changes as \(a\) varies. In particular, the first picture (starting from the left) shows the slope of the line when \(a\) is positive, so that the graph slopes upwards from left to right; the second picture shows the slop when \(a\) is negative and the last picture shows that when \(a\) is zero the line is parallel to the \(x\)-axes.

[Image: The gradient of a line y=ax+b depends upon the value of a.]
The gradient of a line \(y = ax + b\) depends upon the value of \(a\)

Key Point

Linear Equation

In the linear function \(f(x) =ax+b\), \(a\) is the gradient and \(b\) is the vertical intercept.

Exercise

State the gradient of each of the following lines:

1. The gradient of the line \([value]\) is
2. The gradient of the line \(\displaystyle [value]\) is
3. The gradient of the line \(\displaystyle [value]\) is
Feedback: The gradient (or slope) of a line is a number that describes both the direction and the steepness of the line. It is given by the coefficient of the independent variable; so, considering the general equation of the line \(y=ax+b\), the gradient corresponds to the constant \(a\). In our case: 1. [value], the gradient is [value]. 2. [value], the gradient is [value]. 3. [value], the gradient is [value].

Exercises

1. State the general form of the equation of a straight line explaining the role of each of the terms in your answer.
2. State which of the following functions will are straight lines:

  1. \(f(x)=3x-3\),
  2. \(f(x)=(x)^(1/2)\),
  3. \(f(x)=1/x\),
  4. \(f(x)=13\),
  5. \(f(x)=-2-x\).

3. Identify the gradient and the vertical intercept of the following ines:

  1. \(f(x)=2x+1\),
  2. \(f(x)=3)\),
  3. \(f(x)=-2x\),
  4. \(f(x)=-7-17x\),
  5. \(f(x)=mx+c\).

Solution

1. The general expression of a straight line is \(y=ax+b\), where \(x\) is is the independent variable, \(y\) is the dependent variable, \(a\) is the gradient and \(b\) is the vertical intercept.
2. Equations (a), (d) and (e) are examples of straight lines.
3. Let introduce the pair (gradient, vertical intercept). Then, the solution is given by

  1. \((2, 1)\),
  2. \((0, 3)\),
  3. \((-2, 0)\),
  4. \((-7, -17)\),
  5. \((c, m)\).

The gradient of a straight line through two points

Known the coordinates of two points, a common requirement is to find the gradient of a line through those two points. Suppose the points are \(A=(x_1, y_1)\), and \(B=(x_2, y_2)\), as shown in the following figure.

[Image: Line through two generic points A and B]

Key Point

The Gradient of Line Through Two Points

The gradient of the line joining \(A=(x_1, y_1)\) and \(B=(x_2, y_2)\) is given by

\[\text{gradient}=\dfrac{y_2-y_1}{x_2-x_1}\]

Example

Find the gradient of the line joining the points \(A=(0,3)\) and \(B=(4,5)\).

Solution

We calculate the gradient as follows:

[Image: Graph of the line through the points (0,3) and (8,7) and the formula to find the gradient of this line]

Thus the gradient of the line is \(\dfrac{1}{2}\). Graphically, this means that when \(x\) increases by \(1\), the value of \(y\) increases by \(\dfrac{1}{2}\).

Exercise

Find the gradient of the line through the two points \(A=([value], [value])\) and \(B=([value], [value])\).

gradient \(=\)
Feedback: The equation of the gradient of the line through the two points is given by the formula \[\text{gradient}=\dfrac{y_2-y_1}{x_2-x_1}.\] In this case we have the points \(A=([value], [value])\) and \(B=([value], [value])\). The gradient of the line is: \[\frac{[value]-([value])}{[value]-([value])} = [value].\] Graphically, this means that when \(x\) increases by \(1\), the value of \(y\) increases or decreases, depending on whether the sign of the gradient is positive or negative respectively, by a quantity equal to the absolute value of the gradient.

Q: Exercise

Given the general expression of the straight line \(y=ax+b\), select the role associated with each term:

- x: [...]
- y: [...]
- a: [...]
- b: [...].
A: independent variable; dependent variable; gradient; vertical intercept

Q: Exercise

Given the general expression of the straight line \(y=ax+b\), select the role associated with each term.

1. \(x\) is the [...],
2. \(y\) is the [...],
3. \(a\) is the [...],
4. \(b\) is the [...].
A: independent variable; dependent variable; gradient; vertical intercept

Exercise

State if the following expressions represent straight lines or other function.

1. \(\displaystyle[value]\) :
2. \(\displaystyle[value]\) :
3. \(\displaystyle[value]\) :
4. \(\displaystyle[value]\) :
5. \(\displaystyle[value]\) :
Feedback: A straight line has always to be of the form \(f(x)=y=ax+b.\) Terms like \(x^{\frac{c}{d}}\), with \(c\) and \(d\) integers, or higher powers of the independent variable \(x\) are not allowed. \(\displaystyle [value]\) does not represent a straight line because it is of the form \(x^{\frac{c}{d}}.\) \(\displaystyle [value]\) does not represent a straight line because it is an inverse power of \(x.\)

Exercise

For each line, identify the gradient and the vertical intercept.

Line | Gradient | Vertical intercept
\([value]\) |  |
\([value]\) |  |
\([value]\) |  |
\([value]\) |  |
\([value]\) |  |
Feedback: As already mentioned in the other questions, the gradient is the factor in front of the independent variable, while the vertical intercept is constant term \(b\) in the general expression of the straight line \(y=ax+b\). Line | Gradient | Vertical intercept \([value]\) | [value] | [value] \([value]\) | [value] | [value] \([value]\) | [value] | [value] \([value]\) | [value] | [value] \([value]\) | [value] | [value]

Exercise

Select which of the following functions has the steepest gradient.
Feedback: We comparing the factors/coefficient of the independent variable in each case. This value is the gradient and highest value shows which function has the steepest gradient. Hence, in this case the function with the steepest gradient is \(\displaystyle[value]\).

Exercise

1. Find the gradient of the line joining \(([value], [value])\) and \(([value], [value]).\)
2. Find the gradient of the line joining \(([value], [value])\) and \(([value], [value]).\)
Feedback: 1. The gradient through the two points \(([value], [value])\) and \(([value], [value])\), using the equation in the notes gradient=\(\dfrac{y_2-y_1}{x_2-x_1}\), is given by \(\dfrac{[value]-([value])}{[value]-([value])} =\displaystyle [value]\). 2. The gradient through the two points \(([value], [value])\) and \(([value], [value])\) is given by \(\dfrac{[value]-([value])}{[value]-([value])} =\displaystyle [value]\).

The equation of a straight line through two points

The equation of the line passing through the points with coordinates \(A=(x_1, y_1)\) and \(B=(x_2,y_2)\) is given by the following formula.

Key Point

The equation of the line passing through two points, \(A=(x_1, y_1)\) and \(B=(x_2, y_2)\), is given by:

\(\displaystyle \frac{y - y_1}{y_2 - y_1} = \frac{x - x_1}{x_2 - x_1}\)   or, equivalently   \(\displaystyle y - y_1 = \left(\frac{y_2 - y_1}{x_2 - x_1}\right)(x - x_1)\).

Exercise

1. Find the equation of the line joining \(([value], [value])\) and \(([value], [value])\). Write it in the form \(y=ax+b\) in the box below:
2. Find the gradient and the vertical intercept of the line joining the points \(([value], [value])\) and \(([value], [value])\).
The gradient is
The vertical intercept is
Feedback: 1. Using the formula you already know, the equation of the line through the points \(([value], [value])\) and \(([value], [value])\) is: \[[value]= \dfrac{[value]-([value])}{[value]-([value])} \cdot ([value]) \Rightarrow [value]\] 2. Using the known formula of the gradient through the points \(([value], [value])\) and \(([value], [value])\), we have: \[ \text{gradient}= \dfrac{[value]-([value])}{[value]-([value])} = \displaystyle [value].\] The vertical intercept is the coefficient \[ ([value]) \cdot [value] = [value]\] that we can find in the expression of the line through two points.

The distance between two points

The distance between the points with coordinates \(A=(x_1, y_1)\) and \(B=(x_2,y_2)\) is given by the following formula.

Key Point

Distance Between Two Points

The distance between the two points \(A=(x_1, y_1)\) and \(B=(x_2, y_2)\), is given by:

\[\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}.\]

We can see this as a direct consequence of the theorem of Pythagoras. The distance between two points is the length of the straight line segment connecting them. This line segment is the hypotenuse of a right angled triangle with base \(|x_2-x_1|\) and height \(|y_2-y_1|\). It is a useful exercise to sketch this case so you understand how we calculate the length.

Exercise

What is the distance between the points \(A=([value], [value])\) and \(B=([value], [value])\)?
Feedback: Using the equation to compute the distance between two points given in the keypoint \(\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\), we have \[\sqrt{(x_B-x_A)^2+(y_B-y_A)^2}= \sqrt{([value]-([value]))^2+([value]-([value]))^2} = [value]\]

Exercise

1. The distance between the points \(([value], [value])\) and \(([value], [value])\) is .
2. The distance between the points \(([value], [value])\) and \(([value], [value])\) is .
Feedback: 1. The distance between the points \(([value], [value])\) and \(([value], [value])\), using the known formula \(\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\), is \( \sqrt{([value]-([value]))^2+([value]-([value]))^2} = [value]. \) 2. The distance between the points \(([value], [value])\) and \(([value], [value])\) is \( \sqrt{([value]-([value]))^2+([value]-([value]))^2} = [value]. \)

Linear functions

Any function of the form \(y=f(x)=ax+b\), where a and b are constants, is called a linear function. The constant \(a\) is called the coefficient of \(x\), and \(b\) is referred to as the constant term.

Key Point

All linear functions can be written in the form: \[\qquad f(x)=ax+b\] where a and b are constants.

For example, \(f(x)=3x+2\), \(g(x)=\dfrac12 x-7\), \(h(x)=-3x+\dfrac23\) and \(k(x)=2x\) are all linear functions.The graph of a linear function is always a straight line. Such a graph can be plotted by finding just two distinct points and joining these with a straight line.

Example

Plot the graph of the linear function \(y=f(x)=4x+3\) .

Solution

We start by finding two points. First we choose \(x=0\) , so \(y=f(0)=3\) and the first point has coordinates \((0, 3)\) . Secondly, suppose we choose \(x= 5\), then \(y=f(5) = 23\) . The second point is \((5,23)\). These two points are plotted and then joined by a straight line as shown in the following diagram.

[Image]