[Math] Finding the intersection of two lines in terms of y and x

linear algebra

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?

Best Answer

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$.

Related Question