### Definition of a Function

Functions are nothing more than equations where you can plug in an input variable `\(x\)`

and get an output variable `\(y\)`

in return.
$$
x \xrightarrow{\text{input}}\boxed{function}\xrightarrow{\text{output}} y
$$
Functions describe the relations, causalities, and changes between one variable (*the input*) and the next (*the output*). In function notation it is expressed as:
$$
\Large y = f(x)
$$

### Examples

*These examples are taken from The Manga Guide to Calculus (highly recommended)*

**An example of Causality**

The frequency of a cricket's chirp `\(y\)`

is determined by temperature `\(x\)`

with the function `\(y = 7x-30\)`

.
Given `\(x\)`

is `\(27^\circ C\)`

:

**An example of Changes**

The speed of sound `\(y\)`

in meters per second (`\(m/s\)`

) changes in relation to the temperature `\(x^\circ C\)`

.

**An example of Relations**

Conversion between `\(x^\circ\)`

Fahrenheit to `\(y^\circ\)`

Celsius.

### As an aside...

** Composition of functions** is the combination of two or more functions.
$$
x \rightarrow \boxed{f} \rightarrow f(x) \rightarrow \boxed{g} \rightarrow g(f(x))
$$
In computer science, functions that can be passed to other functions as input (

*arguments*) are called

**first class functions**.

### Graphing Functions

Graphing functions is quite simple, you plug in any variable `\(x\)`

into the function and take the result `\(y\)`

and use them as your `\(x, y\)`

coordinates.

`\(f(x) = 2x - 1\)`

You might ask what the purpose of graphing a function is... Graphs are visual representations of data and the effect that they have on each other (sound familiar? that's what a function is supposed to show). These relations are easier to understand when graphed since humans are primarily visual creatures. Graphs are a perfect way to see and predict trends; it is such an effective way that even very young children can comprehend what graphs are saying.