# Algebra

A quadratic expression is one which contains terms involving $x^2$ such as $3x^2-5x^2$ or just $x^2$ on it's own. It may also contain terms involving $x$ such as $5x$, $-7x$ or $0.5x$, and constant terms such as $6$, $-7$ or $\frac12$.

A quadratic expression cannot have terms involving higher powers of $x$ such as $x^3$, nor can it have terms like $\frac1x$.

The general form of a quadratic equation is $${\color{red}{a}}x^2+{\color{blue}{b}}x+{\color{#cc0099}{c}}=0$$

where $a$ can be any number excluding $0$, and $b$ and $c$ can be any numbers including $0$. If $b$ or $c$ is $0$ then these terms will not appear.

Quadratic equations can be solved by factorisation, completing the square, use of graphs or by the quadratic formula. The use of the formula is particularly important. The formula for the solution of a quadratic equation is

$$x=\frac{-{\color{blue}{b}}\pm\sqrt{{\color{blue}{b}}^2-4{\color{red}{a}}{\color{#cc0099}{c}}}}{2{\color{red}{a}}}$$

where $b^2\ge 4ac$ for real roots.

###### Example

In the equation $x^2-3x-2=0$, ${\color{red}{a=1}}$, ${\color{blue}{b=-3}}$ and ${\color{#cc0099}{c=-2}}$. Substituting the values into the formula gives \begin{align*} x&=\frac{-({\color{blue}{-3}})\pm\sqrt{({\color{blue}{-3}})^2-4\times {\color{red}{1}}\times ({\color{#cc0099}{-2}})}}{2\times {\color{red}{1}}}\\ &=\frac{3\pm\sqrt{9+8}}{2}\\ &=\frac{3\pm\sqrt{17}}{2} \end{align*}

#### Logarithms

A logarithm is simply an exponent that is written in a special way.

for example, we know the following equation is true:

$${\color{blue}2}^{\color{red}3}={\color{#cc0099}8}$$

In this case the base being used is ${\color{blue}2}$, and the exponent is ${\color{red}3}$. We can write this equation in logarithmic form (with identical meaning) as:

$$\log_{\color{blue}2} {\color{#cc0099}8}={\color{red}3}.$$ Here the logarithm of $8$ to the base $2$ is $3$. What we have effectively done is to move the exponent down on to the main line of the equation.

In the general case we can say that if

$$b^x=y,\text{ then equivalently } \log_b y =x$$.

##### Standard Bases

There are two commonly used bases:

base $10$ and base $e$

Logarithms to base $10$, $\log_{10}$ are often simply written as $\log$ without explicitly writing a base down. The second common base is $e$. The number $e$ is called the exponential base and has a value approximately $2.718282$. Logarithms to base $e$, $\log_e$ are often written as $\ln$. If you see an expression like $\ln x$ you can assume that the base is $e$. Such logarithms are know as natural logarithms.

\begin{align*}\text{If }e^x&=y,\\ x&=\log_e y\\ &=\ln y \end{align*}

##### Laws of Logarithms

The following laws of logarithms follow from the index laws and are true for logarithms to any base.

1. The logarithm of the product of two numbers is the sum of the logarithms of the two numbers.
$$\log (xy)=\log x + \log y$$
2. The logarithm of a power of a number is the same as the logarithm of the number multiplied by the power.
$$\log x^n =n\log x$$
3. The logarithm of the quotient of two numbers is the difference of the logarithms of the two numbers.
$$\log\left(\frac{x}{y}\right) = \log x - \log y$$
4. The logarithm of $1$ is always $0$. This is because for any non-zero number $x$, $x^0=1$.
$$\log 1 = 0$$