# Finding the intersection of two lines in terms of y and x

I am trying to understand how I can find the point of intersection between two lines numerically. I know how to do this graphically. I would need the two equations in slope intercept form and then graph them either on paper or on my calculator. But to find the point of interception I would usually turn to my calculator. I didn't know how to do it manually.

Now I have learned that I can set the two equations as equal to each other and solve for x. That would be my x coordinate. Then I can substitute that x into one of the original equations and solve for y. That would be my y coordinate.

But I wonder why this is possible? What is the logic behind this? I know how to do it but I'm trying to get an intuitive sense for why this is.

Here's an example with two equations.

Equation 1

$y=-\frac{1}{3}x-7$

Equation 2

$y=3x+9$

Set them as equal and solve for x.

$$-\frac{1}{3}x-7=3x+9$$

$$-\frac{1}{3}x=3x+9+7$$

$$-\frac{1}{3}x=3x+16$$

$$-\frac{1}{3}x-3x=16$$

$$-\frac{1}{3}x-\frac{9x}{3}=16$$

$$\frac{-10}{3}x=16$$

$$-10x=48$$

$$x=\frac{48}{-10}$$

$$x=-\frac{24}{-5}$$

This would be the x coordinate. Now substitute this value of x in one of the original equations and solve for y. That would be the y coordinate. Let's use the first equation.

$$y=-\frac{1}{3}x-7|x=-\frac{24}{-5}$$

$$y=-\frac{1}{3}\cdot \frac{-24}{5}-7$$

$$y=-\frac{1}{1}\cdot \frac{-8}{5}-7$$

$$y=\frac{8}{5}-\frac{35}{5}$$

$$y=\frac{-27}{5}$$

Now let's see if we can get the same value of y if we plug in the same value of x in that second equation.

$$y=3x+9|x=-\frac{24}{-5}$$

$$y=3\cdot \frac{-24}{5}+9$$

$$y=\frac{3}{1}\cdot \frac{-24}{5}+9$$

$$y=\frac{-72}{5}+\frac{45}{5}$$

$$y=\frac{-27}{5}$$

So yeah, we get the same value for y, regardless of what equation we use. So the point of interception is $(-\frac{24}{-5},\frac{-27}{5})$ or $(-4.8,-5.4)$.

So this all checks out with the actual graph. But why is this possible? Why am I able to make a statement like this and say that one equation is equal to the other? I know how to use this now but I'm not sure why it works.

I thought about this for a while. And the only thing I could understand is that the y coordinate and the x coordinate of one line is equal to the y coordinate and the x coordinate of the second line, at the point of intersection. But it still doesn't explain why I can set the equations as equal to each other.

Then it hit me that both equations are written in terms of y. So the right side of the equations are like the x. So if I say that $y_1=y_2$ then $-\frac{1}{3}x-7$ is also equal to $3x+9$.

Using the same logic, I decided to try to rewrite the two original equations in terms of the x. The idea is to set set the two equations as equal, but in terms of x this time. I would then solve for y and get the y coordinate. Then I would substitute the y into one of the equations and get the x coordinate. I'll show you the whole thing here.

Equation 1 is, once again $y=-\frac{1}{3}x-7$ so let's solve for x.

$$y=-\frac{1}{3}x-7$$

$$y+7=-\frac{1}{3}x$$

$$\frac{-3}{1}\cdot y+7=x$$

$$\frac{-3y}{1}+7=x$$

$$-3y+7=x$$

$$x=-3y+7$$

Equation 2 is $y=3x+9$ so let's solve for x.

$$y=3x+9$$

$$y-9=3x$$

$$\frac{y}{3}-\frac{9}{3}=x$$

$$\frac{1}{3}y-3=x$$

$$x=\frac{1}{3}y-3$$

Set the two equations as equal and solve for y.

$$-3y+7=\frac{1}{3}y-3$$

$$-3y=\frac{1}{3}y-10$$

$$\frac{-3y}{1}-\frac{1}{3}y=-10$$

$$\frac{-9y}{3}-\frac{1y}{3}=-10$$

$$\frac{-10y}{3}=-10$$

$$-10y=-30$$

$$y=\frac{-30}{-10}$$

$$y=\frac{30}{10}$$

$$y=3$$

Now let's evaluate the two equations for when $y=3$. We can start with the first equation.

$$x=-3y+7|y=3$$

$$x=-3\cdot 3+7$$

$$x=-9+7$$

$$x=-2$$

Now let's evaluate the second equation. Just to verify that we get the same value of x.

$$x=\frac{1}{3}y-3|y=3$$

$$x=\frac{1}{3}\cdot 3-3$$

$$x=1-3$$

$$x=-2$$

So the math checks out but this point is not the point of intersection. But it does sit on one of the lines, namely on $y=-\frac{1}{3}x-7$. So what point is this then? I didn't change the equations, did I? I only changed the form of the equations by isolating the x. So shouldn't I be getting the same point as when I have y isolated?

-

Going from $$y+7=-\frac13x,$$ multiplication of both sides of the equation by $-3$ should produce $$-3y-21=x,$$ not $$-3y+7=x.$$

In general, if we're dealing with two lines (not necessarily in slope-intercept form) in a plane, then there are only three possibilities for where they intersect:

(i) nowhere (parallel lines),

(ii) at every point on the lines (they are actually the same line),

(iii) exactly one point.

Your two examples (second example caused by calculation error) are both of type (iii). If you are trying to solve a type (i) situation, you'll end up with a false equation like $0=2$. For example, consider the two lines $y=2x+1$ and $x=\frac12y+8$. If you are trying to solve a type (ii) situation, you'll come up with a true (but uninteresting) equation like $3=3$. For example, consider the lines $y=-x+1$ and $x=-y+1$.

-

You go from $y+7=-\frac{1}{3}x$ to $-3y+7=x$, which is incorrect. It should be $$-3(y+7)=-3y-21=x.$$

-

Setting aside arithmetic errors, I think this is the heart of your question:

But why is this possible? Why am I able to make a statement like this and say that one equation is equal to the other? I know how to use this now but I'm not sure why it works.

First, let's think about what we mean when we write a single equation like $y = 3x + 9$. Why does this specify a line? It's because the line is the set of pairs $(x,y)$ which make the equation true. That is, for any point on the line, if you plug in its $x$ and $y$ values to the equation, you get a true statement about numbers. (For example, $(1,12)$ is on the line because $12 = 12$, but $(0,0)$ is not on the line because $0\neq 3$.)

When we're interested in the intersection of two lines, $$\begin{cases} y = -\frac{1}{3}x - 7 \\ y = 3x + 9,\end{cases}$$ we write both equations. Our goal is to discover the set of points that make both equations true. If $(x,y)$ is a solution of both equations, i.e., an intersection point, then we know two facts about $y$ since $(x,y)$ is on both lines: $y$ equals $-\frac{1}{3}x-7$, and it also equals $3x + 9$. Substitute one on the left side and the other on the right side of the trivial equation $y = y$, and you're off.

-

The other answers show that you made a mistake, but you wanted some intuitive reason behind why you can set the two equations equal to each other right? Well, if you have the equation of a line

$y=mx+b$

what that means is there is a specific value of $y$ associated to each value of $x$. I will call these $specific$ values $x_1$ and $y_1$, so my equation is $y_1=m_1x_1+b_1$. I have pairs $(x_1,y_1)$ (in cartesian coordinates) which satisfy my line.

Now take a second line

$y_2=m_2x_2+b_2$

This line has $specific$ values of $x$ and $y$ that satisfy it, let me call those pairs $(x_2,y_2)$.

Now consider what $intersection$ means; two lines intersect if they touch each other at some point. Mathematically, that means that both of the coordinates must be equal:

$x_1=x_2,\quad y_1=y_2$

These both must be satisfied. Consider if only one of these conditions is satisfied, say $x_1=x_2$. That just means you are evaluating the lines at the same value of $x$ - there is no reason to think they will return the same value of $y$. However, if both those conditions are satisfied to can do the following:

$y_1=y_2$

$m_1x_1+b_1=m_2x_2+b_2\rightarrow m_1x_1+b_1=m_2x_1+b_2$

$x_1=\frac{b_2-b_1}{m_1-m_2}=x_2$

Now since you assumed $y_1=y_2$ to begin with, you can plug this expression $back$ into the equations for the lines and you will see the equations are satisfied. Because you set them to be equal in the first place!

-