Chapter 2 - Linear Systems of Equations and Matrices

Section 2.1 - Linear Systems of Equations

Example 2.1.1

Solve[{5 x+2 y==9,8 x-3 y==-4},{x,y}]

ContourPlot[{5 x+2 y==9,8 x-3 y==-4},{x,-5,5},{y,0,5},ContourStyle->{{Red,Thickness[0.01]},{Blue,Thickness[0.01]}},PlotRange->All,Axes->True,Frame->False,AspectRatio->2/3]

Example 2.1.2

Solve[{5 x+2 y==9,10 x+4 y==-7},{x,y}]

ContourPlot[{5 x+2 y==9,10 x+4 y==-7},{x,-5,5},{y,0,5},ContourStyle->{{Red,Thickness[0.01]},{Blue,Thickness[0.01]}},PlotRange->All,Axes->True,Frame->False,AspectRatio->1/2]

Example 2.1.3

Solve[{5 x+2 y==9,-5 x-2 y==-9},{y,x}]

f=5 x-2 y+7 z==15;

ContourPlot3D[Evaluate[f],{x,-7,7},{y,-7,7},{z,-7,10},Mesh->None,ContourStyle->Red,AspectRatio-> 1/2]

Example 2.1.4

g=3 x+8 y-z==-4;

TwoPlanes=ContourPlot3D[Evaluate[{f,g}],{x,-7,7},{y,-7,7},{z,-7,17},ContourStyle->{Red,Blue},Mesh->None,AspectRatio-> 1/2]

solnline=Solve[{f,g},{x,y}][[1]]

plotsolnline=ParametricPlot3D[{x/.solnline[[1]],y/.solnline[[2]],z},{z,-7,10},PlotStyle-> {{Black,Thickness[0.01]}}];
Show[TwoPlanes,plotsolnline,PlotRange->All]

Example 2.1.5

h=-9 x+6 y+5 z==7;

soln=Solve[{f,g,h},{x,y,z}][[1]]

solnpoint={x/.soln[[1]],y/.soln[[2]],z/.soln[[3]]}

ThirdPlane=ContourPlot3D[Evaluate[h],{x,-7,7},{y,-7,7},{z,-7,17},ContourStyle->{Yellow},Mesh->None];

solnpointplot=Graphics3D[{White,Sphere[solnpoint,1]}];

Show[{TwoPlanes,ThirdPlane,solnpointplot},PlotRange->{{-7,7},{-7,7},{-7,7}},AspectRatio->1]

Example 2.1.6

Solve[{5 x-2 y+7 z-3 w-t==25,3 x+8 y-z+2 w-7 t==-4,-9 x+6 y+10 z+w+5 t==7},{x,y,z}]

Solve[{5 x-2 y+7 z-3 w-t==25,3 x+8 y-z+2 w-7 t==-4},{x,y}]