How to Solve a System of Two Linear Equations

Linear equations are encountered in everyday life. For example, if 4 apples and 5 oranges cost $2, and 3 apples and 4 oranges cost $1.55, how much does each apple and each orange cost? This article will show you how to solve any system of two linear equations.



Steps

  1. Image titled Solve a System of Two Linear Equations Step 1
    1
    Determine what the unknowns are and assign them variables. For example, let x = price of one apple, y = price of one orange.
  2. Image titled Solve a System of Two Linear Equations Step 2
    2
    Set up the equations. For example:
    • If 4 apples and 5 oranges cost $2, write 4x + 5y = 2. (Eq. 1)
    • If 3 apples and 4 oranges cost $1.55, write 3x + 4y = 1.55. (Eq. 2)
  3. 3
    Solve
    • By the Method of Elimination

      In this method we first solve for a variable by eliminating the other variable. Let's solve for x by eliminating y. The steps are
    1. Multiply Eq. 1 by the coefficient of the other variable (y) in Eq. 2

      Multiplying Eq. 1 by 4, we get 16x + 20y = 8
      Image titled Solve a System of Two Linear Equations Step 3Bullet2
    2. Multiply Eq. 2 by the coefficient of the other variable (y) in Eq. 1

      Multiplying Eq. 2 by 5 we get 15x + 20y = 7.75
      Image titled Solve a System of Two Linear Equations Step 3Bullet3
    3. Subtract the two equations

      We get x = 0.25. Therefore, price of an apple in the example is $0.25
      Image titled Solve a System of Two Linear Equations Step 3Bullet4
    4. To find the value of the other variable (y), plug in the value of x obtained in any of the equations we had.

      Plugging in x = 0.25 in Eq. 1 we get,

      4(0.25) + 5y = 2

      => 1 + 5y = 2

      => 5y = 2 - 1

      => 5y = 1

      => y = 1/5 = 0.20 Therefore, price of an orange in the example is $0.20
      Image titled Solve a System of Two Linear Equations Step 3Bullet5
    • By the Method of Substitution

      Read on the wikiHow How to Solve Simultaneous Equations Using Substitution Method

Alternative method by matrix reduction

  1. Set up the the system of linear equations as a matrix equation.
  2. Reduce the left-most matrix to the identity matrix using one of these two operations:

    • Multiplication of a row on both sides through by a constant;
    • Subtraction of a row on both sides by a multiple of another row.
      • (Make sure that, when carrying out these operation, you match the columns correctly.) See Figure 1 for an example:

Solving a general system of two linear equations

  1. Let the equations be ax + by = u (Eq. 1) and cx + dy = v (Eq. 2), where a, b, c, d, u, v are given numbers, and x and y are the unknowns. Assume that a, b are not both zero, and c,d are not both zero.
  2. To solve for x, multiply the first equation by d and the second equation by b, then subtract, to get (ad - bc)x = du - bv.
  3. To solve for y, multiply the first equation by c and the second equation by a, then subtract, to get (ad - bc)y = av - cu.
  4. If ad - bc ≠ 0, divide both equations by ad - bc to get x = (du - bv)/(ad - bc), and y = (av - cu)/(ad - bc). In the example above, a=4, b=5, c=3, d=4, u=2, and v=1.55. Since ad - bc = 1 ≠ 0, plug the numbers in to get x=0.25 and y=0.20.
  5. If ad - bc = 0, and c ≠ 0, let k = a/c, so a = ck. Substitute into ad = bc to get cdk = cb, or dk = b (sine c ≠ 0). If c = 0, d ≠ 0 by assumption above, so let k = b/d, or b = dk. Substitute into ad = bc to get ad = cdk, or a = ck. If k = 0, then a = b = 0, contrary to assumption. So k ≠ 0. Multiply Eq. 2 by k, to get ckx + dky = kv, or ax + by = kv. If u = kv, then this is the same as Eq. 1, in which case the system has infinitely many solutions (x,y) that satisfy the first equation. If u ≠ kv, then (x,y) satisfying the first equation will not satisfy the second, and the system has no solution.
  6. In sum:
    • If there is no number k such that a = ck and b = dk, then the system of 2 linear equations has a unique solution, given by x = (du - bv)/(ad - bc), and y = (av - cu)/(ad - bc). This is analogous to two straight lines intersecting at one point.
    • If there is a number k such that a = ck and b = dk, and u = vk, then the system of 2 linear equations has infinitely many solutions. This is analogous to two straight lines that coincide.
    • If there is a number k such that a = ck and b = dk, and u ≠ vk, then the system of 2 linear equations has no solution at all. This is analogous to two straight lines parallel to each other.

Tips

  • Matrix reduction method has the advantage of simplicity, and it can also be generalized to solve systems of more than 2 linear equations.

Article Info

Categories: Algebra