Tuesday, February 16, 2021

Graphing a Simple Linear Function

In this post, we present an example of how to graph a linear function in the xy-plane from scratch.

Example

Graph the line described by the function y = -5x + 1.

Solution:

The function y = -5x + 1 is of the form y = mx + b. This indicates the graph is a straight line. For this reason, we can graph the line with only two points that we can connect to form the line.

Select any values of x and plug them into the given function to obtain the corresponding values of y. For this example, we use the values x = -1 and x = 1. 

The table below summarizes the results above.
Trace a line connecting these two points to obtain the graph for the function y = -5x + 1.


The Equation of the Line in Form y = mx + b

Definition

The equation of the line in form y = mx +b represents the basic relationship between two variables (x and y). m is the slope which is a measure of the inclination of the line. b is the y-intercept which is the value of y when x = 0.

The simplest of these functions is the equation y = x. This is a line with slope m = 1, and the y-intercept is b = 0. The graph for the function y = x is shown below.


As we can observe, the graph of y = x is an inclined line in the xy-plane.

The Slope

Mathematically, the slope can be described as the change in the dependent variable (y) over the change in the independent variable (x). This is given as:
This is true for any two points on the line. In other words, in order to calculate the slope, we need to know at least two points on the line.

The y-Intercept

As stated above, the y-intercept is the value of y when x = 0. This can be observed directly if the graph is known, or obtained mathematically from a point on the line (provided the slope was previously found).

Example

Write the equation in form y = mx + b for the line passing through the points (-2,-10) and (1,2).

Solution:

ALWAYS start with the slope. In this case, we can use the given points and plug them into the formula for the slope. Consider Point 1 as (-2,-10) and Point 2 as (1,2).
The slope is found to be 4. Therefore, the equation so far is y = 4x + b. We still need to find b.

In order to find b, we can use any of the two given points into what we have for the equation so far.
For simplicity, we can use (1,2).
The equation of the line passing through the points (-2,-10) and (1,2) is:
The graph of the line is:


From the line in the graph, it can be observed that y increases by 4 units as x increases by 1 unit. In addition, we can see that the y-intercept is -2.