Mathematics
Binomial square formulas - formula in LaTeX
The square of a sum and of a difference in one line: read the upper signs together and the lower signs together. The plus-minus sign is \pm. If the same formula needs the flipped one, use \mp.
LaTeX code
$$
(a\pm b)^2 = a^2 \pm 2ab + b^2
$$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
- any numbers or expressions
A math formula - one of the most frequently typed in assignments, lecture notes and calculus or algebra homework.
Worked example
The square of a difference lets you work out 99² in your head. The multiplication dot is \cdot; a plain asterisk * stays an asterisk in LaTeX.
Other ways to write it
The square of a sum on its own, when the text needs just one sign.
(a+b)^2 = a^2 + 2ab + b^2Difference of squares, often needed to simplify fractions.
a^2 - b^2 = (a-b)(a+b)Cube of a sum and of a difference in one line.
(a\pm b)^3 = a^3 \pm 3a^2b + 3ab^2 \pm b^3Sum and difference of cubes: this is where \mp is needed, since the sign in the second bracket is flipped.
a^3 \pm b^3 = (a\pm b)(a^2 \mp ab + b^2)
LaTeX commands in this formula
How to use this formula in LaTeX?
- Copy the code with the button above -
$$…$$is centered display math. - Paste it into the CamteX editor, Overleaf or any LaTeX document.
- Inside a sentence, use single
$…$instead of double. - The formula works without extra packages.
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.