# Coordinate System and Graphing Lines including Inequalities

This section covers:

Let’s start some graphing of algebra problems – it’s a great way to visually see what’s going on!

Let’s go back to the example of your job at the mall where you make \$10 an hour.  We said that we have  E = 10m, where E is the dependent variable (how much you make) and m is the independent variable (how many hours you work).  This is because what you make depends on how many hours you work.   For now, let’s write this as  y = 10x.  Same idea.

# Coordinate System

In algebra and later classes, you will work with a coordinate system where you’ll graph situations like this. This is also called a Cartesian Plane.

When we graph, we put the x’s (the independent variable) on the bottom and the y’s (the dependent variables) up on the side like this.  Don’t worry about why you are graphing this way; someone just decided to do it this way.

When you graph on the coordinate system, you go back and forth with the x’s first, and then up and down with the y’s; the point is written like (x, y).  (Remember that you learned to crawl first – back and forth – and then you learned to walk – which is more like going up and down.)

The (x, y) point is also called an ordered pair. So for the point (4, 3) below, we went over 4 with the x’s and up 3 with the y’s.  The x part of the ordered pair is also called the “run” (because you run back and forth), and the y part is the “rise” (because you rise up and down).

Remember that the variable that depends on the other one is always up on the left side (the y). When we graph this particular situation (and all the problems that we’ve worked so far), it turns out that it’s a straight line, and every point on the line will give the x-to-y (hours to earnings) solution.

Let’s first create a “T chart” (do you see the “T”?) and then we’ll graph the line.

Graph – how much I make at the mall:

In other words, when we graph the line, we can go over (back and forth) to see what the hours are and then look up to see how much we would make with that many hours.  You can think of the x as the “question” on the bottom where you go back and forth, and then look up and down to get the “answer” where the is – the answers are all on the line!

So, for example, if we wanted to know how much we would make for working 2 hours, we go to the 2 on the bottom (the x), and look up to the line and see that the y is 20.  This point is (2, 20).

Note that we just ignore the negative numbers (to the left of 0 and underneath 0); these are meaningless in this situation.

This concept is used every day for many different applications in the world!  The relationship between x and y is not always linear (a straight line), but for now, we’ll work with linear relationships.  The ordered pair (xy) we are using represents (number of hours you work, how much money you make).

And remember that a line shows you all the different coordinates (or x and y combinations) that make the equation work – it’s as simple as that!

And also remember that it only takes two points to draw a line – you’ll learn this in Geometry!

# Slope-Intercept Formula – the most “famous”

Now let’s do another example of graphing a line, and talk about what we call “y-intercepts”.  This can be thought as a “beginning” value (when x is 0).  In the example above, our y-intercept was 0, or (0, 0), since when we work no hours, we get paid no money.

The most common equation for graphing a line is the following:

y = mx + b

where m is the slope of the line, and b is the y-intercept.  This is called the slope-intercept formula for line, since it contains the slope and the y-intercept.  So we really don’t know why they use “m” for slope and “b” for the y-intercept; it’s one of those great mysteries in life!

The slope of the line is the rate of change; in our example, it is the rate per hour that you make working at the store.  Usually you can get the slope by going over one on the bottom (for the x) and seeing how much you go up on the graph (the y).  Think of the slope as how much you go up (or down) for going over (or back) one value of x.

So, in our case, when we go over one on the bottom (for example, from 2 to 3), we go up 10 on the graph (from 20 to 30).  It’s as easy as that!  The slope can also be thought as the “rise” over the “run”.  Again, don’t worry why; this is how someone just defined it.

So let’s use another example.  Let’s say that you and your friends are going to the state fair.  Suppose it costs you \$4 to get into the fair, and then \$2 for every ride. The amount you spend (y) depends on how many rides you take (x); in other words,

y = 2x + 4

You can interpret this as:

“The amount you spend at the fair is equal to 2 times the number of rides you take, plus the \$4 to get in.”

Now, do you see how there’s a line again that matches up the number of rides you take (x axis) and how much you spend at the fair (y axis)?  So, on the graph below, if you wanted to know how much it would cost at the fair if you rode 2 rides, for example, you could find 2 at the bottom, go up to the line, and then over to the left to see it would cost \$8.

Here’s a T-chart for this example:

And here’s the graph.  Note again that we just ignore the negative values and fractional values (non-integers) of x at this time:

Now, look at the slope (or how much the line is slanted up, in this case).  Do you see that for every time the graph goes up 2 (“rise”), it goes over 1 (“run”)?   Note that you have to be really careful to compare slopes of different graphs, since the scales (how far apart the x’s are, and the y’s are) may be a little different, like in our graph.

In this case, our slope represents how fast we are spending money on the rides.  So if we ride one ride (go over one with the x), we are paying \$2; thus the slope is 2.

Now where does the line cross the y axis, in other words, where on the line is x = 0?  This is before we’ve ridden any rides.  This is at y= 4.  This is the y-intercept.  This is our amount to get into the fair (say, the “starting point”).  The actual point is (0, 4) (go back and forth 0, go up 4).

Again, mathematically, for the line y = mx + b, m is the slope, and b is the y-intercept.  To get the slope you can just take any 2 points and subtract the y’s from each other and put that on top (the “rise”), and then subtract the x’s from each other (in same order that you subtracted the y’s) and put that on bottom (the “run”).

We can write this like the following.  Note that the little 1’s and 2’s are called subscripts, since they are a little bit below the actual letter.   They just mean like the first x, first y and then the second x, second y, and so on.

Now this looks complicated, but all this means is that if we have any two points on our line, say points (2, 8) for and (6, 16) for ,  we do the following math:

Note that we had to start both the top and bottom from the same point, namely (6, 16).  It’s a little confusing, since you put the y’s on top, but you’ll get used to it!

Now, b, or the y-intercept is where the line crosses the y axis; actually, it’s what the y is when x = 0.   Again, when we ride no rides (x = 0), we spend \$4; this is just to get into the fair.

If we have a negative y-intercept, we will start our graph below the horizontal x axis;  if we have a negative slope, we will go to the left and then up, or to the right and then down.  This is because either the rise is positive and the run is negative, or the rise is negative and the run is positive.  Remember that a negative direction on the “x” axis goes backwards, or left, and a negative direction on the “y” axis goes down, or towards you.

# Positive and Negative Slopes

Here are what positive and negative slopes look like:

# Horizontal and Vertical Lines

Horizontal lines are when “y = a number”; for example, “y = 5” (with no “x” in the equation) is a horizontal line where y equals 5.  The slope is zero (0), since 0x means there is no x.  You can remember this since a “y” looks like an upside down “h”, and “h” is the beginning of the word “horizontal”.  The line “y = 0” sits on the x axis.

Vertical lines are when “x = a number”; for example, “x = –2″ (with no “y” in the equation) is a vertical line where x equals –2.  The slope is undefined, like the line is falling from the sky.  You can remember this since you can draw a “v” in an “x”, and “v” is the beginning of the word “vertical”.  The line “x = 0” sits on the y axis.

So here is what “0” and undefined slopes look like:

# Graphing Lines

There are many different ways to graph lines.  Let’s graph a line that’s a little more difficult so we’ll be able to graph any line!   Let’s graph the line:

## T-Chart Method:

Probably the easiest way (but not the most efficient) is just to use a T-chart, and plug in various values for x, and see what we get for y.  It doesn’t matter what you put in for x, but unless the numbers in the equation are very big or very small, just put numbers close to 0.  Remember that it only takes 2 points to draw a line!

It’s always good to pick 0 if you can, and do you see why I picked the points–3 and 3 (to get rid of the fractions)?

So I graphed the 3 points from the T-chart, and lo and behold, they are on the same line!

## Slope-Intercept Method:

Probably the most common way to graph a line is put the equation in the infamous y = mx + b form: graph the y-intercept point first, and then use the slope to go back and forth, and up and down from that first point.

So for our equation ,  the slope , and the y-intercept b = –2 (remember that when we subtract a number, it’s the same as adding the negative of that number).  Note that we can also write this equation .

Let’s graph!

# Converting Equations to the Slope-Intercept Formula

Let’s say we are given an equation in a form other than y = mx + b and we were asked to graph it.  Let’s graph:

So we know that this equation is not in the slope-intercept form, and we must use what we’ve learned about algebra to somehow get it in the form we know.   I know we all hate fractions, but they really aren’t that bad if we’re careful!

# Intercepts  Method

There is another way that you’ll learn about when you’re graphing lines, and I call this the “Cover Up” method (you’ll see why below), but it’s really called the “Intercepts method”.

Let’s say we have an equation in a form like 3x + 4y = 12.  This is actually in what we call standard form “Ax + By = C”, or when the x and is on one side (and with A, or the coefficient of x, not a fraction and not negative).

Do you see that in the case of 3x + 4y = 12,  A = 3, B = 4, and C = 12?

We can always turn this equation into the slope-intercept form y = mx + b, but we have an even easier way to graph it.  We can use the fact that both 3 and 4 go into 12 to graph this equation quite simply.  We only need two points to graph the line, right?

So when we “cover up” the 3x (or put 0 in for x), we get 4y = 12 or y = 3.   (Use your finger to actually cover up the 3x).

Similarly, when we “cover up” the 4y (or put 0 in for y), we get 3x = 12 or  x = 4.

So two points on our line are (0, 3), which is the y-intercept, and (4, 0), which is the x-intercept.  Remember that the y-intercept is when x = 0, and the x-intercept is when y = 0.

You can use this method for any equation in the form Ax + By = C, but it’s much easier when A and B go into C (otherwise you are dealing with fractions).   Do you see how the x-intercept is , and the y-intercept is ?  Pretty cool, isn’t it?

# Point-Slope Method

There is another formula that’s commonly used to graph a line, specifically when you have a slope and a random point that’s not the y-intercept.  This is called the point-slope formula, since it contains the slope and that random point:

, where  is any point on the line.

Now, this looks really difficult and confusing, but it’s quite simple.  All it means is that if you know the slope of the line and at least one point on the line, you easily get the equation of the line.  Also, if you get a formula in this form, you can easily graph the line; it’s actually easier than the slope-intercept form.  And we can always take this formula and put it back into the slope-intercept line or standard equation by doing a little bit of algebra!

So let’s say we know (2, 1) is on a line, and the slope is  –3.  Then we have an equation for the line:  .  That’s it!  That’s all your teacher will want. And if you have another point, either point (or any point on the line) will work.  It’s quite simple.  Now let’s graph it:

Now let’s turn this equation into both the slope-intercept form and also the standard form, using a wee bit of algebra.  You may be asked to do this in your algebra class.  You can see that we get the same graph!  So cool!

# Obtaining an Equation for a Line

Sometimes you’ll want to get the equation for line, given that you have two points on that line.  Remember that two points make any line; try this by drawing two points on a piece of paper and trying to draw more than one line between them; you can’t!

Suppose, with an example from another fair in another state, you know that Jane rode 4 rides and spent \$24 and Judy rode 2 rides and only spent \$16.  From these two points, you want a general equation of the line, to see how much it would cost, say, if you were to ride 7 rides.

This stuff is used a lot in business every day!

So we’ve learned that we can use the slope-intercept equation y = mx + b, or the slope-point equation .   We can use either equation, so I’ll show you how to use both.

For both equations, we first need to find the slope, which is the change in y’s over change in x’s.  Since the x is the number of rides, and the y is the price, Jane’s point on the line would be (4, 24), and Judy’s would be (2, 16).

Remember that we have to start with the same point in the subtraction on the top and the bottom:

So we can see that each ride costs \$4, since a slope is a rate.

At this point, it’d be easier to use the point-slope equation.  You can use either point; it will still get to the same equation!  You can also see how we can get the slope-intercept form of the equation with a little algebra:

We could have also used the slope-intercept equation, use either point for x and y, and solved for (I personally like this way better):

To graph this equation, we can either make a T-chart like the one below and plot points (remember, you actually only need 2 points), or plot the y intercept (0, 8) and then use the slope to go up 4, over 1, and then draw the line:

Again, do you see how when we make coordinate graphs, we look for the “question” on the bottom (the “x”) and then go over and find the “answer” on the line (the “y” part of the line)?  This is a very important concept.

Have fun at the fair!

# Parallel and Perpendicular Lines

### Parallel Lines

Parallel lines are lines that look like railroad tracks or the two lines in an equal sign; always remember that parallel lines have the same slope.  Notice that they never cross each other; you may have studied these before in Geometry.  Do you see how parallel lines would have the same slope?  If you look at any two different points on the lines, you would go back and forth, and up and down the same amount.  Or you can just memorize that parallel lines have the same slope.  One way to remember that parallel lines are lines in the same direction and never cross is to look at the two “l’s” in the word parallel.

Let’s talk about an example where two lines would be parallel.

Let’s say you and your friend Madison make the same amount of money at the mall, but your friend got a bonus of a \$25 gift certificate for the store when she started working.  If you include the \$25 that she got when she started working, if the two of you work the same number of hours, you will never catch up with her.

So if you both make \$10 an hour working at the accessories store at the mall, this would be your equation:

y = 10x

And this would be Madison’s equation:

y = 10x + 25

This is what they would both look like on a graph.  Notice that the slopes are the same (m = 10), but the y-intercepts are different: Madison has a y-intercept of 25, and you have a y-intercept of 0:

Do you also see why the lines “y = 5″ and “y = 6″ would be parallel horizontal lines, and the lines “x = 4″ and “x = 7″ would be parallel vertical lines?

## Perpendicular Lines

Perpendicular lines are lines that cross each other exactly like the corner of a piece of paper; they meet at what we call a “right” angle, or (if you’ve had Geometry), a 90 degree angle.

There’s something very peculiar about the slopes of perpendicular lines; their slopes are what we call negative reciprocals or opposite reciprocals of each other.  This sounds fancy, but all it means is that we take the first slope, change the sign (make it positive if it’s negative, or make it negative if it’s positive) and then flip it (for example, 2 would flip to be ,  would flip to be ) – we will have the slope of the line perpendicular to it.

So here are some examples of slopes of lines and their negative reciprocals (slopes of the line perpendicular to it).  Sometimes we write perpendicular as the symbol .

It sort of makes sense that we take the negative reciprocal, if you think about it.  Since the lines crisscross each other, it makes sense that if one slope is positive, the other is negative.  If you start at a point and go up 2 and over 1, for example, it would make sense that if you go over 2 and down 1, you’ll end up with a perfect corner: a right angle.  Try a few on a piece of graph paper.

## Parallel and Perpendicular with Horizontal and Vertical Lines

Note that we have some “special cases” when it comes to horizontal and vertical lines.

Here are examples of parallel horizontal (y = something) and vertical (x = something) lines:

Note that we also have special cases with finding lines perpendicular to horizontal and vertical lines.  Here is what we do:

As it appears, horizontal and verticals lines are perpendicular, since their slopes are negative reciprocals of one another.  The slope of a horizontal line is 0, and  is undefined.

For example, the line perpendicular to a horizontal line, like y = 5 at point (4, 5), is just the vertical line x = 4.  Also, the line perpendicular to a vertical line, like x = 4 at the point (4, 5) is just the horizontal line y = 5.

So we’re basically just throwing away the other part of the point that we don’t need (throwing away the x part if we’re ending up with a horizontal line, and throwing away the y part if we’re ending up with a horizontal line).  Here’s the graph:

## Problems:

Here are the types of parallel and perpendicular line problems you might get in your algebra class:

Problem:

Find the equation of the line (in slope-intercept form) that goes through the point (2, 1) and is parallel to the line  y = 4x + 3.

Solution:

So we know that we want an equation with slope 4, since it has to be parallel to the equation above.  But the y-intercept will be different, and we need to solve for that using the point we are given; we did a problem like this earlier.

We’ll use the slope-intercept form, since that’s what the problem is asking:

Problem:

Find the equation of the line (in slope-intercept form) that goes through the point (2, 1) and is perpendicular to the line  y = 4x + 3.

Solution:

So, like the problem above with parallel lines, we know we need to get the slope first in order to write the equation.

Because we are finding the line perpendicular and not parallel, we have to take the negative reciprocal of the original slope 4, so we our new slope will be .

But, again, the y-intercept will be different, and we need to solve for that using the point we are given.  We’ll use the slope-intercept form, since that’s what the problem is asking:

# Distance and Midpoint Formulas

There are a couple of formulas that you’ll learn (either in Geometry or Algebra or both) that have to do with the Coordinate System and points; these are the Distance Formula and the Midpoint Formula.

## Distance Formula

The Distance Formula is exactly what is says: it’s the distance between two given points.  It gives you a single number that is the distance measured between two points, say  and :   Distance =  .    It doesn’t matter which point is  and which point is  , as long as you always start with the same point when you do the subtracting.

Problem:

Find the distance between the points (2, –3) and (7, 2).

Solution:

Let  be (2, –3) and  be (7, 2).  So the distance between the two points is:

Notice in the graph for this example that the Distance Formula uses the Pythagorean Theorem, if you were to draw a right triangle “between” the points:

## Midpoint Formula

The Midpoint Formula gives you the point that is exactly half-way between two given points, say  and :  Midpoint =    Note that the result is an ordered pair and not just a number (thus, midpoint).   I like to think of the midpoint formula as just the averages of the two points.

Problem:

Find the midpoint between the points (2, –3) and (7, 2).

Solution:

Let  be (2, –3) and be (7, 2).  So the midpoint between the two points is:   If you were to look on the graph above, you can see that this point appears to be exactly in the middle of the two points (along the diagonal).

Problem:

One more type of problem may give you the midpoint and a point, and you have to find the other point.  For example,  (5, 0) is the midpoint of (3, 4) and another point.  Find the other point.

Solution:

We still need to use the midpoint formula, but have to solve backwards to get the other point:   Solve for and  to get 7 and –4, respectively.  So the other point is (7, –4).   You can always check your answer back by finding the midpoint of (3, 4), and (7, –4); you get (5, 0)!

# Graphing Linear Inequalities with Two Variables

We can also have inequalities with two variables, and we can graph them on the coordinate system.  When we have more than two or more equations on a graph, we typically see them in the “and” situation and not the “or” situation.  These types of graphs are actually kind of pretty and fun to do – almost like artwork!

To graph inequalities on the coordinate system, we need to get “y” by itself on the left hand side, so it’s best to use the “” formula.  This is because we’ll easily know which way to shade the graph, and we’ll make fewer errors doing this.  The shaded areas will be where the equation “works”; in other words, where the solutions are.

When we have “y  < ”, we always shade in under the line that we draw (or to the left, if we have a vertical line).  So think of “less than” as “raining down” from the graph.

When we have “y  > ”, we always shade above the line that we draw (or to the right, if we have a vertical line).  So think of “greater than” as “raining up” from the graph.  (I know – it doesn’t really “rain up”, but I still like to explain the graphs that way.)

Note that you can always plug in an ordered pair to see if it shows up in the shaded areas (which means it’s a solution), or the unshaded areas (which means it’s not a solution.)  For an example of this, see the first inequality below.

With “” and “” inequalities, we draw a dashed (or dotted) line to indicate that we’re not really including that line (but everything up to it), whereas with “” and “”, we draw a regular line, to indicate that we are including it in the solution.  To remember this, I think about the fact that “” and “” have less pencil marks than “” and “”, so there is less pencil used when you draw the lines on the graph.  You can also remember this by thinking the line under the “” and “” means you draw a solid line on the graph.

Note that the last example is a “Compound Inequality” since it involves more than one inequality.  The solution set is the ordered pairs that satisfy both inequalities; it is indicated by the darker shading.  We’ll use these types of graphs when we work in the Introduction to Linear Programming section later.

Here are some examples:

Learn these rules, and practice, practice, practice!

Click on Submit (the arrow to the right of the problem) to solve this problem. You can also type in more problems, or click on the 3 dots in the upper right hand corner to drill down for example problems.

If you click on “Tap to view steps”, you will go to the Mathway site, where you can register for the full version (steps included) of the software.  You can even get math worksheets.

You can also go to the Mathway site here, where you can register, or just use the software for free without the detailed solutions.  There is even a Mathway App for your mobile device.  Enjoy!

On to Direct, Inverse, Joint and Combined Variation – you are ready!