INTRODUCTION TO FUNCTIONS

A function is a rule that takes an input, does something to it, and gives an output.
Each input has exactly one output.

It is often helpful to think of a function as a box.
You drop an input in the top, something happens to the input inside the box,
and the output drops out the bottom.

The box (the function) can be labeled with what it does.
For example, if the box is labeled ‘add 2’,
then when the number $\,3\,$ is dropped in the top,
the number $\,3+2 = 5\,$ comes out the bottom:

$\displaystyle \overset{\text{input}}{\overbrace{\ \ 3\ \ }} \overset{\text{the function adds 2}} { \overset{\text{to the input}}{\overbrace{\strut\ +\ \ 2\ }} } \overset{\text{and produces }}{\overbrace{\strut\ \ =\ \ }} \overset{\text{the output}}{\overbrace{\strut\ \ 5\ \ }}$

EXAMPLES:
Question: Consider the ‘add $\,2\,$’ function.
If $\,3\,$ is the input, then what is the output?
Answer: $3 + 2 = 5$
Question: Consider the ‘add $\,2\,$’ function.
If $\,x\,$ is the input, then what is the output?
Answer: $x + 2$
Question: Consider the ‘add $\,2\,$’ function.
If $\,x + 3\,$ is the input, then what is the output?
Answer: $(x + 3) + 2 = x + 5$
Question: Consider the ‘multiply by $\,2\,$’ function.
If $\,x + 5\,$ is the input, then what is the output?
Answer: $2(x + 5) = 2x + 10$
Master the ideas from this section