Matrix operations

Calculate matrix operations step by step

Choose an operation, set the matrix size, and enter integers, decimals, or fractions in the grid. The result keeps exact values and explains the rule used.

Choose a matrix operation

Matrix A

2 × 2

Matrix B

2 × 2

A and B both have dimensions 2 × 2, so corresponding-entry operations are defined.

Add corresponding entries

[681012]\begin{bmatrix}6 & 8 \\ 10 & 12\end{bmatrix}
Conditions
  • Matrix A and matrix B both have dimensions 2 by 2.
  • Each result entry is the sum of entries in the same row and column.

Steps

  1. Check the dimensions Both matrices are 2 by 2, so every entry has a matching position.A,BR2×2A,B\in\mathbb{R}^{2\times2}
  2. Add corresponding entries Add row 1 to row 1 and row 2 to row 2 without changing positions.A+B=[1+52+63+74+8]A+B=\begin{bmatrix}1+5 & 2+6 \\ 3+7 & 4+8\end{bmatrix}
  3. Simplify the entries Evaluate each sum to form the result matrix.A+B=[681012]A+B=\begin{bmatrix}6 & 8 \\ 10 & 12\end{bmatrix}
Independent check

Subtracting B from the result recovers A entry by entry, which independently checks the sum.

What this matrix operation covers

This matrix calculator handles addition, subtraction, scalar multiplication, transpose, and determinants up to 4 by 4. Addition and subtraction require equal dimensions, while a determinant requires a square matrix.

Add or subtract equal-size matrices

Combine corresponding entries only when the row and column counts match exactly.

Examples: 2 by 2 plus 2 by 2, 2 by 3 minus 2 by 3

Multiply every entry by one scalar

Apply an integer, decimal, or fraction to every position without changing the matrix dimensions.

Examples: -2A, (1/3)A

Transpose a rectangular matrix

Turn rows into columns, so an m by n matrix becomes an n by m matrix.

Examples: 2 by 3 becomes 3 by 2

Find a square-matrix determinant

Calculate an exact determinant for a 1 by 1 through 4 by 4 square matrix.

Examples: 2 by 2 determinant, 3 by 3 cofactor expansion

Enter enough information for one clear task

  1. 1
    Choose the operation first

    The form shows only the inputs that operation needs. Addition and subtraction use A and B; scalar multiplication adds a scalar; transpose and determinant use A alone.

  2. 2
    Set the dimensions

    Choose one to four rows and columns. For addition and subtraction, both matrices use the same dimensions. A determinant must be square.

  3. 3
    Enter one value per cell

    Use signed integers, finite decimals, or fractions such as -3/4. Keep the row and column position of each entry unchanged.

  4. 4
    Read the rule before the result

    Confirm the dimensions, inspect the entry-level calculation, and use the independent check to catch an input or arithmetic mistake.

Examples to try

Use these examples to recognize the method, compare equivalent forms, and check your own work.

Add two 2 by 2 matrices

Add entries that occupy the same row and column.

[1234]+[5678]\begin{bmatrix}1&2\\3&4\end{bmatrix}+\begin{bmatrix}5&6\\7&8\end{bmatrix}

Expected result

[681012]\begin{bmatrix}6&8\\10&12\end{bmatrix}

Subtract with negative entries

Subtract each entry of B from the corresponding entry of A.

[4125][1324]\begin{bmatrix}4&-1\\2&5\end{bmatrix}-\begin{bmatrix}1&3\\-2&4\end{bmatrix}

Expected result

[3441]\begin{bmatrix}3&-4\\4&1\end{bmatrix}

Multiply by a negative scalar

Multiply every entry by negative 2.

2[1320]-2\begin{bmatrix}1&-3\\2&0\end{bmatrix}

Expected result

[2640]\begin{bmatrix}-2&6\\-4&0\end{bmatrix}

Transpose a rectangular matrix

Turn each row of A into the matching column of the transpose.

[123104]T\begin{bmatrix}1&2&3\\-1&0&4\end{bmatrix}^{T}

Expected result

[112034]\begin{bmatrix}1&-1\\2&0\\3&4\end{bmatrix}

Find a 2 by 2 determinant

Use ad minus bc.

det[4726]\det\begin{bmatrix}4&7\\2&6\end{bmatrix}

Expected result

4(6)7(2)=104(6)-7(2)=10

Find a 3 by 3 determinant

Expand along the first row, whose zero removes one cofactor.

det[210132401]\det\begin{bmatrix}2&1&0\\-1&3&2\\4&0&1\end{bmatrix}

Expected result

1515

Add exact fractions

Add corresponding fractions before simplifying.

[121321]+[122311]\begin{bmatrix}\frac12&\frac13\\2&-1\end{bmatrix}+\begin{bmatrix}\frac12&\frac23\\-1&1\end{bmatrix}

Expected result

[1110]\begin{bmatrix}1&1\\1&0\end{bmatrix}

Find a 3 by 3 determinant without unnecessary work

The first row contains a zero, so expanding across that row leaves only two nonzero cofactors.

A=[210132401]A=\begin{bmatrix}2&1&0\\-1&3&2\\4&0&1\end{bmatrix}
  1. 1
    Write the first-row expansion

    The signs across the first row are positive, negative, positive.

    det(A)=2320111241+01340\det(A)=2\begin{vmatrix}3&2\\0&1\end{vmatrix}-1\begin{vmatrix}-1&2\\4&1\end{vmatrix}+0\begin{vmatrix}-1&3\\4&0\end{vmatrix}
  2. 2
    Evaluate the 2 by 2 determinants

    Apply ad minus bc inside each remaining minor.

    det(A)=2(3120)((1)124)\det(A)=2(3\cdot1-2\cdot0)-((-1)\cdot1-2\cdot4)
  3. 3
    Combine the signed terms

    The second minor is negative 9, and its cofactor sign is negative.

    det(A)=6(9)=15\det(A)=6-(-9)=15
det(A)=15\det(A)=15

Verification: A separate elimination-based determinant calculation also gives 15, so the cofactor signs and arithmetic agree.

Common mistakes and how to fix them

Adding matrices with different dimensions

Problem: Pair entries until the smaller matrix runs out.

Why it matters: An unpaired entry has no corresponding position, so the sum or difference is undefined.

Better approach: Confirm that both row counts and both column counts match before adding or subtracting.

Moving an entry to a new position

Problem: Reorder entries before adding because the same numbers appear in both matrices.

Why it matters: Matrix position carries meaning. Entry a23 can combine only with b23.

Better approach: Work one fixed row and column position at a time.

Treating scalar multiplication as matrix multiplication

Problem: Use row-by-column products when multiplying A by the number 3.

Why it matters: A scalar is one number, so it multiplies every entry independently.

Better approach: Keep the same dimensions and multiply each aij by the scalar.

Taking a determinant of a rectangular matrix

Problem: Apply the 2 by 2 determinant rule to the first four entries of a 2 by 3 matrix.

Why it matters: A determinant is defined only for a square matrix.

Better approach: Use equal row and column counts before selecting Determinant.

Checks, assumptions, and limits

How results are checked

  • Exact entry arithmetic is handled by the site's Nerdamer mathematics library.
  • Addition and subtraction are reversed to recover matrix A.
  • A transpose is checked by transposing the result a second time.
  • A determinant is compared with a separate elimination-based numerical pass.

When to stop and revise the input

  • This release accepts finite real integers, decimals, and simple fractions, not variables or complex entries.
  • Inputs are limited to 4 by 4 so the steps stay readable and calculations remain responsive.
  • Matrix-matrix multiplication belongs in the dedicated multiplication calculator.
  • Inverse matrices, eigenvalues, and row reduction are outside this calculator's current scope.

Calculate matrix operations step by step FAQ

When can two matrices be added or subtracted?

They must have exactly the same number of rows and columns. The result has those same dimensions because each output entry combines one matching position from A and B.

Can I enter fractions in the matrix grid?

Yes. Enter a simple fraction such as 3/4 or -2/5. The calculator keeps exact fractional values instead of replacing them with an early decimal approximation.

What happens to dimensions after a transpose?

The row and column counts switch. If A is m by n, then its transpose is n by m because row i becomes column i.

Why is the determinant available only for square matrices?

The determinant is a scalar associated with a square linear transformation. A rectangular matrix has different input and output dimensions, so the square-matrix determinant is not defined.

Where can I multiply two matrices?

Use the matrix multiplication calculator. It gives A and B independent dimensions, checks the inner-dimension rule, and shows every row-by-column dot product.

Sources and curriculum alignment

This page follows standard introductory mathematics notation and learning sequences. Use these references to continue with a complete course treatment.

Choose the resource that matches what you need to do next.

Created by Mathos AI. Methods, conditions, and checks are shown so you can review the mathematical reasoning.