# A-level Mathematics/CIE/Pure Mathematics 1/Functions
## Notation & Terms
### Function Notation

There are two main ways of describing a function: with parenthesis notaton, e.g. $f(x)=x^{2}-1$, or with mapping notation, e.g. $f:x\mapsto x^{2}-1$. These both describe what the function does.

### Definitions
#### Function

    A function is a mapping from an input set to an output set. For example, the function $f(x)=3x$ maps the input $x$ to the output $3x$ by multiplying it by 3

#### Domain

    The domain is the set of all valid inputs. e.g., the function $f(x)={\frac {1}{x}}$ has the domain $x\in \mathbb {R} ,x\neq 0$.

#### Range

    The range is the set of all possible outputs. e.g., the function $f(x)=x^{2}$ has the range $x\geq 0$

#### One-to-one function

    A one-to-one function is a function which maps each input to exactly one output, and each output corresponds to exactly one input. For instance, $f(x)=x^{2},x\in \mathbb {R}$ is not a one-to-one function, but $f(x)=x^{2},x\geq 0$ is a one-to-one function.

#### Inverse function

    An inverse function is a function that does the opposite of another function. For example, the function $f(x)=x+5$ has an inverse function $f^{-1}(x)=x-5$.

#### Composition of functions

    Composition of functions is where the output of one function is input into another function. For example: if $f(x)=x^{2}$ and $g(x)=3x+5$, the composed function $fg(x)=(3x+5)^{2}$ and the composed function $gf(x)=3x^{2}+5$. Note that for two arbitrary functions $f(x)$ and $g(x)$, the composed functions $fg(x)$ and $gf(x)$ are not equal except for some special cases.

## Finding the Range

To find the range of a function, we need to find the highest and lowest values that the function can take.

### Example 1

Find the range of $f(x)={\frac {1}{x}},x\geq 1$
The lowest value that $x$ can take is 1, so one bound of the range is $f(x)={\frac {1}{1}}=1$.
The highest value that $x$ can take is infinite, so the other bound of the range is the value that $f(x)$ approaches as $x$ goes to infinity, which is 0.
So the range of the function $f(x)$ is $0<f(x)\leq 1$. This range can also be expressed in interval notation as $f(x)\in (0,1]$

### Example 2

Find the range of $g(x)=x^{2}-x-2,x\in \mathbb {R}$
A quadratic function always has a turning point, known as its vertex. This determines its range. The vertex can be found by completing the square.
${\begin{aligned}g(x)&=\ x^{2}-x-2\\&=\ (x-{\frac {1}{2}})^{2}-{\frac {1}{4}}-2\\&=\ (x-{\frac {1}{2}})^{2}-{\frac {9}{4}}\end{aligned}}$
Completing the square provides the coordinates of the vertex, $({\frac {1}{2}},-{\frac {9}{4}})$.
Since the vertex is the lowest point of this function, we can express the range as $g(x)\geq -{\frac {9}{4}}$, which can be expressed as $g(x)\in [-{\frac {9}{4}},\infty )$

## Composing Functions

A composite function is a function which is created by taking the output of one function as the input of another function.
e.g. Find the composite function $gf(x)$ when $f(x)=3x+5$ and $g(x)=2x^{2}$.
${\begin{aligned}gf(x)&=g(f(x))=g(3x+5)\\&=2(3x+5)^{2}=2(9x^{2}+30x+25)\\&=18x^{2}+60x+50\end{aligned}}$
It is important to note that a composite function can only be created if the range of the inner function is within the domain of the outer function.

## Inverse Functions

An inverse function is the reverse of a given function, such as how $f(x)=x+5$ has the inverse $f^{-1}(x)=x-5$.
However, not all functions have an inverse. Only one-to-one functions have an inverse.

### Determining whether a function is one-to-one

The formal way of determining whether a function is one-to-one is to prove that $f(x)=f(y)\implies x=y$
e.g. Prove that $f(x)=x^{3}$ is one-to-one.
${\begin{aligned}f(x)&=f(y)\\x^{3}&=y^{3}\\{\sqrt[{3}]{x^{3}}}&={\sqrt[{3}]{y^{3}}}\\x&=y\\\therefore f(x){\text{ is one-to-one}}\end{aligned}}$

### Finding the inverse

To find the inverse of a function, substitute $x$ for $f^{-1}(x)$ in the function definition then rearrange the variables to make $f^{-1}(x)$ the subject of the formula.
e.g. Find the inverse of $f(x)=(2x+3)^{2}-4$
${\begin{aligned}f(f^{-1}(x))=(2f^{-1}(x)+3)^{2}-4\\x=(2f^{-1}(x)+3)^{2}-4\\(2f^{-1}(x)+3)^{2}=x-4\\2f^{-1}(x)+3={\sqrt {x-4}}\\2f^{-1}(x)={\sqrt {x-4}}-3\\f^{-1}(x)={\frac {{\sqrt {x-4}}-3}{2}}\end{aligned}}$

## Graphing Inverse Functions

If you plot a function and its inverse on the same graph, it is apparent that the graph of the inverse is the same as the graph of the function reflected across the line $y=x$.
The reason for this is that the graph $y=f^{-1}(x)$ is equivalent to $x=f(y)$

## Transforming Functions

A transformation of a function changes the position, size, or shape of the function's graph.

### Translation

    Translation changes the position of the function's graph. $y=f(x)+a$ can move the function vertically and $y=f(x+a)$ can move the function horizontally.

### Scaling

    Scaling is where the function changes in size. $y=af(x)$ changes the size vertically and $y=f(ax)$ changes the size horizontally. If $a$ is negative, the function will also be reflected.

### Reflection

    Reflection is where the function is mirrored across a given line. This can be achieved with $y=a-f(x)$ for vertical reflection and $y=f(a-x)$ for horizontal reflection.
← Quadratics · Coordinate Geometry →