# Computation of images and inverse images

Let's consider the function $f(x)=x^2+1$.

From its analytical expression we can compute the image of any element $x$ in the domain. To do so, it is enough to replace the value of $x$ in the expression of the function.

For $x = 2$: $$f(2)=2^2+1=4+1=5$$

Therefore, $5$ is the image of $2$ in $f$.

We will write $f (2) = 5$.

We can calculate also the inverse image or the images of any element $y$ of the codomain. To do so, it is enough to replace the value of $y = f (x)$ in the expression of the function and to solve $x$.

For example, the inverse image of $y = 10$ is: $$\begin{array}{rcl}10&=&x^2+1 \\ x^2&=&9 \\ x&=& \pm 3\end{array}$$

Therefore, $3$ and $-3$ are inverse images of $10$ for the function $f$. We will write: $$f^{-1}(10)=\{-3, 3\}$$

Compute the image of $2$ and the inverse image of $11$ for the function from the previous example $f(x)=3x^2-1$.

$f^{-1}(11)$: $$\begin{array}{rcl}11 &=& 3x^2-1 \\ 12 &=& 3x^2 \\ x^2&=& 4\\x&=& \pm2=\{-2,2\}\end{array} \Longrightarrow f^{-1}(11)=\{-2,2\}$$