Download presentation
Presentation is loading. Please wait.
1
Solving Systems of Equations
259 Lecture 12 Spring 2017 Solving Systems of Equations
2
A System of Equations Consider the system of two equations in two unknowns: x + 2y = 1 (1) 3x + 4y = -1 (2) Recall from algebra class that two ways to solve a problem like this are substitution and elimination.
3
Example 1 (Substitution)
Solve (1) or (2) for one variable in terms of the other and substitute for that variable in the other equation. x + 2y = 1 (1) 3x + 4y = -1 (2) Solving (1) for x yields x = 1 – 2y (3)
4
Example 1 (cont.) Using (3) we can substitute 1 – 2y for x in (2):
3(1 – 2y) + 4y = -1 3 – 6y + 4y = -1 -2y = -4 y = 2 (4) (4) in (3) implies x = 1 – 2(2) = -3. Check (x, y) = (-3, 2) solves (1), (2).
5
Example 2 (Elimination)
x + 2y = 1 (1) 3x + 4y = -1 (2) Multiply both sides of (1) or (2) by a non-zero constant to get coefficients in front of one variable that can be added to get zero. Then add to eliminate that variable and solve for the remaining variable.
6
Example 2 (cont.) Multiplying (1) by -2 on both sides, we get an equivalent system; -2x - 4y = -2 (3) 3x + 4y = -1 (2) Adding (3) to (2) gives an equation involving only x which can be solved for x. x = (4)
7
Example 2 (cont.) Substituting x = -3 from (4) back into either (1) or (2) (why these?), we can solve for y. In this case, we choose (1): x + 2y = 1 -3 + 2y = 1 2y = 4 y = 2 Again, we find (x, y) = (-3, 2) and would need to check it works in (1),(2)!
8
Solving a System of Equations with Technology
How could we use technology to help us solve system (1), (2). One way might be to use a calculator with this capability. How about Mathematica or Excel?
9
Example 3: Solving a System of Equations in Excel
We can use the Solver to solve a system of equations! Let’s try with (1), (2). To do so, we need to choose one target cell (i.e. objective cell) and specify appropriate constraints. Think of the system as a*x + b*y = e c*x + d*y = f, with a=1, b=2, c=3, d=4, e=1, and f=-1. Then the objective can be to set ax+by = 1, subject to the constraints e = 1 and f = -1.
10
Example 3: Solving a System of Equations in Excel
11
Example 4: Solving a System of Equations in Mathematica
For Mathematica, we use the Solve command: Solve[{x+2y==1, 3x+4y==-1},{x,y}]
12
Example 4: Solving a System of Equations in Mathematica
We can also solve a system like this in general: To solve the system a*x + b*y = e c*x + d*y = f, use the command: Solve[{a*x+b*y==e, c*x+d*y==f},{x,y}]
13
Example 4: Solving a System of Equations in Mathematica
We find that for the system a*x + b*y = e c*x + d*y = f, the solution is: x = (bf – de)/(ad – bc) y = (af – ce)/(ad – bc) Try with coefficients and right-hand side from (1), (2) to see if we get the same solution! For what choices of a, b, c, d, e and f, do we get a solution to this system?
14
Systems of Equations in General
We can generalize the problem discussed above to a system of n equations in n unknowns! For example, here is a system of three equations in three unknowns: ax + by + cz = j dx + ey + fz = k gx + hy + iz = l How could we solve this? By hand? Calculator? With Mathematica? With Excel? Other? When are we guaranteed a solution?
15
Example 5: Mathematica Solution for 3 x 3 Case
16
Example 5 (cont.)
17
References The idea of how to use the Solver comes from a web supplement for Finite Mathematics (7th ed) by Margaret Lial et al. found at this link:
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.