Curriculum / Mathematics · Calculus I · Free sample
Transformations, Compositions, and Building New Functions
Shift, scale, and compose functions — from familiar graphs to the building blocks of financial models.
What this note is about
Pricing a barrier option, seasonally adjusting a commodity price, or applying an activation function in a neural network all involve taking a familiar function and modifying it — shifting its graph, scaling its values, or feeding one function's output into another. This note makes those operations precise. Three mechanisms are covered: graph transformations (shifting, stretching, reflecting), arithmetic combinations (sums, products, quotients), and the composition operator. Knowing how to read a composed function apart — identifying the outer function and the inner function — is the indispensable prerequisite for the chain rule.
Learning objectives. By the end of this note you should be able to:
apply the six canonical graph transformations to sketch y=cf(x−a)+b from a known graph of y=f(x);
determine the domains of sums, products, quotients, and compositions of two functions;
decompose a given function into outer and inner parts and name both;
identify when absolute-value wrapping reflects a function's graph.
Graph transformations
Given the graph of y=f(x), seven canonical transformations produce related graphs. Divide them into two groups.
Translations (shifts)
Proposition 1 (Vertical and horizontal shifts). Let c>0.
Transformed function
Effect on graph
y=f(x)+c
shift up by c
y=f(x)−c
shift down by c
y=f(x−c)
shift right by c
y=f(x+c)
shift left by c
Intuition. To shift the graph right by c, you must replace x with x−c in the formula. That is, to achieve the same y-value, the new x must be c units further to the right. The sign is opposite to the direction of shift — this is the most common sign error in transformations.
Example 1 (Shifted parabola). Given y=x2, express y=x2+6x+10 in terms of a shift.
Complete the square: x2+6x+10=(x+3)2+1. This is y=x2 shifted 3 units left and 1 unit up. The vertex moves from (0,0) to (−3,1).
Graph of y = x² (grey, vertex at origin) and its shift y = (x+3)² + 1 (blue, vertex at (−3,1)), showing the 3-left, 1-up translation
Stretches and reflections
Proposition 2 (Vertical and horizontal stretching/reflecting). Let c>1.
Transformed function
Effect
y=cf(x)
stretch vertically by factor c
y=(1/c)f(x)
compress vertically by factor c
y=f(cx)
compress horizontally by factor c
y=f(x/c)
stretch horizontally by factor c
y=−f(x)
reflect about the x-axis
y=f(−x)
reflect about the y-axis
Financial interpretation. A log-return distribution p(x) can be rescaled to any volatility σ by the horizontal stretch p(x/σ)/σ — the standard-deviation rescaling that converts a unit-normal density to a N(0,σ2) density. This is precisely the role of the 1/σ Jacobian in a change-of-variables density computation.
Example 2 (Daylight model). Philadelphia's daylight hours as a function of day-of-year t follow approximately L(t)=12+2.8sin(3652π(t−80)). Starting from y=sint: stretch vertically by 2.8, stretch horizontally by 365/(2π) (period 365 days instead of 2π), shift right by 80 days, then shift up by 12. Each transformation has a direct physical meaning: amplitude controls the day-length swing; the horizontal stretch controls the annual period; the right-shift places the minimum on December 21 (day 80 before the vernal equinox).
Graph of L(t) = 12 + 2.8 sin((2π/365)(t − 80)) over one year, oscillating between about 9.2 and 14.8 hours with the shifted, stretched sine shape
Absolute value as a reflection
If y=∣f(x)∣, the part of the graph of f that lies below the x-axis gets reflected above it. The part above stays put.
Example 3. To graph y=∣x2−1∣: first draw y=x2−1 (parabola, vertex (0,−1), zeros at ±1). The segment between x=−1 and x=1 dips below the axis; reflect it up. The result is a "W" shape with vertex at (0,1) and zeros at ±1.
Graph of y = x² − 1 (grey, dipping to −1 between the zeros) and y = |x² − 1| (blue), showing the below-axis segment reflected upward into a "W" shape
Arithmetic combinations
Given functions f and g with domains A and B:
Definition 1 (Arithmetic combinations). On the intersection A∩B:
The domain of f+g, f−g, and fg is A∩B. The domain of f/g is A∩B with all points where g=0 removed.
Example 4 (Domain of a combination). Let f(x)=x (domain [0,∞)) and g(x)=2−x (domain (−∞,2]). Then:
(f+g)(x)=x+2−x, domain [0,2].
(f/g)(x)=x/2−x, domain [0,2) (exclude x=2 where g=0).
Composition
The most important way to build new functions is by feeding one into another.
Definition 2 (Composition). The composite of f after g is
(f∘g)(x)=f(g(x))
Domain of f∘g: all x in the domain of g such that g(x) is in the domain of f.
Symbol by symbol: g acts first (the inner function), producing an intermediate value u=g(x); then f acts on that value (the outer function), producing the final output f(u).
Composition flow diagram: input x passes through inner function g to produce g(x), then through outer function f to produce f(g(x)) = (f ∘ g)(x)
Example 5 (Identifying inner and outer). Let h(x)=x2+1.
Inner function: g(x)=x2+1. Outer function: f(u)=u. Then h=f∘g since f(g(x))=x2+1. Domain: all x (since x2+1≥1>0 for all real x).
Remark 1 (Order matters). Composition is not commutative. In general f∘g=g∘f. For f(x)=x and g(x)=x+1:
Different functions with different domains. Never write f∘g=g∘f without checking.
Example 6 (Decomposing a finance function). The Black-Scholes d1 formula contains the term ln(S/K)/(sigmaT). Identify the compositional structure.
Let h=ln(S/K). This is h=ln∘(⋅/K): first divide by K (inner), then take the natural log (outer). The whole fraction d1=[ln(S/K)+(r+σ2/2)T]/(σT) is a linear function of ln(S/K) — a composition of the logarithm with the ratio S/K and then a linear scaling. Recognising this structure is what allows you to differentiate d1 with respect to S, σ, or T via the chain rule.
Remark 2 (Decomposition is not unique). Most composed functions can be decomposed in more than one way. For h(x)=(x2+1)10, valid choices include: outer f(u)=u10, inner g(x)=x2+1; or outer f(u)=(u+1)10, inner g(x)=x2. The convention for the chain rule is to use the most natural outer/inner split — usually the one that reveals the most structure in the expression.
Even and odd functions
Definition 3. A function f is even if f(−x)=f(x) for all x in its domain (graph symmetric about the y-axis). It is odd if f(−x)=−f(x) for all x (graph symmetric about the origin).
Most functions are neither even nor odd. Polynomials with only even powers are even; polynomials with only odd powers are odd.
Financial connection. Payoff distributions for straddles are symmetric about the current spot — an even payoff around K. Skewed payoffs (risk reversals, digital puts vs calls) are explicitly odd-symmetric perturbations of a symmetric base.
The Chain Rule: the differentiation rule for compositions; every application in finance — Greeks of composed payoffs, sensitivity of log-prices — reduces to this.
Exercise 1. Starting from the graph of y=x, describe in order the transformations needed to obtain y=−2x−3+1. State the domain and range of the result.
Solution. Apply in sequence to y=x:
Replace x with x−3: shift right 3 → y=x−3, domain [3,∞).
Multiply by 2: stretch vertically by 2 → y=2x−3, range [0,∞).
Multiply by −1: reflect about the x-axis → y=−2x−3, range (−∞,0].
Add 1: shift up 1 → y=−2x−3+1, range (−∞,1].
Domain: [3,∞); range: (−∞,1]. ■
Exercise 2. Find the domain of h(x)=x2−9x−1.
Solution. Write h=f/g where f(x)=x−1 (domain [1,∞)) and g(x)=x2−9 (domain R). The domain of h is (A∩B)∖{g=0}.
g(x)=0⇔x=±3. On [1,∞), the point x=−3 is already excluded; x=3 must be removed.
Domain: [1,3)∪(3,∞). ■
Exercise 3. Let f(x)=x1 and g(x)=x2−1.
(a) Find f∘g and its domain.
(b) Find g∘f and its domain.
(c) Show f∘g=g∘f.
Solution. (a) (f∘g)(x)=f(g(x))=1/(x2−1). Domain: R∖{±1} (exclude where g=0, i.e. x=±1).
(b) (g∘f)(x)=g(f(x))=(1/x)2−1=1/x2−1. Domain: R∖{0} (exclude x=0 where f is undefined).
(c) Take x=2: (f∘g)(2)=1/(4−1)=1/3; (g∘f)(2)=1/4−1=−3/4. Different values, confirming f∘g=g∘f. ■
Exercise 4 (Decomposition — finance application). A risk system computes a position's dollar Greeks by the formula
Dollar Delta=Δ⋅S
where Δ=N(d1) (the option delta, a function of the log-moneyness m=ln(S/K)) and S is the current spot price. Express the dollar delta as a composed function and identify the outer and inner functions when the independent variable is S.
Solution. Write the dollar delta as H(S)=N(d1(S))⋅S. This is a product of two functions, not a composition; but each factor involves composition:
d1(S)=[ln(S/K)+(r+σ2/2)T]/(σT): outer is the affine map u↦(u+c1)/c2 (where c1,c2 are constants), inner is ln(⋅/K) — itself the logarithm composed with the scaling S↦S/K.
N(d1(S)): outer is the standard normal CDF N, inner is d1(S).
Dollar delta =N(d1(S))⋅S is the product of the two composed functions. To differentiate with respect to S later, the chain rule is applied to each factor. Identifying the composition structure here is precisely what lets us read off the option gamma as ∂Δ/∂S=n(d1)/(SσT), where n=N′ is the standard normal density. ■
This is a sample from the full curriculum. Members get every lesson, exercise solution and project.