### Functions

In this tutorial, you will learn the following in detail:

- Functions
- Composite Functions
- Inverse Functions

#### Functions

**y = x**^{2} + 3x -2 is said to be a function of x - an expression of x. This can also be written, in a bit more advanced way as **f(x) = x**^{2} + 3x -2 -
it is read as you write, function of x, *f(x)*

So, f(x) = x^{2} + 3x -2

Now whatever you put in as 'x' on the left, substitutes 'x' on the right.

**E.g.**
- f(2) = 2
^{2} + 3x2 -2 = 4 + 6 - 2 = 8
- f(-2) = (-2)
^{2} + 3x(-2) -2 = 4 - 6 - 2 = -4
- f(0) = 0
^{2} + 3x0 -2 = 0 + 0 - 2 = -2
- f(x+1) = (x+1)
^{2} + 3(x+1) -2 = x^{2} + 2x + 1 + 3x + 3 -2 = x^{2} + 5x + 2
- f(x-1) = (x-1)
^{2} + 3(x-1) -2 = x^{2} - 2x + 1 + 3x - 3 -2 = x^{2} + x - 5
- f(2x) = (2x)
^{2} + 3(2x) -2 = (2x)^{2} + 6x -2 = 4x^{2} + 6x - 2
- f(x/2) = (x/2)
^{2} + 3(x/2) -2 = x^{2}/4 + 3x/2 -2 = x^{2}/4 + 3x/2 - 2
- f(x²) = (x²)² + 3(x²) - 2 = x
^{4} + 3x² -2

#### Composite Functions

A function of a function is called a composite function.

**E.g.1**

f(x) = 2x-1 | g(x) = x²

fg(x) = 2(x²) -1

gf(x) = (2x-1)²

f²(x) = ff(x) = 2(2x-1) - 1 = 4x - 2 - 1 = 4x - 3

g²(x) = gg(x) = (x²)² = x^{4}

**E.g.2**

f(x) = 3x-2 | g(x) = x² | h(x) = (x + 3)/2

Find fgh(x)

gh(x) = [(x+3)/2]² = (x+3)²/4

fgh(x) = ff(x) = 3(x+3)²/4 - 2

**E.g.3**

f(x) = 3x | g(x) = x² | h(x) = x-1

Find gfh(x)

fh(x) = 3(x-1) = 3x - 3

gfh(x) = (3x - 1)²

**E.g.4**

f(x) = 3x-1 | g(x) = x² - 2x

Find gf(1)

f(1) = 2

gf(1) = 1² -2(1) = -1

**E.g.5**

f(x) = 3x-2 | g(x) = 2x + 7

If gf(b) = 21, find b.

gf(x) = 2(3x - 2) + 7 = 6x - 4 + 7 = 6x + 3

gf(b) = 6b + 3

6b + 3 = 21

6b = 18

b = 3

#### Inverse Functions - f^{-1}(x)

If two functions exist in such a way that the input of one of them is the output of the other or vice versa, they are a function and its own inverse.

**E.g.** g(x) = 2x- 3; -2 ≤ x ≤ 3

x |
g(x) |

-2 |
-7 |

-1 |
-5 |

0 |
-3 |

1 |
-1 |

2 |
1 |

3 |
3 |

**E.g.** h(x) = (x + 3)/2; -7 ≤ x ≤ 3

x |
h(x) |

-7 |
-2 |

-5 |
-1 |

-3 |
0 |

-1 |
1 |

1 |
2 |

3 |
3 |

Since the above two functions swap around their input and output, they are a pair of a function and its inverse.

If f(x) = 2x - 3, then f^{-1}(x) = (x + 3)/2 and vice versa.

#### Turning a function into its inverse function

**Method 1**

**Method 2**

- Swap x and y around.
- Make y the subject.

E.g.

f(x) = 2x - 3

y = 2x - 3

Swapping x and y around,

x = 2y - 3

y = (x + 3)/2

f^{-1}(x) = (x + 3)/2

#### Important facts about an inverse function

- ff
^{-1}(x) = f^{-1}f(x) = x
- The function and its inverse are symmetrical in the y = x line.

#### Practice Questions

- y = -3x + 2
- y = 2 + 3(x + 1)
- y = 3 - 2(4x + 1)
- y = 1/(x - 2)
- y = 3 - 2x/3
- y = x² - 3
- If f(x) = 2x - 7, solve f
^{-1}(x).
- If f(x) = 3 + 2(x - 3), solve f
^{-1}(x).
- if f(x) = 2x + 1 and g(x) = x², solve fg(x) = gf(x).
- If f(x) = 4x - 3 and g(x) = x/3, solve f
^{-1}(x) = g^{-1}(x).

#### Answers

Move the mouse over, just below this, to see the answers:

- y = (2-x)/3
- y = (x-2)/3 - 1
- y = (1 - x)/8
- y = 1/x + 2
- y = 3(3 - x)/2
- y = √(x+3)
- x = 7
- x = 3
- x = 0 and x = -2
- x = 0.27

Now that you have read this tutorial, you will find the following tutorials very helpful too: