1 Functions

These notes are reusing text and imagery from: Calculus Volume 1 from OpenStax, Print ISBN 193816802X, Digital ISBN 1947172131, https://www.openstax.org/details/calculus-volume-1 and Precalculus from OpenStax, Print ISBN 1938168348, Digital ISBN 1947172069, https://www.openstax.org/details/precalculus

1.1 Review of Functions

Definition: A function \(f\) consists of a set of inputs, a set of outputs, and a rule for assigning each input to exactly one output.

A one-to-one is a function in which each output valaue corresponds to exactly one input value.


The set of inputs is called the domain \(D\) of the function. The set of outputs is called the range \(R\) of the function.


Often we use \(x\) for the input (independent variable) and \(y\) or \(f(x)\) for the output (dependent variable). \(y = f(x)\) defines the function \(f\).

For example for squaring: \(f(x) = x^2\).


The domain of a function can be given expilicitely as a list, e.g. \(D = \{1, 2 , 3\}\) or through set builder or interval notation \(\{x \, | \, 1<x<5 \}\).

If a domain of a function is not specified we assume it is the set of all real numbers \(x \in \mathbb{R}\).


Funcitons are usually specified by explicit algebraic formulas, e.g. \(f(x) = 3 - x\), \(f(x) = x^3 + 1/x\), etc. These allow to calculate the function values.

Note: For \(y = f(x)\), these two are equivalent \(f(x) = 3 - x\) and \(y = 3 - x\).

Watch out: We do not need to use the letter \(f\) for a function. We can use any other letter or symbol, such as \(g(x) = x/2 + x^4\) for function \(g\) or even \(y(x) = e^x + \ln(x)\) for function \(y\).


We can list the input and ouptputs of the functions in a table

x f(x) = 3 - x
1 2
2 1
3 0

We can visualise a function by plotting points \((x, y)\), where \(y=f(x)\) in the coordinate plane.

Graph of function \(f(x) = 3 - x\) with domain \(D = \{1, 2, 3\}\).

Piecewise-defined functions are defined using different equations for different parts of their domian, e.g. \[\begin{equation} f(x) = \begin{cases} 3x + 1 & x \geq 2\\ x^2 & x < 2 \end{cases} \end{equation}\]

1.2 Increasing / decreasing functions

Definition: A function \(f\) is increasing on the interval \((x_1, x_2)\) if \[f(x_2) \geq f(x_1) \text{ when } x_2 > x_1 \enspace.\] The values \(f(x)\) are getting larger as \(x\) is getting larger.

It is decreasing on the interval \((x_1, x_2)\) if \[f(x_2) \leq f(x_1) \text{ when } x_2 > x_1 \enspace .\] The values \(f(x)\) are getting smaller as \(x\) is getting larger.

The rate of change describes how an output changes relative to the change in the input. The average rate of change between two input values \(x_1\) and \(x_2\) is given by \[ \text{avg rate of chg } = \frac{f(x_2)-f(x_1)}{x_2 - x_1} = \frac{\Delta y}{\Delta x} \enspace .\] The average rage of change is positive for an increaseing function and negative for a decreasing function.


A function \(f\) has a local maximum at a point \(z\) in an interval \((x_1, x_2)\), if \(f(z) \geq f(x)\) for any \(x \in (x_1, x_2)\). It has a local minimum at a point \(z\) in an interval \((x_1, x_2)\), if \(f(z) \leq f(x)\) for any \(x \in (x_1, x_2)\).

A function \(f\) has a global maximum at a point \(z\) if \(f(z) \geq f(x)\) for any \(x\) in the domain \(D\). It has a global minimum at a point \(z\) if \(f(z) \leq f(x)\) for any \(x\) in the domain \(D\).

A value of the input where a function changes from increasing to decreasing is called local maximum; where it changes from decreasing to increasing is a local minimum. Together these points are called local extrema.

1.3 Combining functions

We can create new functions by combining other functions using mathematical operations \[\begin{eqnarray} \text{sum} \quad & (f + g)(x) = f(x) + g(x)\\ \text{difference} \quad & (f - g)(x) = f(x) - g(x)\\ \text{product} \quad & (f \times g)(x) = f(x) \, g(x)\\ \text{quotient} \quad & (f / g)(x) = f(x) \, / \, g(x) \end{eqnarray}\]


When the output of one function is used as th einput of another function, we call the operation a composition of functions. The action defines a composite function.

Careful: The order in which we compose functions matters! \((f \circ g) (x) \neq (g \circ f) (x)\).

Careful: Do not confuse composition with function multiplicatoin \(f( g(x)) \neq f(x) g(x)\).


In some cases it may be useful to decompose a composite function into two simpler functions.

For example \[f(x) = \sqrt{5 - x^2}\] can be decomposed as \(f(x) = g(h(x))\), where \(h(x) = 5 - x^2\) and \(g(x) = \sqrt{x}\).