maths.free › Algebra › 5. Algebra › Graphing Linear Equations and Inequalities
Graphing Linear Equations and Inequalities
Graph linear equations and inequalities in two variables.
Learning Objectives
After completing this section, you should be able to:
- Graph linear equations and inequalities in two variables.
- Solve applications of linear equations and inequalities.
In this section, we will learn how to graph linear equations and inequalities. There are several real-world scenarios that can be represented by graphs of linear inequalities. Think of filling your car up with gasoline. If gasoline is $3.99 per gallon and you put 10 gallons in your car, you will pay $39.90. Your friend buys 15 gallons of gasoline and pays $59.85. You can plot these points on a coordinate system and connect the points with a line to create the graph of a line. You'll learn to do both in this section.
Plotting Points on a Rectangular Coordinate System
Just like maps use a grid system to identify locations, a grid system is used in algebra to show a relationship between two variables in a rectangular coordinate system. The rectangular coordinate system is also called the \(x\)\(y\)-plane or the “coordinate plane.”
The rectangular coordinate system is formed by two intersecting number lines, one horizontal and one vertical. The horizontal number line is called the \(x\)-axis. The vertical number line is called the \(y\)-axis. These axes divide a plane into four regions, called quadrants. The quadrants are identified by Roman numerals, beginning on the upper right and proceeding counterclockwise. See .
In the rectangular coordinate system, every point is represented by an ordered pair (). The first number in the ordered pair is the \(x\)-coordinate of the point, and the second number is the \(y\)-coordinate of the point. The phrase "ordered pair" means that the order is important. At the point where the axes cross and where both coordinates are zero, the ordered pair is \((0,0)\). The point \((0,0)\) has a special name. It is called the origin.
We use the coordinates to locate a point on the \(\text{xy}\)-plane. Let's plot the point \((1,3)\) as an example. First, locate 1 on the \(x\)-axis and lightly sketch a vertical line through \(x=1\). Then, locate 3 on the \(y\)-axis and sketch a horizontal line through \(y=3\). Now, find the point where these two lines meet—that is the point with coordinates \((1,3)\). See .
Notice that the vertical line through \(x=1\) and the horizontal line through \(y=3\) are not part of the graph. The dotted lines are just used to help us locate the point \((1,3)\). When one of the coordinates is zero, the point lies on one of the axes. In , the point \((0,4)\) is on the \(y\)-axis and the point (−2, 0) is on the \(x\)-axis.
Condensed — the full section is in OpenStax Contemporary Mathematics.
Graphing Linear Equations in Two Variables
Up to now, all the equations you have solved were equations with just one variable. In almost every case, when you solved the equation, you got exactly one solution. But equations can have more than one variable. Equations with two variables may be of the form \(Ax+By=C\). An equation of this form, where \(A\) and \(B\) are both not zero, is called a linear equation in two variables. Here is an example of a linear equation in two variables, \(x\) and \(y\).
\[\begin{array}{l}Ax+By=C \\ A+4y=8 \\ A=1,B=4,C=8\end{array}\]
The equation \(y=-3x+5\) is also a linear equation. But it does not appear to be in the form \(Ax+By=C\). We can use the addition property of equality and rewrite it in \(Ax+By=C\) form.
Step 1: Add \(3x\) to both sides. \(y+3x=-3x+5+3x\)
Step 2: Simplify. \(y+3x=5\)
Step 3: Put it in \(Ax+By=C\) form. \(3x+y=5\)
By rewriting \(y=-3x+5\) as \(3x+y=5\), we can easily see that it is a linear equation in two variables because it is of the form \(Ax+By=C\). When an equation is in the form \(Ax+By=C\), we say it is in standard form of a linear equation. Most people prefer to have \(A\), \(B\), and \(C\) be integers and \(A\ge 0\) when writing a linear equation in standard form, although it is not strictly necessary.
Linear equations have infinitely many solutions. For every number that is substituted for \(x\) there is a corresponding \(y\) value. This pair of values is a solution to the linear equation and is represented by the ordered pair (\(x\),\(y\)). When we substitute these values of \(x\) and \(y\) into the equation, the result is a true statement, because the value on the left side is equal to the value on the right side.
Graphing a Line by Plotting Points
Try it.
Graph the equation: \(y=\frac{1}{2}x+3\).
Solution
Find three points that are solutions to the equation. Since this equation has the fraction \(\frac{1}{2}\) as a coefficient of \(x\), we will choose values of \(x\) carefully. We will use zero as one choice and multiples of 2 for the other choices. Why are multiples of two a good choice for values of \(x\)? By choosing multiples of 2, the multiplication by \(\frac{1}{2}\) simplifies to a whole number.
\(\begin{array}{lll}x=0 & x=2 & x=4 \\ y=\frac{1}{2}x+3 & y=\frac{1}{2}x+3 & y=\frac{1}{2}x+3 \\ y=\frac{1}{2}(0)+3 & y=\frac{1}{2}(2)+3 & y=\frac{1}{2}(4)+3 \\ y=0+3 & y=1+3 & y=2+3 \\ y=3 & y=4 & y=5\end{array}\)
| \(x\) | \(y\) | (\(x\), \(y\)) |
| 0 | 3 | \((0,3)\) |
| 2 | 4 | \((2,4)\) |
| 4 | 5 | \((4,5)\) |
Plot the points, check that they line up, and draw the line ().
Condensed — the full section is in OpenStax Contemporary Mathematics.
Solving Applications Using Linear Equations in Two Variables
Many fields use linear equalities to model a problem. While our examples may be about simple situations, they give us an opportunity to build our skills and to get a feel for how they might be used.
Pumping Gas
Try it.
Gasoline costs $3.53 per gallon. You put 10 gallons of gasoline in your car, and pay $35.30. Your friend puts 15 gallons of gasoline in their car and pays $52.95. Your neighbor needs 5 gallons of gasoline, how much will they pay?
Solution
Let \(x=\text{the number of gallons of gasoline}\) and let \(y=\text{the total cost}\). If gas is $3.53 per gallon, then \(y=3.53x\). The two points given are (10, 35.30) and (15, 52.95). Plot the points, check that they line up, and draw the line ().
We can see the point at \(x=5\). The \(y\)-value is found by multiplying 5 by $3.53 to get $17.65. Your neighbor will pay $17.65.
Graphing Linear Inequalities
Previously we learned to solve inequalities with only one variable. We will now learn about inequalities containing two variables that can be written in one of the following forms: \(Ax+By\ge C\), \(Ax+By>C\), \(Ax+By\le C\), and \(Ax+By
Like linear equations, linear inequalities in two variables have many solutions. Any ordered pair (\(x\), \(y\)) that makes an inequality true when we substitute in the values is a solution to a linear inequality.
Determining Solutions to an Inequality
Try it.
Determine whether each ordered pair is a solution to the inequality \(y>x+4\):
- \((0,0)\)
- \((1,6)\)
- \((2,6)\)
- \((-5,-15)\)
- \((-8,12)\)
Solution
\(\begin{array}{ll}(0,0) & y>x+4 \\ \text{Substitute}\ 0\ \text{for}\ x\ \text{and}\ 0\ \text{for}\ y & 0\overset{?}{>}0+4 \\ \text{Simplify}\text{.} & 0>4 \\ & (0,0)\ \text{is not a solution to}\ y>x+4.\end{array}\)
\(\begin{array}{ll}(1,6) & y>x+4 \\ \text{Substitute}\ 1\ \text{for}\ x\ \text{and}\ 6\ \text{for}\ y & 6\overset{?}{>}1+4 \\ \text{Simplify}\text{.} & 6>5 \\ & (1,6)\ \text{is a solution to}\ y>x+4.\end{array}\)
\(\begin{array}{ll}(2,6) & y>x+4 \\ \text{Substitute}\ 2\ \text{for}\ x\ \text{and}\ 6\ \text{for}\ y & 6\overset{?}{>}2+4 \\ \text{Simplify}\text{.} & 6>6 \\ & (2,6)\ \text{is not a solution to}\ y>x+4.\end{array}\)
\(\begin{array}{ll}(-5,-15) & y>x+4 \\ \text{Substitute}-5\ \text{for}\ x\ \text{and}-15\ \text{for}\ y & -15\overset{?}{>}-5+4 \\ \text{Simplify}\text{.} & -15>-1 \\ & \text{So},(-5,-15)\ \text{is not a solution to}\ y>x+4.\end{array}\)
\(\begin{array}{ll}(-8,12) & y>x+4 \\ \text{Substitute}-8\ \text{for}\ x\ \text{and}12\ \text{for}\ y & 12\overset{?}{>}-8+4 \\ \text{Simplify}\text{.} & 12>-4 \\ & \text{So},(-8,12)\ \text{is a solution to}\ y>x+4.\end{array}\)
Let us think about \(x>3\). The point \(x=3\) separated that number line into two parts. On one side of 3 are all the numbers less than 3. On the other side of 3 all the numbers are greater than 3. See .
Similarly, the line \(y=x+4\) separates the plane into two regions. On one side of the line are points with \(y
For an inequality in one variable, the endpoint is shown with a parenthesis () or a bracket () depending on whether or not \(a\) is included in the solution:
Similarly, for an inequality in two variables, the boundary line is shown with a solid or dashed line to show whether or not it the line is included in the solution.
Condensed — the full section is in OpenStax Contemporary Mathematics.
Solving Applications Using Linear Inequalities in Two Variables
Many fields use linear inequalities to model a problem. While our examples may be about simple situations, they give us an opportunity to build our skills and to get a feel for how they might be used.
Condensed — the full section is in OpenStax Contemporary Mathematics.
Key Concepts
- Linear equations can be represented graphically on a rectangular coordinate system.
- Solving linear equations in two variables means finding the point where two lines intersect. There are three possibilities: The lines intersect at exactly one point; the lines do not intersect (they are parallel); or the lines intersect everywhere (they are the same line).
- Solving linear inequalities in two variables means finding a region of possible answers. Every point in this region will make both inequalities true statements.
- Plotting points is a standard way to help graph linear equations and linear inequalities.
Practice (8)
Try each one on paper first. Reveal the answer to check; verified ones can be opened in the solver for every step.
-
Plot the following points in the rectangular coordinate system and identify the quadrant in which the point is located:
- \((-5,4)\)
- \((-3,-4)\)
- \((2,-3)\)
- \((0,-1)\)
- \((3,\frac{5}{2})\)
Jawaby görkez
The first number of the coordinate pair is the \(x\)-coordinate, and the second number is the \(y\)-coordinate. To plot each point, sketch a vertical line through the \(x\)-coordinate and a horizontal line through the \(y\)-coordinate (). Their intersection is the point.
- Since \(x=-5\), the point is to the left of the \(y\)-axis. Also, since \(y=4\), the point is above the \(x\)-axis. The point \((-5,4)\) is in quadrant II.
- Since \(x=-3\), the point is to the left of the \(y\)-axis. Also, since \(y=-4\), the point is below the \(x\)-axis. The point \((-3,-4)\) is in quadrant III.
- Since \(x=2\), the point is to the right of the \(y\)-axis. Since \(y=-3\), the point is below the \(x\)-axis. The point \((2,-3)\) is in quadrant IV.
- Since \(x=0\), the point whose coordinates are \((0,-1)\) is on the \(y\)-axis.
- Since \(x=3\), the point is to the right of the \(y\)-axis. Since \(y=\frac{5}{2}\), which is equal to 2.5, the point is above the \(x\)-axis. The point \((3,\frac{5}{2})\) is in quadrant I.
-
is the graph of \(y=2x-3\).
For each ordered pair, decide:
- Is the ordered pair a solution to the equation?
- Is the point on the line?
\(\begin{array}{llll}\text{A:}\ (0,-3) & \text{B:}\ (3,3) & \text{C:}\ (2,-3) & \text{D:}\ (-1,-5)\end{array}\)
Jawaby görkez
Substitute the \(x\)- and \(y\)-values into the equation to check if the ordered pair is a solution to the equation.
\[\begin{array}{lllllll}A:(0,-3) \\ \begin{array}{lll}y & = & 2x-3 \\ -3 & \overset{?}{=} & 2(0)-3 \\ -3 & = & -3✓\end{array} \\ (0,-3)\ \text{is a solution.}\end{array}\ \begin{array}{lllllll}B:(3,3) \\ \begin{array}{lll}y & = & 2x-3 \\ 3 & \overset{?}{=} & 2(3)-3 \\ 3 & = & 3✓\end{array} \\ (3,3)\ \text{is a solution.}\end{array}\ \begin{array}{lllllll}C:(2,-3) \\ \begin{array}{lll}y & = & 2x-3 \\ -3 & \overset{?}{=} & 2(2)-3 \\ -3 & \ne & 1\end{array} \\ (2,-3)\ \text{is not a solution.}\end{array}\ \begin{array}{lllllll}D:(-1,-5) \\ \begin{array}{lll}y & = & 2x-3 \\ -5 & \overset{?}{=} & 2(-1)-3 \\ -5 & = & -5✓\end{array} \\ (-1,-5)\ \text{is a solution.}\end{array}\]- Plot the points \((0,-3)\), \((3,3)\), \((2,-3)\), and \((-1,-5)\).
In , the points \((0,3)\), \((3,-3)\), and \((-1,-5)\) are on the line \(y=2x-3\), and the point \((2,-3)\) is not on the line. The points that are solutions to \(y=2x-3\) are on the line, but the point that is not a solution is not on the line.
-
Graph the equation: \(y=\frac{1}{2}x+3\).
Jawaby görkez
Find three points that are solutions to the equation. Since this equation has the fraction \(\frac{1}{2}\) as a coefficient of \(x\), we will choose values of \(x\) carefully. We will use zero as one choice and multiples of 2 for the other choices. Why are multiples of two a good choice for values of \(x\)? By choosing multiples of 2, the multiplication by \(\frac{1}{2}\) simplifies to a whole number.
\(\begin{array}{lll}x=0 & x=2 & x=4 \\ y=\frac{1}{2}x+3 & y=\frac{1}{2}x+3 & y=\frac{1}{2}x+3 \\ y=\frac{1}{2}(0)+3 & y=\frac{1}{2}(2)+3 & y=\frac{1}{2}(4)+3 \\ y=0+3 & y=1+3 & y=2+3 \\ y=3 & y=4 & y=5\end{array}\)
\(x\) \(y\) (\(x\), \(y\)) 0 3 \((0,3)\) 2 4 \((2,4)\) 4 5 \((4,5)\) Plot the points, check that they line up, and draw the line ().
-
Gasoline costs $3.53 per gallon. You put 10 gallons of gasoline in your car, and pay $35.30. Your friend puts 15 gallons of gasoline in their car and pays $52.95. Your neighbor needs 5 gallons of gasoline, how much will they pay?
Jawaby görkez
Let \(x=\text{the number of gallons of gasoline}\) and let \(y=\text{the total cost}\). If gas is $3.53 per gallon, then \(y=3.53x\). The two points given are (10, 35.30) and (15, 52.95). Plot the points, check that they line up, and draw the line ().
We can see the point at \(x=5\). The \(y\)-value is found by multiplying 5 by $3.53 to get $17.65. Your neighbor will pay $17.65.
-
Determine whether each ordered pair is a solution to the inequality \(y>x+4\):
- \((0,0)\)
- \((1,6)\)
- \((2,6)\)
- \((-5,-15)\)
- \((-8,12)\)
Jawaby görkez
\(\begin{array}{ll}(0,0) & y>x+4 \\ \text{Substitute}\ 0\ \text{for}\ x\ \text{and}\ 0\ \text{for}\ y & 0\overset{?}{>}0+4 \\ \text{Simplify}\text{.} & 0>4 \\ & (0,0)\ \text{is not a solution to}\ y>x+4.\end{array}\)
\(\begin{array}{ll}(1,6) & y>x+4 \\ \text{Substitute}\ 1\ \text{for}\ x\ \text{and}\ 6\ \text{for}\ y & 6\overset{?}{>}1+4 \\ \text{Simplify}\text{.} & 6>5 \\ & (1,6)\ \text{is a solution to}\ y>x+4.\end{array}\)
\(\begin{array}{ll}(2,6) & y>x+4 \\ \text{Substitute}\ 2\ \text{for}\ x\ \text{and}\ 6\ \text{for}\ y & 6\overset{?}{>}2+4 \\ \text{Simplify}\text{.} & 6>6 \\ & (2,6)\ \text{is not a solution to}\ y>x+4.\end{array}\)
\(\begin{array}{ll}(-5,-15) & y>x+4 \\ \text{Substitute}-5\ \text{for}\ x\ \text{and}-15\ \text{for}\ y & -15\overset{?}{>}-5+4 \\ \text{Simplify}\text{.} & -15>-1 \\ & \text{So},(-5,-15)\ \text{is not a solution to}\ y>x+4.\end{array}\)
\(\begin{array}{ll}(-8,12) & y>x+4 \\ \text{Substitute}-8\ \text{for}\ x\ \text{and}12\ \text{for}\ y & 12\overset{?}{>}-8+4 \\ \text{Simplify}\text{.} & 12>-4 \\ & \text{So},(-8,12)\ \text{is a solution to}\ y>x+4.\end{array}\)
-
The boundary line shown in this graph is \(y=2x-1\). Write the inequality shown in .
Jawaby görkez
The line \(y=2x-1\) is the boundary line. On one side of the line are the points with \(y>2x-1\) and on the other side of the line are the points with \(y<2x-1\). Let us test the point \((0,0)\) and see which inequality describes its position relative to the boundary line. At \((0,0)\), which inequality is true: \(y>2x-1\) or \(y<2x-1\)?
\(0>2(0)-1\) \(0<2(0)-1\) \(0>0-1\) \(0<0-1\) \(0>-1\) \(0<-1\) True False Since \(y>2x-1\) is true, the side of the line with \((0,0)\), is the solution. The shaded region shows the solution of the inequality \(y>2x-1\). Since the boundary line is graphed with a dashed line, the inequality does not include the equal sign. The graph shows the inequality \(y>2x-1\).
We could use an \(y\) point as a test point, provided it is not on the line. Why did we choose \((0,0)\)? Because it is the easiest to evaluate. You may want to pick a point on the other side of the boundary line and check that \(y<2x-1\).
-
Graph the linear inequality \(y\ge \frac{3}{4}x-2\).
Jawaby görkez
Step 1. Identify and graph the boundary line ().
- If the inequality is ≤ or ≥, the boundary line is solid.
- If the inequality is < or >, the boundary line is dashed.
Replace the inequality sign with an equal sign to find the boundary line.
Graph the boundary line \(y=\frac{3}{4}x-2\).
The inequality sign is ≥, so we draw a solid line.
Step 2. Test a point that is not on the boundary line. Is it a solution of the inequality? We’ll test \((0,0)\).
Is it a solution of the inequality?
At \((0,0)\), is \(y\ge \frac{3}{4}x-2\)?
\(\begin{array}{l}0\overset{?}{\ge }\frac{3}{4}(0)-2 \\ 0\ge -2\end{array}\)
So, \((0,0)\) is a solution.
Step 3. Shade in one side of the boundary line ().
- If the test point is a solution, shade in the side that includes the point.
- If the test point is not a solution, shade in the opposite side.
The test point \((0,0)\) is a solution to \(y\ge \frac{3}{4}x-2\). So we shade in that side. All points in the shaded region and on the boundary line represent the solution to \(y\ge \frac{3}{4}x-2\).
-
Hilaria works two part time jobs to earn enough money to meet her obligations of at least $240 a week. Her job in food service pays $10 an hour and her tutoring job on campus pays $15 an hour. How many hours does Hilaria need to work at each job to earn at least $240?
- Let \(x\) be the number of hours she works at the job in food service and let \(y\) be the number of hours she works tutoring. Write an inequality that would model this situation.
- Graph the inequality.
- Find three ordered pairs (\(x,y\)) that would be solutions to the inequality. Then, explain what that means for Hilaria.
Jawaby görkez
- Let \(x\) be the number of hours she works at the job in food service and let \(y\) be the number of hours she works tutoring. She earns $10 per hour at the job in food service and $15 an hour tutoring. At each job, the number of hours multiplied by the hourly wage will give the amount earned at that job. \[\underset{\text{10}x}{\underset{︸}{\text{Amount earned at the food service job}}}\underset{\text{+}}{\ \text{plus}}\underset{\text{15}y}{\underset{︸}{\ \text{the amount earned tutoring}}}\underset{\ge \text{240}}{\underset{︸}{\ \text{is at least}}}\]
- Graph the inequality:
Step 1: Graph the boundary line \(10x+15y=240\)
Create a table of values
\(x\) \(y\) 0 \(10(0)+15y=240->y=16\) 6 \(10(6)+15y=240->y=12\) 12 \(10(12)+15y=240->y=8\) Step 2: Pick a test point. Let us pick \((0,0)\) again:
\(10(0)+15(0)\ge 240\)?
\(0\ge 240\) is false and not a solution so the shading happens on the other side of the boundary line ().
- From the graph, we see that the ordered pairs \((15,10)\), \((0,16)\), \((24,0)\) represent three of infinitely many solutions. Check the values in the inequality. \[\begin{array}{lllllll}(15,10) \\ \begin{array}{lll}10x+15y & \ge & 240 \\ 10(15)+15(10) & \overset{?}{\ge } & 240 \\ 300 & \ge & 240\ \text{True}\end{array}\end{array}\ \begin{array}{lllllll}(0,16) \\ \begin{array}{lll}10x+15y & \ge & 240 \\ 10(0)+15(16) & \overset{?}{\ge } & 240 \\ 240 & \ge & 240\ \text{True}\end{array}\end{array}\ \begin{array}{lllllll}(24,0) \\ \begin{array}{lll}10x+15y & \ge & 240 \\ 10(24)+15(0) & \overset{?}{\ge } & 240 \\ 240 & \ge & 240\ \text{True}\end{array}\end{array}\]
For Hilaria, it means that to earn at least $240, she can work 15 hours tutoring and 10 hours at her food service job, earn all her money tutoring for 16 hours, or earn all her money while working 24 hours at the job in food service.
Symbols used here
Inequalities that allow equality; < and > exclude it.
Both signs at once: x = 3 ± 2 means 5 and 1.
The two sides are different.
The non-negative number whose square (n-th power) is x.
Distance from zero: |−3| = 3. For a complex number, distance from the origin.
i² = −1.
The exponent b must be raised to for x; ln uses base e.
Naturals, integers, rationals, reals, complex numbers.
How to: Graphing Linear Equations and Inequalities
- Graph linear equations and inequalities in two variables.
- Solve applications of linear equations and inequalities.
- Since
- Since
- Since
- Since
- Since
- Every point on the line is a solution of the equation.
Questions people ask
What does it mean to solve an equation?
To find every value of the unknown that makes both sides equal. Each step is an operation applied to both sides that keeps the solution set the same, until the unknown stands alone.
Why do I sometimes get two answers?
A quadratic can cross the axis twice, so it can have two solutions. A degree-n polynomial has up to n. The graph shows where each one comes from.
How do I know whether to factor or use the quadratic formula?
Try factoring for a few seconds: look for two numbers that multiply to a·c and add to b. If nothing obvious appears, the discriminant b² − 4ac tells you how many real roots there are, and the formula finds them without guessing.
Özüňi synla
Parts of this page are adapted from OpenStax Contemporary Mathematics (CC BY-NC-SA 4.0). Condensed and re-explained here; errors are ours.
_Ýaşa Algebra
Linear equationsQuadratic equationsSystems of equationsInequalitiesFactoringExpandingSimplifying expressionsFunctions and graphsExponential and logarithmic equationsPolynomial equationsAbsolute value