There are some algebraic expressions that because of their importance and use in mathematics, it is worth memorizing. These are called notable products.
Square of the sum
If $$a$$ and $$b$$ are real numbers (they can be unknowns!), it is satisfied that:
$$$(a+b)^2=a^2+2ab+b^2$$$
$$(x+3)^2=x^2+2\cdot3\cdot x+3^2=x^2+6x+9$$
$$(2x+1)^2=(2x)^2+2\cdot(2x)\cdot1+1^2=4x^2+4x+1$$
$$\Big(x+\dfrac{1}{2}\Big)^2=x^2+2\cdot\dfrac{1}{2}\cdot x+\Big(\dfrac{1}{2}\Big)^2=x^2+x+\dfrac{1}{4}$$
Square of the subtraction
$$$(a-b)^2=a^2-2ab+b^2$$$
$$(x-3)^2=x^2-2\cdot3\cdot x+3^2=x^2-6x+9$$
$$(2x-1)^2=(2x)^2-2\cdot(2x)\cdot1+1^2=4x^2-4x+1$$
$$\Big(x-\dfrac{1}{2}\Big)^2=x^2-2\cdot\dfrac{1}{2}\cdot x+\Big(\dfrac{1}{2}\Big)^2=x^2-x+\dfrac{1}{4}$$
Cube of the sum
In the same way as the square, the cube of the sum is also important: $$$(a+b)^3=a^3+3a^2b+3ab^2+b^3$$$
$$(x+3)^3=x^3+3\cdot x^2\cdot3+3\cdot x\cdot3^2+3^3=$$
$$=x^3+9x^2+27x+27$$
$$(2x+1)^3=(2x)^3+3\cdot(2x)^2\cdot1+3\cdot (2x)\cdot1^2+1^3=$$
$$=8x^3+12x^2+3x+1$$
$$\Big(x+\dfrac{1}{2}\Big)^3=x^3+3\cdot\dfrac{1}{2}\cdot x^2+3\Big(\dfrac{1}{2}\Big)^2\cdot x+\Big(\dfrac{1}{2}\Big)^3 =$$
$$=x^3+\dfrac{3}{2}x^2+\dfrac{3}{4}x+\dfrac{1}{8}$$
Cube of the subtraction
$$$(a-b)^3=a^3-3a^2b+3ab^2-b^3$$$
$$(x-3)^3=x^3-3\cdot x^2\cdot3+3\cdot x\cdot3^2-3^3=$$
$$=x^3-9x^2+27x-27$$
$$(2x-1)^3=(2x)^3-3\cdot(2x)^2\cdot1+3\cdot (2x)\cdot1^2-1^3=$$
$$=8x^3-12x^2+3x-1$$
$$\Big(x-\dfrac{1}{2}\Big)^3=x^3-3\cdot\dfrac{1}{2}\cdot x^2+3\Big(\dfrac{1}{2}\Big)^2\cdot x-\Big(\dfrac{1}{2}\Big)^3 =$$
$$=x^3-\dfrac{3}{2}x^2+\dfrac{3}{4}x-\dfrac{1}{8}$$
Difference of two squares
When we subtract two squares, the result is the product of the sum by the difference: $$$a^2-b^2=(a+b)\cdot(a-b)$$$
$$x^2-9=x^2-3^2=(x-3)\cdot(x+3)$$
$$4x^2-1=2^2x^2-1^2=(2x)^2-1^2=(2x+1)\cdot(2x-1)$$
$$x^2-\dfrac{1}{4}=x^2-\dfrac{1}{2^2}=\Big(x-\dfrac{1}{2}\Big)\cdot \Big(x+\dfrac{1}{2}\Big)$$
Difference of two cubes
In a similar way, there is a formula for the difference of the cubes: $$$a^3-b^3=(a-b)\cdot(a^2+ab+b^2)$$$
$$x^3-27=x^3-3^3=(x-3)\cdot(x^2+3x+9)$$
$$8x^3-1=2^3x^3-1^3=(2x)^3-1^3=(2x-1)\cdot(4x^2+2x+1)$$
$$x^3-\dfrac{1}{8}=x^3-\dfrac{1}{2^3}=\Big(x-\dfrac{1}{2}\Big)\cdot \Big(x^2+\dfrac{x}{2}+\dfrac{1}{4}\Big)$$