 Application Center - Maplesoft

# Solving systems of equations

You can switch back to the summary page by clicking here.

0604.mws

Module 6 : Precalculus

604 : Systems of Equations

O B J E C T I V E

In this project we will investigate and solve systems of two, three, and four unknowns algebraically, and visualize systems and their solutions.

S E T U P

In this project we will use the following command packages. Type and execute this line before begining the project below. If you re-enter the worksheet for this project, be sure to re-execute this statement before jumping to any point in the worksheet.

> restart; with(plots):

```Warning, the name changecoords has been redefined
```

___________________________________________________________________________________

A. Systems with Two Unknowns

___________________________________________________________________________________

SOLUTIONS & GRAPH

First, well define a system of equations by enclosing a set of equations in set braces

1 st linear equation 2 nd linear equation

our name for the system equations are separated by commas

> sys := { 3*x + 4*y = 12 , y = 4*x - 1 } ; We can solve the system with a single command in Maple, using the solve command.

> solve( sys, {x,y} ); And finally, we can graph the system.

> implicitplot( sys, x = -10..10, y = -10..10, thickness = 2, color = green); The point of intersection is the solution to the system

THREE CASES

In the example above, we were able to find a solution. More generally, when you attempt to solve a system, there are three possible outcomes
The system is independent and consistent - in which case there is a single solution
The system is inconsistent - in which case there is no solution
The system is dependent - in which case there are infinite number of solutions.
Lets look what happens when we encounter these two later types of systems which dont yield a single solution.

Here is an inconsistent system.

The lines are parallel and Maple is unable to solve the system since there is no solution.

> sys:= { 10*x + 6*y = 30, 10*x + 6*y = -30}; > solve( sys, {x,y} );

> implicitplot( sys, x = -10..10, y = -10..10,thickness = 2); Here is an example of dependent system.

There is only one line because the two lines in the system are actually one and the same.

> sys := { 4*x - 6*y = 30, 3*y = 2*x-15 }; > solve( sys, {x,y} ); > implicitplot( sys, x = -10..10, y = -10..10,thickness = 2); ___________________________________________________________________________________

B. Systems with Three Unknowns

___________________________________________________________________________________

Now, well look at systems of three unknowns. The graph of an equation in three unknowns is a plane in three dimensions. Geometrically, the system is a set of three planes. Just as before, to solve the system we need to find a point of intersecion where all three planes meet.

> sys := { z = 4, x+y= 10, x-y = 5 }; > solve( sys, {x,y,z} ); > implicitplot3d( sys, x = -10..10, y = -10..10, z=-10..10,
shading = zhue, orientation = [-160,50] ); The solution occurs at the point where the three planes meet. Unlike looking at a diagram in a textbook, you are not limited to simply looking at his graph. You can click the mouse anywhere on the graph. You will see a black border appear around the graph. If you click and drag the mouse on the graph, it will rotate the graph in three dimensions. In this way, you can see around, under, and over the graph and view the scene from every angle.

It might be a little difficult to identify the solution point. So see it easier, please enter this command.

> display(implicitplot3d(sys, x = -10..10, y = -10..10, z=-10..10, shading = xyz,
style=patchnogrid, orientation = [156,75]),
spacecurve({[t,10-t,4], [t,t-5,4], [15/2,5/2,t]},t= -10..10,
color = red, thickness = 2)); You can now see three lines which are the intersection lines of each pair of the three planes. The place wherethese three red lines meet is the solution point.

INCONSISTENT SYSTEM

We saw earler that an inconsistent 2-by-2 system was a set of parallel lines which never intersect. Similarly, an inconsistent 3-by-3 system does not have a single point of intersection. However, there are several ways this can happen

> sys := { 2*x - 3*y = 10, 2*x+y= 7, y = 2*x + 4 }; > solve( sys, {x,y,z} );

> implicitplot3d( sys, x = -10..10, y = -10..10, z=-10..10,
style= patchcontour, orientation =[-20,40], title=`inconsistent system`); There are still three planes, but not a single point where all three come together. Notice that Maple can not solve inconsistent systems since such systems do not have solutions.

DEPENDENT SYSTEM

A dependent system in three dimensions means all three planes coincide or the three planes come together in a line. In either case there are infinite number of solutions. Here is an example of a dependent system in three dimensions

> sys := { x + y + z = 1, x + 3*y - z = 2, 2*x + 4*y = 3 }; > solve( sys, {x,y,z} ); The solution that Maple returns, {x = 1/2-2*z, z = z, y = 1/2+z}, need to be interpreted slightly. This solution expresses x, y, and z in terms of z. Typically, in a mathematics class, we would write this type of solution in a little different way. Since z is the independent variable (we can tell this because we see z =z in the solution), we will let z be some parameter, lets say z = t. Then substitute t for z in the equations for x an y. The final answer would look like this: x = 1/2 -2*t, y = 1/2 +t, z = t. Another way to write this solution is in a vector form as { [ 1/2 -2t, 1/2 + t, t ] : t is a real number}

> implicitplot3d( sys, x = -10..10, y = -10..10, z=-10..10, orientation = [10,80],
style = patchnogrid, title=`dependent system`); There is a solution but it is not a single point. In this case, the three planes intersect in a line. Here is view of the solution line.

> display(implicitplot3d( sys, x = -10..10, y = -10..10, z=-10..10,
orientation = [-30,110], style = patchnogrid),
spacecurve([1/2 - 2*t, 1/2 + t,t],t = -10..10, color = red, thickness = 3)); As you can see, the line passes through the intersection of the three planes.

___________________________________________________________________________________

C. Systems with Four Unknowns

___________________________________________________________________________________

Although we can not graph systems of 4 variables, we can still solve them. At some point when we start solving larger and larger systems, we find it more convenient to drop the use of x,y, and z, and start using number variables x1, x2, x3, and x4, etc. Its the same idea as before.

> sys := { 4*x1 + 7*x2 - x3 + 3*x4 = 11,
-2*x1 + 2*x2 - 6*x3 + x4 = 4,
x1 - 3*x2 + 4*x3 - x4 = -3,
3*x1 - 5*x2 - 7*x3 + 5*x4 = 8 }; > solve( sys, {x1, x2, x3, x4 } ); Just as in the smaller systems, its possible to have dependent systems. Here is an example which requires a single parameter.

> sys := { x1 + 2*x2 + 3*x3 + 4*x4 = 51,
x1 - 3*x2 + 4*x3 + x4 = 32,
x1 + 2*x2 - 6*x3 + x4 = -23 }; > solve( sys, {x1, x2, x3, x4 } ); Here is another dependent system. This time the solution requires 2 parameters (x3 and x4).

The answer looks like this in function form :
{x1 = 10-7*t-2*u, x2 = 0, x3 = t, x4 = u}, and this in vector form { [ 10-7*t-2*u, 0, t, u ] where t and u can be any real number }.

> sys:={x1+ 3*x2+7*x3 + 2*x4 = 10,
x1+ 4*x2 +7*x3 + 2*x4 = 10,
x1 + 4*x2 +7*x3+2*x4 = 10}; > solve( sys, {x1, x2, x3, x4 } ); >