All formulas

Mathematics

2×2 matrix - formula in LaTeX

A matrix in round brackets. Columns are separated with &, rows with a double backslash. The bmatrix environment gives square brackets and vmatrix the bars of a determinant. All three need the amsmath package.

(abcd)\begin{pmatrix} a & b \\ c & d \end{pmatrix}

LaTeX code

$$
\begin{pmatrix} a & b \\ c & d \end{pmatrix}
$$

Got this formula in your notes or on a whiteboard? Snap a photo and CamteX turns it into LaTeX. Try it free

What the symbols mean

a,ba, b
entries of the first row
c,dc, d
entries of the second row

A math formula - one of the most frequently typed in assignments, lecture notes and calculus or algebra homework.

Worked example

The determinant of a 2×2 matrix is the product of the main diagonal minus the product of the other one. \det sets the abbreviation upright, like \sin or \log.

det⁡A=∣3124∣=3⋅4−1⋅2=10\det A = \begin{vmatrix} 3 & 1 \\ 2 & 4 \end{vmatrix} = 3\cdot 4 - 1\cdot 2 = 10

Other ways to write it

LaTeX commands in this formula

\begin{pmatrix}
matrix in ( )

How to use this formula in LaTeX?

  1. Copy the code with the button above - $$…$$ is centered display math.
  2. Paste it into the CamteX editor, Overleaf or any LaTeX document.
  3. Inside a sentence, use single $…$ instead of double.
  4. The formula needs the amsmath package - CamteX templates include it in the preamble.

Related formulas - Mathematics

Drawing formulas is faster than typing them.

Draw a formula, table or chart - CamteX AI turns it into ready LaTeX and inserts it into your document.

Try it free