ALGEBRALinear AlgebraMathematics Calculator
±

Matrix Addition & Subtraction

Add or subtract element-wise: (A±B)[i,j] = A[i,j] ± B[i,j]. Matrices must have the same dimensions. Addition is commutative; subtraction is not.

Concept Fundamentals
(A±B)[i,j]=aᵢⱼ±bᵢⱼ
Rule
must match
Dimensions
A+B=B+A
Commutative
(A+B)+C=A+(B+C)
Associative

Did our AI summary help? Let us know.

A + (−A) = 0 (zero matrix). k(A+B) = kA + kB (scalar distributes). A + B = B + A (commutative).

Key quantities
(A±B)[i,j]=aᵢⱼ±bᵢⱼ
Rule
Key relation
must match
Dimensions
Key relation
A+B=B+A
Commutative
Key relation
(A+B)+C=A+(B+C)
Associative
Key relation

Ready to run the numbers?

Why: Matrix addition models superposition (physics), combining data, and linear combinations. Foundation for vector spaces.

How: For each (i,j), compute A[i,j] + B[i,j] or A[i,j] − B[i,j]. Dimensions must be identical.

A + (−A) = 0 (zero matrix).k(A+B) = kA + kB (scalar distributes).

Run the calculator when you are ready.

Add or Subtract MatricesElement-wise; same dimensions required

Quick Examples - Click to Load

Matrix A(2x2)

Matrix B (2x2)

matrix_add_sub.sh
CALCULATED
$ matrix_op --dims="2x2" --op="+"
Result Dimensions
2x2
Operation
A + B
Result Matrix
00
00
Share:
Matrix Addition
A + B = 2x2
[0, 0] | [0, 0]
numbervibe.com/calculators/mathematics/linear-algebra/matrix-addition-subtraction-calculator

Element Distribution (Bar)

Sign Distribution (Doughnut)

Calculation Steps

SETUP
Matrix A[0, 0] [0, 0]
SETUP
Matrix B[0, 0] [0, 0]
SETUP
OperationA + B
RESULT
Result[0, 0] [0, 0]

For educational and informational purposes only. Verify with a qualified professional.

🧮 Fascinating Math Facts

±

A − B = A + (−B)

📐

0 + A = A (identity)

Key Takeaways

  • Matrix addition and subtraction require same dimensions (m x n for both).
  • Operations are element-wise: (A +/- B)[i,j] = A[i,j] +/- B[i,j].
  • Addition is commutative: A + B = B + A.
  • Subtraction is not commutative: A - B != B - A in general.
  • The zero matrix O satisfies A + O = A and A - A = O.

Did You Know?

Matrix addition is one of the fastest operations in linear algebra—O(mn) for m x n matrices.Source: Complexity
🧠Neural networks add bias vectors to layer outputs: y = Wx + b.Source: Deep Learning
📊Image blending uses matrix addition: composite = alpha * image1 + (1-alpha) * image2.Source: Computer Vision
🎮Game physics combines forces via vector/matrix addition.Source: Game Dev
⏱️A - B = A + (-B), so subtraction is just adding the negative.Source: Algebra
⚛️Quantum states combine via superposition—analogous to matrix addition.Source: Quantum

How It Works

Add or subtract corresponding elements: (A +/- B)[i,j] = A[i,j] +/- B[i,j].

Addition: (A + B)_ij = A_ij + B_ij

Subtraction: (A - B)_ij = A_ij - B_ij

Expert Tips

Check Dimensions First

Both matrices must be m x n. No exceptions.

Order for Subtraction

A - B subtracts B from A. B - A gives the opposite.

Zero Matrix

A + O = A. Use O to reset or test.

Negative Matrix

-A negates every element. A - B = A + (-B).

Comparison Table

FeatureThis CalculatorMATLABManual
Step-by-step⚠️
Dimension validation⚠️
Bar & Doughnut charts
8 preset examples

FAQ

Can you add matrices of different dimensions?

No. Both must have the same number of rows and columns.

Is A + B = B + A?

Yes. Matrix addition is commutative.

Is A - B = B - A?

No. Subtraction is not commutative.

What is the zero matrix?

A matrix with all zeros. It is the additive identity: A + O = A.

What is -A?

The matrix with each element negated. A - B = A + (-B).

Can I add a 2x3 and 3x2 matrix?

No. They have different dimensions. Both must be m x n.

How does this relate to vectors?

Vectors are 1 x n or n x 1 matrices. Vector addition is the same operation.

What about scalar multiplication?

c(A + B) = cA + cB. Scalars distribute over addition.

Stats

m x n
Dimensions
O(mn)
Complexity
A+B=B+A
Commutative
Element-wise
Operation

Sources

  • Gilbert Strang, Linear Algebra and Its Applications
  • • Khan Academy — Matrix Operations: khanacademy.org
  • MIT 18.06: ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/
  • Wolfram MathWorld: mathworld.wolfram.com/MatrixAddition.html
  • 3Blue1Brown - Essence of Linear Algebra: 3blue1brown.com/topics/linear-algebra
  • Numerical Recipes in C - Matrix Operations

Disclaimer: For educational purposes. Uses JavaScript floating-point. Verify critical calculations independently.

👈 START HERE
⬅️Jump in and explore the concept!
AI

Related Calculators