Content On This Page | ||
---|---|---|
Algebra of Functions (Addition, Subtraction, Multiplication, Division) | Composition of Functions (Definition and Properties) |
Operations on Functions
Algebra of Functions (Addition, Subtraction, Multiplication, Division)
Similar to how we perform arithmetic operations on numbers, we can define algebraic operations for real functions. These operations combine two or more functions to create new functions. For these basic algebraic operations, the functions must have domains that overlap.
Let $f$ and $g$ be two real functions. Let $D_f$ be the domain of $f$ and $D_g$ be the domain of $g$. For the combined functions to be defined, the inputs must be in the intersection of their domains, $D_f \cap D_g$. Assume $D_f \cap D_g$ is non-empty.
Definitions of Algebraic Operations on Functions
For functions $f$ and $g$, we define the following operations:
-
Addition of Functions:
The sum of functions $f$ and $g$, denoted by $f+g$, is a function defined for each $x$ in the common domain $D_f \cap D_g$.$\mathbf{(f+g)(x) = f(x) + g(x)}$
Domain of $(f+g)$: The domain of $f+g$ is the intersection of the domains of $f$ and $g$.
Domain$(f+g) = D_f \cap D_g$
-
Subtraction of Functions:
The difference of functions $f$ and $g$, denoted by $f-g$, is a function defined for each $x$ in the common domain $D_f \cap D_g$.$\mathbf{(f-g)(x) = f(x) - g(x)}$
Domain of $(f-g)$: The domain of $f-g$ is the intersection of the domains of $f$ and $g$.
Domain$(f-g) = D_f \cap D_g$
-
Scalar Multiplication of a Function:
The product of a real number (scalar) $c$ and a function $f$, denoted by $cf$, is a function defined for each $x$ in the domain $D_f$.$\mathbf{(cf)(x) = c \cdot f(x)}$
Domain of $(cf)$: The domain of $cf$ is the same as the domain of $f$.
Domain$(cf) = D_f$
-
Multiplication (Product) of Functions:
The product of functions $f$ and $g$, denoted by $fg$, is a function defined for each $x$ in the common domain $D_f \cap D_g$.$\mathbf{(fg)(x) = f(x) \cdot g(x)}$
Domain of $(fg)$: The domain of $fg$ is the intersection of the domains of $f$ and $g$.
Domain$(fg) = D_f \cap D_g$
-
Division (Quotient) of Functions:
The quotient of functions $f$ and $g$, denoted by $f/g$, is a function defined for each $x$ in the common domain $D_f \cap D_g$ such that $g(x) \neq 0$.$\mathbf{\left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)}}$
Domain of $(f/g)$: The domain of $f/g$ is the intersection of the domains of $f$ and $g$, excluding any values of $x$ where $g(x)$ is zero.
Domain$\left(\frac{f}{g}\right) = \{x \in D_f \cap D_g \mid g(x) \neq 0\}$
Similarly, the domain of $g/f$ is $\{x \in D_f \cap D_g \mid f(x) \neq 0\}$.
Example 1. Let $f(x) = x^2 + 1$ and $g(x) = x - 1$. Find the functions $f+g$, $f-g$, $f \cdot g$, and $f/g$, and state their domains (assuming the initial domain for both is $\mathbb{R}$).
Answer:
Given: $f(x) = x^2 + 1$ and $g(x) = x - 1$.
Both $f(x)$ and $g(x)$ are polynomial functions, which are defined for all real numbers. So, the domain of $f$ is $D_f = \mathbb{R}$, and the domain of $g$ is $D_g = \mathbb{R}$.
The common domain is $D_f \cap D_g = \mathbb{R} \cap \mathbb{R} = \mathbb{R}$.
To Find: $f+g$, $f-g$, $f \cdot g$, $f/g$, and their domains.
Solution:
1. Sum ($f+g$):
$(f+g)(x) = f(x) + g(x) = (x^2 + 1) + (x - 1) = x^2 + x$
Domain$(f+g) = D_f \cap D_g = \mathbb{R}$.
2. Difference ($f-g$):
$(f-g)(x) = f(x) - g(x) = (x^2 + 1) - (x - 1) = x^2 + 1 - x + 1 = x^2 - x + 2$
Domain$(f-g) = D_f \cap D_g = \mathbb{R}$.
3. Product ($f \cdot g$):
$(f \cdot g)(x) = f(x) \cdot g(x) = (x^2 + 1)(x - 1)$
Expanding the product:
$(f \cdot g)(x) = x^2(x) + x^2(-1) + 1(x) + 1(-1) = x^3 - x^2 + x - 1$
Domain$(f \cdot g) = D_f \cap D_g = \mathbb{R}$.
4. Quotient ($f/g$):
$\left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)} = \frac{x^2 + 1}{x - 1}$
The domain of the quotient is the common domain $\mathbb{R}$, excluding any values of $x$ where the denominator $g(x)$ is zero.
Set $g(x) = 0$:
$x - 1 = 0$
$x = 1$
... (ii)
We must exclude $x = 1$ from the domain.
Domain$\left(\frac{f}{g}\right) = \mathbb{R} \setminus \{1\}$
In interval notation: $(-\infty, 1) \cup (1, \infty)$.
Example 2. Let $f(x) = \sqrt{x}$ and $g(x) = x^2 - 4$. Find the domains of $(f+g)(x)$ and $(f/g)(x)$.
Answer:
Given: $f(x) = \sqrt{x}$ and $g(x) = x^2 - 4$.
First, find the domains of the individual functions:
- For $f(x) = \sqrt{x}$, the expression under the square root must be non-negative. $x \ge 0$.
Domain of $f$, $D_f = [0, \infty)$.
- For $g(x) = x^2 - 4$, this is a polynomial, defined for all real numbers.
Domain of $g$, $D_g = \mathbb{R}$.
The common domain is $D_f \cap D_g = [0, \infty) \cap \mathbb{R} = [0, \infty)$.
To Find: Domains of $(f+g)(x)$ and $(f/g)(x)$.
Solution:
1. Domain of $(f+g)$:
The domain of the sum is the intersection of the domains of $f$ and $g$.
Domain$(f+g) = D_f \cap D_g = [0, \infty)$
((f+g)(x) = $\sqrt{x} + x^2 - 4$ is defined for $x \ge 0$).
2. Domain of $(f/g)$:
The domain of the quotient is the common domain $D_f \cap D_g$, excluding values where the denominator $g(x)$ is zero.
The common domain is $[0, \infty)$.
Set $g(x) = 0$ to find excluded values:
$x^2 - 4 = 0$
$x^2 = 4$
$x = \pm 2$
We must exclude $x=2$ and $x=-2$. However, the domain is limited to $[0, \infty)$. From the common domain $[0, \infty)$, only $x=2$ needs to be excluded (since $-2$ is not in $[0, \infty)$ anyway).
Domain$\left(\frac{f}{g}\right) = \{x \in [0, \infty) \mid x \neq 2\}$
In interval notation, this is $[0, 2) \cup (2, \infty)$.
((f/g)(x) = $\frac{\sqrt{x}}{x^2 - 4}$).
Composition of Functions (Definition and Properties)
Function composition is a way to combine two functions where the output of one function becomes the input of the other. This creates a new function that represents the sequence of applying the two original functions.
Definition of Function Composition
Let $f: A \to B$ and $g: C \to D$ be two functions. The composition of $g$ with $f$, denoted by $g \circ f$ (read as "$g$ composed with $f$" or "$g$ after $f$"), is a function defined as $(g \circ f)(x) = g(f(x))$.
For the composition $g \circ f$ to be defined, the outputs of the first function $f$ must be valid inputs for the second function $g$. This requires that the range of $f$ must be a subset of the domain of $g$.
$g \circ f \text{ is defined if and only if } \text{Range}(f) \subseteq \text{Domain}(g)$
If Range$(f) \subseteq \text{Domain}(g)$, then the function $g \circ f$ maps elements from the domain of $f$ to the codomain of $g$.
If $f: A \to B$ and $g: B \to C$, then $(g \circ f): A \to C$
Here, the codomain of $f$ is $B$, which is also the domain of $g$. In this specific case, Range$(f)$ is a subset of $B$, and Domain$(g)$ is $B$, so Range$(f) \subseteq B = \text{Domain}(g)$, and the composition $g \circ f$ is defined from $A$ to $C$.
The process of composition $(g \circ f)(x) = g(f(x))$ can be visualized as:

Domain of a Composite Function:
The domain of the composite function $(g \circ f)$ is the set of all elements $x$ in the domain of the first function $f$ such that $f(x)$ is in the domain of the second function $g$.
Domain$(g \circ f) = \{x \in \text{Domain}(f) \mid f(x) \in \text{Domain}(g)\}$
If Range$(f) \subseteq \text{Domain}(g)$, then for every $x \in \text{Domain}(f)$, $f(x)$ is guaranteed to be in Domain$(g)$, so the domain of $g \circ f$ is simply Domain$(f)$. If the Range of $f$ is not entirely contained within the Domain of $g$, we need to restrict the domain of $f$ to include only those $x$ whose images $f(x)$ are in Domain$(g)$.
Example 3. Let $f(x) = x^2$ and $g(x) = 2x + 3$. Find $(g \circ f)(x)$ and $(f \circ g)(x)$. Assume the initial domain for both is $\mathbb{R}$.
Answer:
Given: $f(x) = x^2$, $g(x) = 2x + 3$. Both have domain $\mathbb{R}$. Codomain for both is $\mathbb{R}$.
Range of $f(x) = x^2$ is $[0, \infty)$. Range of $g(x) = 2x+3$ is $\mathbb{R}$.
Domain of $f$ is $\mathbb{R}$, Domain of $g$ is $\mathbb{R}$.
To Find: $(g \circ f)(x)$ and $(f \circ g)(x)$.
Finding $(g \circ f)(x)$:
$(g \circ f)(x) = g(f(x))$
Substitute $f(x)$ into $g$: $(g \circ f)(x) = g(x^2)$.
Apply the rule for $g$: $g(\text{input}) = 2(\text{input}) + 3$. So, $g(x^2) = 2(x^2) + 3$.
$\mathbf{(g \circ f)(x) = 2x^2 + 3}$
Domain of $g \circ f$: Domain$(f) = \mathbb{R}$. Range$(f) = [0, \infty)$. Domain$(g) = \mathbb{R}$. Since Range$(f) \subseteq \text{Domain}(g)$ ($[0, \infty) \subseteq \mathbb{R}$), the domain of $g \circ f$ is the entire domain of $f$.
Domain$(g \circ f) = \mathbb{R}$.
Finding $(f \circ g)(x)$:
$(f \circ g)(x) = f(g(x))$
Substitute $g(x)$ into $f$: $(f \circ g)(x) = f(2x + 3)$.
Apply the rule for $f$: $f(\text{input}) = (\text{input})^2$. So, $f(2x + 3) = (2x + 3)^2$.
$\mathbf{(f \circ g)(x) = (2x + 3)^2 = 4x^2 + 12x + 9}$
Domain of $f \circ g$: Domain$(g) = \mathbb{R}$. Range$(g) = \mathbb{R}$. Domain$(f) = \mathbb{R}$. Since Range$(g) \subseteq \text{Domain}(f)$ ($\mathbb{R} \subseteq \mathbb{R}$), the domain of $f \circ g$ is the entire domain of $g$.
Domain$(f \circ g) = \mathbb{R}$.
Note from this example that $(g \circ f)(x)$ and $(f \circ g)(x)$ are generally different functions. Function composition is not commutative.
Example 4. Let $f(x) = \sqrt{x-1}$ and $g(x) = x^2 + 3$. Find $(f \circ g)(x)$ and its domain.
Answer:
Given: $f(x) = \sqrt{x-1}$ and $g(x) = x^2 + 3$.
First, find the domains of $f$ and $g$ (assuming the natural domain in $\mathbb{R}$).
- For $f(x) = \sqrt{x-1}$, $x-1 \ge 0 \implies x \ge 1$. Domain of $f$, $D_f = [1, \infty)$.
- For $g(x) = x^2 + 3$, this is a polynomial. Domain of $g$, $D_g = \mathbb{R}$.
To Find: $(f \circ g)(x)$ and its domain.
Finding $(f \circ g)(x)$:
$(f \circ g)(x) = f(g(x)) = f(x^2 + 3)$.
Apply the rule for $f$: $f(\text{input}) = \sqrt{\text{input} - 1}$. So, $f(x^2 + 3) = \sqrt{(x^2 + 3) - 1}$.
$\mathbf{(f \circ g)(x) = \sqrt{x^2 + 2}}$
Finding the Domain of $(f \circ g)$:
The domain of $f \circ g$ consists of values $x$ such that:
- $x$ is in the domain of the inner function $g$. Domain$(g) = \mathbb{R}$. So $x \in \mathbb{R}$.
- The output of the inner function, $g(x) = x^2 + 3$, is in the domain of the outer function $f$. Domain$(f) = [1, \infty)$. So, $g(x) \ge 1$.
We need $x \in \mathbb{R}$ and $x^2 + 3 \ge 1$.
Solve the inequality: $x^2 + 3 \ge 1 \implies x^2 \ge -2$.
The inequality $x^2 \ge -2$ is true for all real numbers $x$, since the square of any real number is always greater than or equal to 0, and $0 \ge -2$.
So, the condition $g(x) \in \text{Domain}(f)$ is satisfied for all $x \in \mathbb{R}$.
Since the domain of $g$ is $\mathbb{R}$, and $g(x)$ is always in the domain of $f$, the domain of $f \circ g$ is the domain of $g$.
Domain$(f \circ g) = \mathbb{R}$
(Alternatively, check the domain of the resulting function $\sqrt{x^2+2}$. We need $x^2+2 \ge 0 \implies x^2 \ge -2$, which is true for all real $x$. So the domain is $\mathbb{R}$. This works here because the range of $g(x)$ was "large enough" for the domain of $f(x)$. Always follow the definition based on the inner function's output and outer function's domain for rigorous domain finding of composite functions).
Properties of Function Composition
Function composition, while powerful, does not share all the properties of algebraic operations like addition or multiplication.
-
Non-Commutativity:
In general, the order of composition matters. $f \circ g$ is usually not equal to $g \circ f$. This was demonstrated in Example 3. Even if both $f \circ g$ and $g \circ f$ are defined, they are typically different functions. -
Associativity:
Function composition is associative. If you compose three functions $f, g, h$ (provided the necessary conditions on their domains and ranges are met for composition), the way they are grouped does not change the final result.If $f: A \to B$, $g: B \to C$, and $h: C \to D$ are functions, then:
$\mathbf{h \circ (g \circ f) = (h \circ g) \circ f}$
Proof: Let $x \in A$.
$[h \circ (g \circ f)](x) = h((g \circ f)(x)) = h(g(f(x)))$
$\textsf{(Definition of } h \circ \text{ and } g \circ f\textsf{)}$
$[(h \circ g) \circ f](x) = (h \circ g)(f(x)) = h(g(f(x)))$
$\textsf{(Definition of } (h \circ g) \circ \text{ and } h \circ g\textsf{)}$
Since both expressions evaluate to the same value $h(g(f(x)))$ for every $x$ in the domain $A$, the functions $h \circ (g \circ f)$ and $(h \circ g) \circ f$ are equal. This allows us to write compositions of multiple functions like $h \circ g \circ f$ without parentheses.
-
Composition with Identity Function:
Composing a function $f$ with the identity function ($I(x)=x$) does not change the function.Let $f: A \to B$. Let $I_A: A \to A$ be the identity function on $A$, and $I_B: B \to B$ be the identity function on $B$.
$\mathbf{f \circ I_A = f}$
$\textsf{(For } x \in A, (f \circ I_A)(x) = f(I_A(x)) = f(x)\textsf{)}$
$\mathbf{I_B \circ f = f}$
$\textsf{(For } x \in A, (I_B \circ f)(x) = I_B(f(x)) = f(x)\textsf{)}$
Note that for $f \circ I_A$ to be defined, Range$(I_A) \subseteq \text{Domain}(f)$. Since Range$(I_A)=A$ and Domain$(f)=A$, this is satisfied. For $I_B \circ f$ to be defined, Range$(f) \subseteq \text{Domain}(I_B)$. Since Domain$(I_B)=B$ and Range$(f) \subseteq B$, this is also satisfied.
-
Composition of Bijective Functions:
If $f: A \to B$ and $g: B \to C$ are both bijective functions, then their composition $g \circ f: A \to C$ is also a bijective function. -
Inverse of a Composition:
If $f: A \to B$ and $g: B \to C$ are bijective functions, then the composite function $g \circ f: A \to C$ is also bijective and has an inverse function $(g \circ f)^{-1}: C \to A$. The inverse of the composition is the composition of the inverses, but in reverse order:$\mathbf{(g \circ f)^{-1} = f^{-1} \circ g^{-1}}$
Summary for Competitive Exams
Algebra of Functions ( pointwise ): For functions $f, g$ with domains $D_f, D_g$:
- Sum: $(f+g)(x) = f(x)+g(x)$, Domain $= D_f \cap D_g$.
- Difference: $(f-g)(x) = f(x)-g(x)$, Domain $= D_f \cap D_g$.
- Product: $(fg)(x) = f(x)g(x)$, Domain $= D_f \cap D_g$.
- Scalar Mult: $(cf)(x) = c f(x)$, Domain $= D_f$.
- Quotient: $(f/g)(x) = f(x)/g(x)$, Domain $= \{x \in D_f \cap D_g \mid g(x) \neq 0\}$.
Composition of Functions ($g \circ f$): Apply $f$ first, then $g$. $(g \circ f)(x) = g(f(x))$.
- Defined $\iff$ Range$(f) \subseteq$ Domain$(g)$.
- If $f: A \to B$ and $g: B \to C$, then $(g \circ f): A \to C$.
- Domain$(g \circ f) = \{x \in \text{Domain}(f) \mid f(x) \in \text{Domain}(g)\}$.
- Properties:
- Associative: $h \circ (g \circ f) = (h \circ g) \circ f$.
- Not Commutative (generally): $f \circ g \neq g \circ f$.
- Identity: $f \circ I_A = f$, $I_B \circ f = f$.
- Inverse of Composition: $(g \circ f)^{-1} = f^{-1} \circ g^{-1}$ (if inverses exist).
- Composition of Bijections is a Bijection.
When finding the domain of $g \circ f$: find domain of $f$ AND the values of $x$ in domain of $f$ for which $f(x)$ is in domain of $g$.