1.3 New Functions from Old

Once we have a basic vocabulary of functions, we can combine them to build increasingly complex structures.

1.3.1 Arithmetic of Functions

Given two functions ff and gg with ranges in ℝ\mathbb{R}, we define new algebraic combinations:

h≔f+g⇔h⁢(x)=f⁢(x)+g⁢(x)h≔f−g⇔h⁢(x)=f⁢(x)−g⁢(x)h≔f⁢g⇔h⁢(x)=f⁢(x)⁢g⁢(x)h≔fg⇔h⁢(x)=f⁢(x)g⁢(x)\begin{split}h\coloneqq f+g&{}\iff h(x)=f(x)+g(x)\\ h\coloneqq f-g&{}\iff h(x)=f(x)-g(x)\\ h\coloneqq fg&{}\iff h(x)=f(x)g(x)\\ h\coloneqq\frac{f}{g}&{}\iff h(x)=\frac{f(x)}{g(x)}\end{split}
Caveat (The Subtlety of Domains).

One must be remarkably mindful about domains when performing algebra. Consider:

equation (1.4) (1.4)
f⁢(x)=1x−1andg⁢(x)=x−1.f(x)=\frac{1}{x-1}\quad\text{and}\quad g(x)=x-1.

The domains are dom⁡(f)=(−∞,1)∪(1,∞)\operatorname{dom}(f)=(-\infty,1)\cup(1,\infty) and dom⁡(g)=ℝ\operatorname{dom}(g)=\mathbb{R}. If we define h=f⁢gh=fg, we compute:

equation (1.5) (1.5)
h⁢(x)=f⁢(x)⁢g⁢(x)=1x−1⋅(x−1)=x−1x−1.h(x)=f(x)g(x)=\frac{1}{x-1}\cdot(x-1)=\frac{x-1}{x-1}.

For any x≠1x\neq 1, this fraction simplifies to 11. However, at x=1x=1, the original function f⁢(x)f(x) is undefined. We cannot simply brush this under the algebraic rug! We conclude that h⁢(x)=1h(x)=1 with restricted domain dom⁡(h)=(−∞,1)∪(1,∞)\operatorname{dom}(h)=(-\infty,1)\cup(1,\infty).

1.3.2 Composition of Functions

Instead of adding outputs, what if we feed the output of gg directly into the input of ff? This mathematical assembly line is known as composition, see Figure 1.3.

A mathematical mapping diagram illustrating function composition. Three vertical, light-blue shaded ellipses represent the sets X, Y, and Z from left to right. Inside set X, a point labeled x is mapped to a point labeled g(x) in set Y by a blue curved arrow labeled g on top. From set Y, the point g(x) is mapped to a point labeled f(g(x)) in set Z by another blue curved arrow labeled f on top. Below the ellipses, a long green curved arrow labeled f composed with g directly maps the point x in set X to the point f(g(x)) in set Z, visually demonstrating the composite function.
Figure 1.3: Composition of functions f∘gf\circ g
Definition 1.3.1 (Composition).

The composition of ff and gg, denoted f∘gf\circ g, is defined as:

equation (1.6) (1.6)
(f∘g)⁢(x)=f⁢(g⁢(x)).(f\circ g)(x)=f(g(x)).
Proposition 1.3.2.

The domain of f∘gf\circ g is the set of all x∈dom⁡(g)x\in\operatorname{dom}(g) such that g⁢(x)∈dom⁡(f)g(x)\in\operatorname{dom}(f).

Example 1.3.3.

Let f⁢(x)=3⁢x2−xf(x)=3x^{2}-x and g⁢(x)=1xg(x)=\frac{1}{x}. Then:

equation (1.7) (1.7)
(f∘g)⁢(x)=f⁢(g⁢(x))=f⁢(1x)=3⁢(1x)2−(1x)=3x2−1x.(f\circ g)(x)=f(g(x))=f\left(\frac{1}{x}\right)=3\left(\frac{1}{x}\right)^{2}-% \left(\frac{1}{x}\right)=\frac{3}{x^{2}}-\frac{1}{x}.
Caveat (Non-Commutativity).

In general, (f∘g)≠(g∘f)(f\circ g)\neq(g\circ f). Reversing the assembly line fundamentally changes the product. Using the previous example:

equation (1.8) (1.8)
(g∘f)⁢(x)=g⁢(f⁢(x))=g⁢(3⁢x2−x)=13⁢x2−x.(g\circ f)(x)=g(f(x))=g(3x^{2}-x)=\frac{1}{3x^{2}-x}.