Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168765
Image: ubuntu2004
var('a b c d') A = matrix([[a, b], [c, d]]) A
\newcommand{\Bold}[1]{\mathbf{#1}}\left(abcd\begin{array}{rr} a & b \\ c & d \end{array}\right)
det(A)
\newcommand{\Bold}[1]{\mathbf{#1}}a d - b c

The determinant of a 2 × 2 matrix is the difference between the left and right diagonal products.

If we visualize the matrix as a list of lists, [[a,b],[c,d]][[a, b], [c, d]], then
the determinant is the difference between the outer and inner products.

Geometrically, if we interpret the 2 × 2 matrix as a point matrix, then the determinant (or its absolute value) is equal to the area of a parallelogram determined by that matrix:

@interact def _(diags = [False, True], a = (1..10), b = (1..10), c = (1..10), d = (1..10)): parallelogram = polygon([(0, 0), (a, b), (a+c, b+d), (c, d)], color = 'purple') background = polygon([(0, 0), (a+c, 0), (a+c, b+d), (0, b+d)], color = 'black') coordinate_lines = line([(a, 0), (a, b+d)], color = 'green', linestyle = '--') + \ line([(0, b), (a+c, b)], color = 'green', linestyle = '--') + \ line([(c, 0), (c, b+d)], color = 'green', linestyle = '--') + \ line([(0, d), (a+c, d)], color = 'green', linestyle = '--') coordinate_labels = text((0, 0), (0, 0), color = 'orange') + \ text((a, b), (a, b), color = 'orange') + \ text((c, d), (c, d), color = 'orange') + \ text((a+c, b+d), (a+c, b+d), color = 'orange') display = background + parallelogram + coordinate_lines + coordinate_labels if diags: if b/a > d/c: ydiag = line([(a, b), (0, b+d)], color = 'yellow', linestyle = '--') xdiag = line([(c, d), (a+c, 0)], color = 'yellow', linestyle = '--') else: ydiag = line([(c, d), (0, b+d)], color = 'yellow', linestyle = '--') xdiag = line([(a, b), (a+c, 0)], color = 'yellow', linestyle = '--') display = display + ydiag + xdiag show(display, aspect_ratio = 1) rectangle = (a+c)*(b+d) if b/a > d/c: darts = (a+c)*d + (b+d)*a else: darts = (a+c)*b + (b+d)*c print 'Area of Parallelogram = |',a,'*',d,' - ',b,'*',c,'| = ',abs(a*d - b*c) print '\nArea of Rectangle - Surrounding Area = ' print rectangle,' - ', darts,' = ', rectangle - darts
diags 
[removed]
[removed]
[removed]
[removed]
var('a b c d') rectangle = (a + c)*(b + d) darts = (a+c)*b + (b+d)*c #darts = (a+c)*d + (b+d)*c #darts = (a+c)*b + (b+d)*a #darts = (a+c)*d + (b+d)*a rectangle - darts
\newcommand{\Bold}[1]{\mathbf{#1}}{\left(b + d\right)} {\left(a + c\right)} - {\left(b + d\right)} c - {\left(a + c\right)} b
expand(rectangle - darts)
\newcommand{\Bold}[1]{\mathbf{#1}}a d - b c

The absolute value of the determinant of a 2 × 2 matrix point matrix is the area of the parallelogram whose sides are vectors determined by that matrix.

If the matrix is [(a,b),(c,d)][(a, b), (c, d)], then the parallelogram would have sides that are vectors originating at (0,0)(0, 0), continuing through (a,b)(a, b) and (c,d)(c, d), and terminating at (a+c,b+d)(a+c, b+d)

This terminating point is also known as the resultant of the two vectors.

Cramer's Rule

a1x+b1y=c1a_1x + b_1y = c_1
a2x+b2y=c2a_2x + b_2y = c_2

var('a1, b1, c1, a2, b2, c2, x, y')
\newcommand{\Bold}[1]{\mathbf{#1}}\left(a_{1}, b_{1}, c_{1}, a_{2}, b_{2}, c_{2}, x, y\right)

If you want to see Cramer's Rule using specific values, enter those values below and evaluate the cell.

If you want to see the purely symbolic form, skip the following cell and evaluate the next one.

a1, b1, c1 = 1, 2, 3 a2, b2, c2 = 6, 7, 8
a1*x + b1*y == c1; a2*x + b2*y == c2
\newcommand{\Bold}[1]{\mathbf{#1}}a_{1} x + b_{1} y = c_{1}
\newcommand{\Bold}[1]{\mathbf{#1}}a_{2} x + b_{2} y = c_{2}
D = matrix([[a1, b1], [a2, b2]]) D; det(D)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(a1b1a2b2\begin{array}{rr} a_{1} & b_{1} \\ a_{2} & b_{2} \end{array}\right)
\newcommand{\Bold}[1]{\mathbf{#1}}a_{1} b_{2} - a_{2} b_{1}
Dx = matrix([[c1, b1], [c2, b2]]) Dx; det(Dx)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(c1b1c2b2\begin{array}{rr} c_{1} & b_{1} \\ c_{2} & b_{2} \end{array}\right)
\newcommand{\Bold}[1]{\mathbf{#1}}-b_{1} c_{2} + b_{2} c_{1}
Dy = matrix([[a1, c1], [a2, c2]]) Dy; det(Dy)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(a1c1a2c2\begin{array}{rr} a_{1} & c_{1} \\ a_{2} & c_{2} \end{array}\right)
\newcommand{\Bold}[1]{\mathbf{#1}}a_{1} c_{2} - a_{2} c_{1}
x, y = det(Dx)/det(D), det(Dy)/det(D) x, y
\newcommand{\Bold}[1]{\mathbf{#1}}\left(-\frac{{\left(b_{1} c_{2} - b_{2} c_{1}\right)}}{{\left(a_{1} b_{2} - a_{2} b_{1}\right)}}, \frac{{\left(a_{1} c_{2} - a_{2} c_{1}\right)}}{{\left(a_{1} b_{2} - a_{2} b_{1}\right)}}\right)

a1x+b1y+c1z=d1a_1x + b_1y + c_1z = d_1
a2x+b2y+c2z=d2a_2x + b_2y + c_2z = d_2
a3x+b3y+c3z=d3a_3x + b_3y + c_3z = d_3

var('a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, x, y, z')
\newcommand{\Bold}[1]{\mathbf{#1}}\left(a_{1}, b_{1}, c_{1}, d_{1}, a_{2}, b_{2}, c_{2}, d_{2}, a_{3}, b_{3}, c_{3}, d_{3}, x, y, z\right)

If you want to see Cramer's Rule using specific values, enter those values below and evaluate the cell.

If you want to see the purely symbolic form, skip the following cell and evaluate the next one.

a1, b1, c1, d1 = 2, 1, 1, 3 a2, b2, c2, d2 = 1, -1, -1, 0 a3, b3, c3, d3 = 1, 2, 1, 0
a1*x + b1*y + c1*z == d1; a2*x + b2*y + c2*z == d2; a3*x + b3*y + c3*z == d3
\newcommand{\Bold}[1]{\mathbf{#1}}2 \, x + y + z = 3
\newcommand{\Bold}[1]{\mathbf{#1}}x - y - z = 0
\newcommand{\Bold}[1]{\mathbf{#1}}x + 2 \, y + z = 0
D = matrix([[a1, b1, c1], [a2, b2, c2], [a3, b3, c3]]) D; det(D)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(211111121\begin{array}{rrr} 2 & 1 & 1 \\ 1 & -1 & -1 \\ 1 & 2 & 1 \end{array}\right)
\newcommand{\Bold}[1]{\mathbf{#1}}3
Dx = matrix([[d1, b1, c1], [d2, b2, c2], [d3, b3, c3]]) Dx; det(Dx)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(311011021\begin{array}{rrr} 3 & 1 & 1 \\ 0 & -1 & -1 \\ 0 & 2 & 1 \end{array}\right)
\newcommand{\Bold}[1]{\mathbf{#1}}3
Dy = matrix([[a1, d1, c1], [a2, d2, c2], [a3, d3, c3]]) Dy; det(Dy)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(231101101\begin{array}{rrr} 2 & 3 & 1 \\ 1 & 0 & -1 \\ 1 & 0 & 1 \end{array}\right)
\newcommand{\Bold}[1]{\mathbf{#1}}-6
Dz = matrix([[a1, b1, d1], [a2, b2, d2], [a3, b3, d3]]) Dz; det(Dz)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(213110120\begin{array}{rrr} 2 & 1 & 3 \\ 1 & -1 & 0 \\ 1 & 2 & 0 \end{array}\right)
\newcommand{\Bold}[1]{\mathbf{#1}}9
x, y, z = det(Dx)/det(D), det(Dy)/det(D), det(Dz)/det(D) x, y, z
\newcommand{\Bold}[1]{\mathbf{#1}}\left(1, -2, 3\right)