# Algebraic expressions

An algebraic expression is a formula using **letters**.

$$$ \Tred{x}+3,\quad 2\times \Tred{n},\quad (\Tred{x}+\Tred{y})^2,\quad 3\Tred{x} - 2,\quad \Tred{t}^2.$$$

The letters are called the variables, because they can take several **values** or inputs. The different values that a letter can take is the range.

The value of the expression is called the output.

To **compute the expression**, we substitute the letter with its value and we work out the answer.

The value of the expression $$$\Tred{x}+3$$$ for the input $$\Tred{x}=\Tblue{2}$$ is the number $$\Tblue{2} + 3 = 5$$.

The values of an expression can be represented in **table**.

Table for the expression $$\Tred{x}+3$$.

Input | $$-1$$ | $$0$$ | $$2$$ | $$3$$ | $$5$$ |
---|---|---|---|---|---|

Calculation | $$\Tblue{-1}+3$$ | $$\Tblue{0}+3$$ | $$\Tblue{2}+3$$ | $$\Tblue{3}+3$$ | $$\Tblue{5}+3$$ |

Value | $$2$$ | $$3$$ | $$5$$ | $$6$$ | $$8$$ |

In an algebraic expression, the choice of the letter is not important.

However some letters are used **more frequently** depending on their interpretation in the formula.

Letter | Range | Meaning | Values | Expression |
---|---|---|---|---|

$$x$$, $$y$$, $$z$$ | $$\R$$ | Position, generic variable | $$-3.14$$ | $$\Tred{x}+\Torange{y}-3$$ |

$$t$$, $$s$$ | $$\R$$ | Time | $$1.1$$ | $$\Tred{t}^2$$, $$3\Torange{s}$$ |

$$m$$, $$n$$, $$p$$, $$q$$ | $$\Z^+$$, $$\Z$$ | Index, generic integer | $$12$$ | $$\Tred{n} = \Torange{p}^2 + \Tgreen{q}$$ |

$$\theta$$ | $$\R$$ | Angle | $$45^\circ$$ | $$\cos(\Tred{\theta})$$ |

Sometimes we need to use a **word based problem** to write an **expression**.

If my rectangular garden is twice as long as it is wide, how can I express the area without knowing the side lengths?

We can turn statements like this into algebraic expressions.

Choose $$x$$ to represent the width of the garden. Then the length is $$2x$$. The area of a rectangle is the product of its side lengths, so the area is $$2x \times x = 2x^2$$.

The first thing to do is to represent the most basic quantity in the statement using a **letter**. Then write out any other quantities in terms of this letter. Work through the statement and "build up" the expression, remembering to use brackets if necessary.

I think of a number and add ten. Then I double the result. Give an expression for the new number in terms of the old one.

If we represent the original number using $$n$$, the first thing we do is to add $$10$$ to get to $$n+10$$. Then we multiply the entirety of this by $$2$$, to get $$2(n+10)$$.

Some expressions can be written in different ways. The most common equivalent notations are listed here.

Operation | Expression | Example | Equivalent | Example |
---|---|---|---|---|

Product | $$\Tblue{a}\Tred{b}$$ | $$\Tblue{2}\cdot\Tred{3}$$ | $$\Tblue{a}\times\Tred{b}$$ | $$\Tblue{2}\times\Tred{3}$$ |

Ratio | $$\Tblue{a}/\Tred{b}$$ | $$\Tblue{2}/\Tred{3}$$ | $$\Tblue{a}\div\Tred{b}$$ | $$\Tblue{2}\div\Tred{3}$$ |

Ratio | $$\displaystyle\frac{\Tblue{a}}{\Tred{b}}$$ | $$\displaystyle\frac{\Tblue{2}}{\Tred{3}}$$ | $$\Tblue{a}\div\Tred{b}$$ | $$\Tblue{2}\div\Tred{3}$$ |

Square | $$\Tblue{a}^2$$ | $$\Tblue{2}^2$$ | $$\Tblue{a}\times \Tblue{a}$$ | $$\Tblue{2}\times \Tblue{2}$$ |

For the product $$\Tblue{a}\Tred{b}$$, note the $$\cdot$$ used to distinguish between $$\Tblue{2}\cdot\Tred{3} = 6$$ and the number $$23$$ (twenty-three).

In an algebraic expression, **the choice of letter is not important**.

The following expressions are **identical**, because only the letter changes $$$ \Tred{X} + 2,\quad \Tred{x} + 2,\quad \Tred{n} + 2,\quad \Tred{t} + 2.$$$

Two expressions are identical if their outputs are the same when the inputs are the same. They are different if they differ even for one value of the input.

The following expressions are all different $$$ 2\times \Tred{x} + 3,\quad 2\times(\Tred{x} + 3),\quad 2\times 3 + \Tred{x},\quad 2+ \Tred{x}\times 3.$$$ For instance, when $$\Tred{x} = -1$$, the above expressions take the values $$$ 1,\quad 4,\quad 5, \quad -1 $$$

The expressions below are the same. $$$ 2\times \Tred{x} + 3,\quad (2\times\Tred{t}) + 3,\quad \Tred{z}\times 2 + 3,\quad 3+2\times \Tred{n}.$$$