The Big Idea
Substitution, evaluation, and composition describe three connected stages of mathematical work. Substitution replaces a symbol with an allowed expression. Evaluation computes or simplifies the result. Composition connects entire rules so that one output becomes another rule’s input.
| Process | Central question | Example |
|---|---|---|
| Substitution | What replaces the selected symbol or input? | Replace \(x\) by \(-2\) in \(x^2+3x\) |
| Evaluation | What value or simplified object results? | \((-2)^2+3(-2)=-2\) |
| Composition | What happens when one complete rule feeds another? | \((f\circ g)(x)=f(g(x))\) |
These processes turn static symbols into working mathematical systems. They support formulas, functions, equations, transformations, algorithms, modeling, and verification.
What Is Substitution?
Substitution replaces each targeted occurrence of a variable or expression with another permitted value or expression while preserving the surrounding structure.
If
\[ E(x)=x^2-4x+1, \]
then substituting \(x=3\) gives
\[ E(3)=(3)^2-4(3)+1. \]
This line completes the substitution. Computing \(9-12+1=-2\) is the evaluation step.
Parentheses Protect the Replacement
When substituting a negative number or multi-term expression, place the entire replacement in parentheses.
For \(x=-3\),
\[ x^2\longrightarrow(-3)^2=9. \]
Writing \(-3^2\) would mean \(-(3^2)=-9\), which changes the base and produces the wrong value.
For \(x=a+b\),
\[ 2x^2\longrightarrow2(a+b)^2, \]
not \(2a+b^2\). Substitution replaces the complete symbol with the complete expression.
What Is Evaluation?
Evaluation determines the value of an expression, function, formula, or algorithm for specified inputs. It normally follows the order of operations after substitution.
Evaluate
\[ 2x^2-5x+4 \]
at \(x=-2\):
\[ 2(-2)^2-5(-2)+4 =2(4)+10+4 =22. \]
A careful evaluation shows the replacement, preserves signs with parentheses, and simplifies in a visible sequence.
Function Notation Names an Evaluation
If
\[ f(x)=3x-7, \]
then \(f(5)\) means the output when the input is \(5\):
\[ f(5)=3(5)-7=8. \]
The notation \(f(5)\) does not mean \(f\times5\). The parentheses show that \(5\) is an input to the function.
Likewise,
\[ f(a+h)=3(a+h)-7=3a+3h-7. \]
A function can accept an expression as its input, not only a number.
A Formula Is Not the Same as One of Its Values
The rule \(f(x)=x^2+1\) describes how every allowed input is processed. The value \(f(3)=10\) is one result produced by that rule.
| Object | Example | Meaning |
|---|---|---|
| Function rule | \(f(x)=x^2+1\) | A reusable input-output assignment |
| Function value | \(f(3)=10\) | The output at one specific input |
| Equation | \(f(x)=10\) | A condition asking which inputs produce \(10\) |
Substituting Multiple Variables
A multivariable expression needs a value for each variable being evaluated. For
\[ F(x,y)=x^2+2xy-y, \]
substitute \(x=3\) and \(y=-2\):
\[ F(3,-2) =(3)^2+2(3)(-2)-(-2) =9-12+2 =-1. \]
Labeling inputs by position or variable prevents accidental switching.
Partial Substitution
Not every substitution produces a number. Replacing only some variables creates a new expression or function.
If
\[ F(x,y)=x^2+xy+y^2 \]
and \(y=2\), then
\[ F(x,2)=x^2+2x+4. \]
The result remains a function of \(x\). Substitution can specialize a general rule without fully evaluating it.
Simultaneous and Sequential Substitution
In a simultaneous substitution, all replacements use the original expression. In a sequential substitution, each replacement acts on the result of the previous one.
Start with \(x-y\) and consider \(x\mapsto y\), \(y\mapsto x\).
Simultaneous replacement swaps the variables:
\[ x-y\longrightarrow y-x. \]
If the substitutions are performed sequentially without temporary symbols, the first replacement may change what the second replacement sees. Therefore, the intended method and order must be stated.
A Replacement Must Respect the Domain
A substitution can be written correctly but still produce an undefined expression.
| Expression | Input | Outcome in the real numbers |
|---|---|---|
| \(1/x\) | \(x=0\) | Undefined because the denominator is zero |
| \(\sqrt{x}\) | \(x=-4\) | Not real |
| \(\log x\) | \(x=0\) | Undefined in the real logarithm |
| \(\frac{x+1}{x-3}\) | \(x=3\) | Undefined because the denominator vanishes |
Check the domain before computing. An input outside the domain has no output in the selected function and number system.
Units and Object Types Must Match
Substitution also requires compatible kinds of objects. In
\[ d=rt, \]
substituting \(r=60\text{ mi/h}\) and \(t=2.5\text{ h}\) gives
\[ d=60\frac{\text{mi}}{\text{h}}(2.5\text{ h})=150\text{ mi}. \]
Substituting a temperature where a time is required would not satisfy the formula’s intended types. Units act like a practical type-checking system.
Exact and Approximate Evaluation
An exact value preserves full mathematical information:
\[ \sqrt8=2\sqrt2. \]
A decimal evaluation is approximate:
\[ 2\sqrt2\approx2.828. \]
Keep exact forms during symbolic work when possible, then approximate at the end to the precision justified by the problem.
What Is Composition?
Composition connects two functions by feeding the output of one into the input of another. The composition of \(f\) after \(g\) is
\[ (f\circ g)(x)=f(g(x)). \]
The inner function \(g\) acts first. Its output must be an allowed input for \(f\).
If \(g(x)=x+2\) and \(f(x)=x^2\), then
\[ (f\circ g)(x)=f(x+2)=(x+2)^2. \]
Composition Order Matters
Function composition is generally not commutative. Using
\[ f(x)=x^2 \qquad\text{and}\qquad g(x)=x+2, \]
we obtain
\[ (f\circ g)(x)=(x+2)^2, \]
but
\[ (g\circ f)(x)=x^2+2. \]
Squaring after adding two is not the same process as adding two after squaring.
Composition as an Input–Output Pipeline
A composite rule can be read from the inside outward:
\[ f(g(h(x))). \]
- start with \(x\),
- apply \(h\),
- feed that output into \(g\), and
- feed the new output into \(f\).
This pipeline view links function composition to formulas, machines, transformations, computer programs, and real production processes.
The Domain of a Composite Function
For \((f\circ g)(x)\) to be defined:
- \(x\) must belong to the domain of \(g\), and
- \(g(x)\) must belong to the domain of \(f\).
Let \(f(x)=\sqrt x\) and \(g(x)=x-4\). Then
\[ (f\circ g)(x)=\sqrt{x-4}, \]
which requires \(x\ge4\). Reversing the order gives
\[ (g\circ f)(x)=\sqrt x-4, \]
which requires only \(x\ge0\). Composition order can change both the formula and the domain.
Associativity and Identity
Function composition is associative wherever the compositions are defined:
\[ (f\circ g)\circ h=f\circ(g\circ h). \]
This means a pipeline may be grouped in stages without changing the order in which its functions act.
The identity function
\[ I(x)=x \]
leaves a function unchanged under composition:
\[ f\circ I=I\circ f=f. \]
Inverse Functions Cancel by Composition
If \(f\) is invertible, then its inverse reverses its action:
\[ f^{-1}\circ f=I \qquad\text{and}\qquad f\circ f^{-1}=I \]
on the appropriate domains.
If \(f(x)=3x+5\), then \(f^{-1}(x)=(x-5)/3\). Composing gives
\[ f^{-1}(f(x)) =\frac{(3x+5)-5}{3} =x. \]
Notice that the inverse undoes the original steps in reverse order.
Composition Is Not Multiplication
The product of functions is
\[ (fg)(x)=f(x)g(x), \]
while their composition is
\[ (f\circ g)(x)=f(g(x)). \]
For \(f(x)=x^2\) and \(g(x)=x+1\),
\[ (fg)(x)=x^2(x+1), \qquad (f\circ g)(x)=(x+1)^2. \]
Similar compact notation does not imply the same operation.
Evaluating Practical Formulas
Suppose the area of a circle is
\[ A=\pi r^2. \]
For \(r=3.5\text{ cm}\), substitute the complete measured value:
\[ A=\pi(3.5\text{ cm})^2 =12.25\pi\text{ cm}^2 \approx38.5\text{ cm}^2. \]
Units are part of the substitution, and the square applies to both the number and the unit.
Check Solutions by Substitution
A candidate solves an equation only if substituting it makes the original statement true.
Check \(x=4\) in
\[ 2x+3=11: \]
\[ 2(4)+3=8+3=11. \]
Because the evaluated left side equals the right side, \(4\) is a solution. Checking in the original equation is especially important after squaring, clearing denominators, or applying nonreversible steps that may create extraneous candidates.
The Substitution Method for Systems
If one equation expresses a variable in terms of another, substitute that expression into the remaining equation.
Consider
\[ x+y=10, \qquad y=2x+1. \]
Replace \(y\) in the first equation:
\[ x+(2x+1)=10. \]
Then \(3x=9\), so \(x=3\). Substitute back to obtain \(y=7\). Checking both original equations verifies the ordered pair \((3,7)\).
Substitution in Recursive Sequences
A recursive rule evaluates each term using earlier terms. Suppose
\[ a_1=3, \qquad a_n=2a_{n-1}+1. \]
Substitute \(a_1=3\) to find
\[ a_2=2(3)+1=7. \]
Then substitute \(a_2=7\):
\[ a_3=2(7)+1=15. \]
Recursion is sequential substitution organized by an index.
Vectors and Matrices as Inputs
Substitution is not limited to scalar numbers. If
\[ T(\mathbf v)=A\mathbf v, \]
then evaluating \(T\) at a vector means substituting the entire vector into the rule.
For
\[ A=\begin{pmatrix}2&0\\1&3\end{pmatrix}, \qquad \mathbf v=\begin{pmatrix}4\\-1\end{pmatrix}, \]
evaluation gives
\[ T(\mathbf v) =A\mathbf v =\begin{pmatrix}8\\1\end{pmatrix}. \]
Composition of linear transformations corresponds to matrix multiplication in the same order as the transformations act.
Evaluating a Polynomial at a Matrix
A polynomial can accept a square matrix as input when scalar constants are interpreted through the identity matrix. If
\[ p(x)=x^2-3x+2, \]
then
\[ p(A)=A^2-3A+2I. \]
The constant term becomes \(2I\), not a matrix whose every entry equals \(2\). Object type and identity structure determine how substitution is interpreted.
Composition of Transformations
Geometric operations form pipelines just like functions. Suppose \(R\) rotates points and \(S\) scales them. Then
\[ (R\circ S)(P)=R(S(P)) \]
scales point \(P\) first and rotates the result. Reversing the order may produce a different location, especially when rotations or scalings are centered at different points.
Translations, rotations, reflections, projections, and coordinate conversions can all be studied through evaluation and composition.
Variables, Scope, and Bound Symbols
In advanced expressions, not every appearance of a letter is freely replaceable. A variable controlled by a summation, integral, quantifier, or local function definition is bound within its scope.
For example, in
\[ \sum_{k=1}^{n}k, \]
the symbol \(k\) is the bound index, while \(n\) is a free parameter. Substituting \(n=4\) gives \(\sum_{k=1}^{4}k\); it does not replace the local index \(k\) unless that separate action is explicitly intended.
Substitution Versus Assignment
In mathematics, \(x=5\) is normally an equality or a stated value used for substitution. In programming, an instruction such as x = 5 may assign or update stored data.
Mathematical substitution does not automatically mutate a symbol everywhere forever. It is performed within a stated expression, equation, function call, or scope. This distinction becomes important when translating algorithms between mathematics and code.
A Practical Substitution and Composition Routine
- Identify the target variable, input, or function.
- Confirm that the replacement has the correct type, unit, and domain.
- Place the complete replacement in parentheses.
- Replace every intended free occurrence consistently.
- For composition, work from the inside outward.
- Preserve exact values until approximation is needed.
- Evaluate using the order of operations.
- Carry units and domain restrictions into the result.
- Check by substitution into the original rule or equation.
Common Confusions
Are substitution and evaluation the same thing?
They are connected but distinct. Substitution replaces an input; evaluation computes or simplifies the resulting expression.
Does \(f(3)\) mean \(f\times3\)?
No. It means the output of function \(f\) at input \(3\).
Why use parentheses around a substituted value?
Parentheses preserve the complete replacement as one input, especially when it is negative or contains several terms.
Can any number be substituted into any formula?
No. Inputs must satisfy the domain, unit, dimension, and object-type requirements of the rule.
Does \(f\circ g\) mean \(fg\)?
No. Composition feeds \(g(x)\) into \(f\); multiplication multiplies the two output values.
Which function acts first in \((f\circ g)(x)\)?
The inner function \(g\) acts first. Then \(f\) acts on its output.
Is composition commutative?
Not in general. \(f\circ g\) and \(g\circ f\) can have different formulas, outputs, and domains.
Do simultaneous and sequential substitutions always agree?
No. Sequential replacements can change what later replacements encounter. State the intended method and order.
Why check a solution in the original equation?
Algebraic transformations can introduce extraneous candidates or hide domain restrictions. Direct substitution tests the original condition.
Working Summary
Substitution replaces, evaluation computes, and composition connects. Parentheses preserve replacements, domains determine allowed inputs, and units help verify that an evaluation is meaningful.
Function notation names input-output evaluation. Composition \((f\circ g)(x)=f(g(x))\) works from the inside outward, is associative, and is generally not commutative. Composite domains must be checked at every stage.
The same ideas operate in formulas, equations, systems, recursive sequences, vectors, matrices, transformations, and algorithms. Show the replacement, evaluate carefully, and verify against the original rule.
Check Your Understanding
Evaluate \(x^2-3x+2\) at \(x=-2\).
\((-2)^2-3(-2)+2=4+6+2=12\).
If \(f(x)=2x^2+1\), find \(f(a-1)\).
\(f(a-1)=2(a-1)^2+1=2a^2-4a+3\).
Evaluate \(F(x,y)=3x-y^2\) at \((2,-4)\).
\(F(2,-4)=3(2)-(-4)^2=6-16=-10\).
For \(f(x)=x-3\) and \(g(x)=2x\), find \((f\circ g)(x)\).
\((f\circ g)(x)=f(2x)=2x-3\).
Using the same functions, find \((g\circ f)(x)\).
\((g\circ f)(x)=g(x-3)=2(x-3)=2x-6\).
Find the domain of \(h(x)=\sqrt{5-x}\).
Require \(5-x\ge0\), so \(x\le5\).
Check whether \(x=3\) solves \(x^2+x=12\).
Substitute: \(3^2+3=9+3=12\). Yes, \(x=3\) is a solution.
If \(a_1=2\) and \(a_n=3a_{n-1}-1\), find \(a_2\) and \(a_3\).
\(a_2=3(2)-1=5\), and \(a_3=3(5)-1=14\).
Why is substituting \(x=2\) into \(1/(x-2)\) invalid?
It produces denominator zero, so \(2\) is outside the expression’s domain.
What is \((f\circ I)(x)\) when \(I(x)=x\)?
\((f\circ I)(x)=f(I(x))=f(x)\). The identity function leaves \(f\) unchanged under composition.