If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Solving systems of linear equations — Basic example

Watch Sal work through a basic Solving systems of linear equations problem.

Want to join the conversation?

  • hopper jumping style avatar for user star63700501
    But how does this work because if you plug in the x(3y) into the top equation you get y=9y.
    (45 votes)
    Default Khan Academy avatar avatar for user
    • aqualine ultimate style avatar for user varshamenon999
      Actually, these two lines intersect at the origin (as Sal mentioned). I originally got y = 9y and thought that there were no solutions, but if you subtract y from both sides you get 0 = 8y. Divide both sides by 8 and you'll still get 0 for y. The mistake that we made was by not combining like terms.
      (51 votes)
  • winston baby style avatar for user A Rev that trolls
    : IQ increasing to -14:
    (34 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user olimjonovnaa
    actually, the lessons are very understandable
    (29 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user rainbowunicorngirl14
    So to summarize:
    if mx and b is exactly the same = infinitely many solutions
    if mx is reciprocal = one solution
    if mx is the same = no solution
    (22 votes)
    Default Khan Academy avatar avatar for user
    • primosaur ultimate style avatar for user chakia cole
      Actually, If the two equations are similar for slope and y-intercept, then it has infinitely many solutions. If the slope is different for the two equations with similar y-intercepts, then it is one solution. If the slope of the two is the same but different y-intercepts, then it is no solution.
      (4 votes)
  • mr pink red style avatar for user Leena Salman
    can we solve these equations to get the ans?
    (5 votes)
    Default Khan Academy avatar avatar for user
    • purple pi purple style avatar for user doctorfoxphd
      Yes, but you have to be careful. The answer is not the number that you would get when you solved the equations. The answer is whether there are two solutions, only one solution, no solutions or infinite solutions.
      If you are able to get any solution, you CAN say that the "zero solutions option" is not correct
      Another reason it would be tricky to solve is that this problem is tricky to solve. If you try substitution to solve this system, you get some strange equations.
      x = 3y
      y = 3x

      If you substitute the value for x into the equation for y you get y = 3 (3y)
      So y = 9y

      You might be tempted to say IMPOSSIBLE! y cannot equal 9y
      Instead you need to use algebra to isolate the y by subtracting y from both sides:
      y - y = 9y - y
      So 0 = 8y
      divide both sides by 8 to get y = 0
      plug that into your original equation to find out that when y = 0, x = 0
      So there is one solution and it also explains why y can equal 9y.

      Sal decided to use the fact that this is a system of linear equations, which means it represents two lines. He quickly graphed the lines to show that they intersect at (0, 0) which is the same solution we found be solving.
      Since they are two lines, they CANNOT have two solutions--two lines can cross one time or can coincide (be duplicates of the same line) in which they have the same solutions at an infinity of places. If the lines are parallel (never crossing) they have NO solutions.

      Graphing is probably the easiest, safest and fastest way to answer this question, but solving gave us the same answer.
      (21 votes)
  • mr pink red style avatar for user brwhite
    if both equations have the same slope, how would i know whether they are parallel or the same line....?
    (6 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user Hecretary Bird
      Lines are defined based on their slope and y-intercept. If two lines have the same slope, the thing that differentiates them is their y-intercept. Lines that are the same will have the same slope and y-intercept, and lines that are only parallel will have the same slope but different y-intercepts.
      For example, lines (1) and (2) below are the same, but (3) is just parallel to them and not the same.
      (1) y = 2x + 4
      (2) 2y - 8 = 4x
      (3) y = 2x - 2
      (11 votes)
  • spunky sam blue style avatar for user Disturbed
    So if both equations have the same slope, how would i know whether they are parallel or the same line??
    (2 votes)
    Default Khan Academy avatar avatar for user
    • male robot johnny style avatar for user IDareYou93
      The slope formula is y=mx+b.
      m is the slope and b is the y axis intercept.

      To determine weither they are parallel or the same line we look at the y axis intercept (b).
      If they have the same value then they are the same line and if they're different then they are parallel giving that both equations have the same slope.
      (15 votes)
  • stelly orange style avatar for user Solomon Shalom  Lijo
    To sum on how to know know how many solutions a line has -

    *For context: Slopes are defined as MX and y-intercepts as B in the slope-intercept equation (y = mx + b)

    1. If the slopes are different, it has one solution

    2. If the slopes and y-intercept is the same, infinite solutions

    3. If the slopes are the same but different y-intercepts, it has no solutions

    **If confused, use the desmos calculator by plugging in values and checking how the lines look :D

    Cheers! ATB & Do ask if you got any Q's - will try my best to answer it <3
    (5 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user sheikhdania98
    Can't we solve this using the same method as simultaneous equations??
    (4 votes)
    Default Khan Academy avatar avatar for user
  • starky tree style avatar for user Yaniv Golden
    How exactly does x/3 = 1/3x?
    (3 votes)
    Default Khan Academy avatar avatar for user

Video transcript

- [Instructor] We're told the system of equations above has solution X, Y. What is the value of X? Pause this video and have a go at it before we work through it together. All right, now there's several ways that you could approach it, but the way I like to think about it right when I look at it is if in one of the equations I've already explicitly solved for a variable. So I have Y is equal to two X. Well, in the other equation I could substitute for that variable that has been solved for. So if Y is equal to two X, wherever I see Y in the other equation, I can replace it, I can substitute that with a two X. And then what does that give us? Well, this second equation here becomes three X plus, instead of Y I can write two X because I'm substituting, and then that is equal to 30. And then what's three X plus two X? Well, that of course is equal to five X is equal to 30. I can divide both sides by five, since that's the coefficient on the X term. And I get X is equal to six. And I am done. Now, another way we could approach this is through elimination. If I subtract Y from both sides of this top equation, I will get zero is equal to two X minus Y, or of course, I could write that as two X minus Y is equal to zero. And then I'll rewrite this second equation three X plus Y is equal to 30. And then notice, if I add the left-hand side to the left-hand side and the right-hand side to the right-hand side, the Ys are going to cancel out. I'll get two X plus three X is five X, negative Y plus Y, that's zero Y. They just cancel out. And then zero plus 30 is equal to 30. And so we get back to this step. You solve for X. You get X equals six again.