# Introduction to Functions

A function is a relationship between two variables where for every independent variable, there is only one dependent variable. This means that for every x value, there is only one y value.

A function is a special type of relation. It is like a machine where for every INPUT there is only one OUTPUT.

Notice below that there is only one ordered pair for each variable.

The ordered pairs are (A, 1), (B, 1), (C, 4), (D, 3) and (E, 2).

The first variable (INPUT) is called the independent variable and the second (OUTPUT) the dependent variable. The process is a rule or pattern.

For example, in $y=x+1$, we can use any number for x (the independent variable), say x = 3.

$x=3 \\ y=3+1 \\ =4$

As this value depends on the number we choose for x,y is called the dependent variable.

Below is an example of a relationship that is NOT a function. Can you see the difference between this example and the previous one?

In this example the ordered pairs are (A, 1), (A, 2), (B, 1), (C, 4), (D, 3) and (E, 2).

Notice that A has two dependent variables, 1 and 2. This means that it is NOT a function. Instead, a relation is a set of ordered points (xy) where the variables x and y are related according to some rule.

## Function Notation

If y depends on what value we give x in a function, then we can say that y is a function of x. We can write this as y = f(x).

For example, if f(x) = x + 1, evaluate f(3). This is the same as evaluating the function when x = 3.

f(x) = x + 1

f(3) = 3 + 1

f(3) = 4

If y = f(x) then f(a) is the value of y at the point on the function where x = a.

### Examples:

1. If $f\left( x \right) ={ x }^{ 3 }-{ x }^{ 2 }$, find the value of $f\left( 1 \right)$.

$f\left( x \right) ={ x }^{ 3 }-{ x }^{ 2 }\\ f\left( -1 \right) ={ (-1) }^{ 3 }-{ (-1) }^{ 2 }\\ f\left( -1 \right) =-1-1\\ f\left( -1 \right) =-2$

2. Find the values of x for which $f\left( x \right) =0$, given that $f\left( x \right) ={ x }^{ 2 }+3x-10$.

$f\left( x \right) =0\\ i.e.\quad f\left( x \right) ={ x }^{ 2 }+3x-10\\ (x+5)(x-2)=0\\ x+5=0\qquad or\qquad x-2=0\\ x=-5\qquad or\qquad x=2$

3. Find  the value of $g\left( 1 \right) +g\left( -2 \right) -g\left( 3 \right)$ if:

$g\left( x \right) \begin{cases} { x }^{ 2 }\qquad \qquad \quad when\quad x>2 \\ 2x-1\quad \qquad when\quad -1\le x\le 2 \\ 5\qquad \qquad \quad when\quad x<-1 \end{cases}$

$g(1)=2(1)-1=1\qquad \qquad since\quad -1\le 1\le 2\\ g(-2)=5\qquad \qquad \qquad \quad \quad since\quad -1<-1\\ g(3)={ 3 }^{ 2 }=9\quad \qquad \qquad \quad since\quad 3>2\\ \\ \therefore \quad g(1)+g(-2)-g(3)\\ \qquad =1+5-9\\ \qquad =-3$

## Intercepts

One of the most useful techniques is to find the x- and y-intercepts.

For x-intercept, y=0.

For y-intercept, x=0.

### Example:

Find the x- and y-intercepts of the function: $f\left( x \right) ={ x }^{ 2 }+7x-8$.

For $y=0$

${ x }^{ 2 }+7x-8=0\\ (x+8)(x-1)=0\\ x+8=0\qquad or\qquad x-1=0\\ x=-8\qquad \quad or\qquad x=1$

For $x=0$

$y={ (0) }^{ 2 }+7(0)-8\\ y=8$

## Domain and Range

You have already seen that the x-coordinate is called the independent variable and the y-coordinate is the dependent variable.

The set of all real numbers x for which a function is define is called the domain.

The set of real values for y or f(x) as x varies is called the range (or image) of f.

For example, we can see the the domain and range of $f\left( x \right)={ x }^{ 2 }$from the graph, which is the parabola $y={ x }^{ 2 }$.

Notice that the parabola curves outwards gradually, and will take on any real value for x. However, it is always on or above the x-axis.

Domain: {all real x}

Range: {y:y$\ge$0}

We can also find the domain and range from the equation $y={ x }^{ 2 }$. Notice that we can substitute any value for x and you will find a value of y. However, all the y-values are positive or zero since squaring any number will give a positive answer (except zero).

## Odd and Even Functions

### Examples:

1. Show that $f(x)={ x }^{ 2 }+3$ is an even function.

$f(-x)={ (-x) }^{ 2 }+3\\ \qquad \quad ={ x }^{ 2 }+3\\ \qquad \quad =f(x)\\ \therefore \quad f(x)={ x }^{ 2 }+3$ is an even function

2. Show that $f(x)={ x }^{ 3 }-x$ is an odd function.

$f\left( -x \right) ={ (-x) }^{ 3 }-(-x)\\ \qquad \quad ={ -x }^{ 3 }+x\\ \qquad \quad =-({ x }^{ 3 }-x)\\ \qquad \quad =-f\left( x \right) \\ \therefore \quad f\left( x \right) ={ x }^{ 3 }-x$ is an odd function

### Examples:

1. For the quadratic function $f\left( x \right) ={ x }^{ 2 }+x-6$

a) Find the x- and y-intercepts

b) Find the minimum value of the function

c) State the domain and range

d) For what values of x is the curve decreasing?

2. (a) Find the x- and y- intercepts and the maximum value of the quadratic function $f\left( x \right) =-{ x }^{ 2 }+4x+5$.

(b) Sketch the function and state the domain and range.

(c) For what values of x is the curve decreasing?