Exploring Analyic Geometry with Mathematica® |
|||||
| Home | Contents | Commands | Packages | Explorations | Reference |
| Tour | Lines | Circles | Conics | Analysis | Tangents |
Cramer's Rule (Two Equations)
cramer2.html
Exploration
Show that the solution to the system of two linear equations in two unknowns
is given by
and
,
where
.
Approach
Use the Mathematica Det command to compute the appropriate determinants and then substitute the solutions back into the original equations to demonstrate that they solve the equations.
Initialize
To initialize Descarta2D, select the input cell bracket and press SHIFT-Enter.
This initialization assumes that the Descarta2D software has been copied into one of the standard directories for AddOns which are on the Mathematica search path, $Path.
<<Descarta2D`
Solution
Compute the necessary determinants.
Clear[a1,b1,c1,a2,b2,c2];
dx=Det[{{-c1,b1},{-c2,b2}}];
dy=Det[{{a1,-c1},{a2,-c2}}];
dD=Det[{{a1,b1},{a2,b2}}];
Compute the solutions.
{x1,y1}={dx/dD,dy/dD}
Show that the solutions solve the original equations.
Clear[x,y];
{a1*x+b1*y+c1, a2*x+b2*y+c2} /.
{x->x1,y->y1} //Simplify
Discussion
The Solve command produces the same result.
Solve[{a1*x+b1*y+c1==0,
a2*x+b2*y+c2==0},{x,y}] //Simplify