Functions, Relations & Transformations

Study Sheet

Functions, Relations & Transformations

Everything you need for Topic 2, with worked examples and graphs

Relations, Functions & the Vertical Line Test

Concept
Big idea

A relation is any set of ordered pairs (x,y)(x,y). A function is a special relation in which every input xx is paired with exactly one output yy. In other words: no xx-value is allowed to repeat with two different yy-values.

  • [leftmargin=*]
  • The set of all allowed inputs is the domain.
  • The set of all resulting outputs is the range.
Example
Example: is it a function?

Consider R={(2,3),(0,1),(1,4),(0,5)}R=\{(-2,3),(0,1),(1,4),(0,5)\}.

The input 00 appears twice, paired with both 11 and 55. Since one input gives two outputs, RR is not a function.

Now S={(2,3),(0,1),(1,4),(3,1)}S=\{(-2,3),(0,1),(1,4),(3,1)\} is a function: every input is used once. (It is fine for two inputs to share an output, as 00 and 33 both give 11.)

Concept
The Vertical Line Test

A graph represents a function if and only if no vertical line crosses it more than once. A vertical line is a set of points with the same xx; hitting the graph twice would mean one xx has two yy's.

Tip

Tip: The dashed vertical line on the right hits the sideways parabola twice, so that curve fails the test. A tilted straight line always passes.

Function Notation, Evaluating, Discrete vs. Continuous

Concept
Function notation

We write f(x)f(x) (read “ff of xx”) for the output of function ff at input xx. The letter xx is a placeholder: to evaluate, substitute the given value everywhere xx appears and simplify.

Example
Example: evaluating

Let f(x)=2x23x+1f(x)=2x^2-3x+1. Then

f(3)=2(3)23(3)+1=189+1=10,f(1)=2(1)23(1)+1=2+3+1=6.f(3)=2(3)^2-3(3)+1=18-9+1=10,\qquad f(-1)=2(-1)^2-3(-1)+1=2+3+1=6.

You can also evaluate at an expression: f(a+1)=2(a+1)23(a+1)+1=2a2+af(a+1)=2(a+1)^2-3(a+1)+1=2a^2+a.

Concept
Discrete vs. continuous

A discrete function is defined only at separated points (draw dots), e.g. “number of students” vs. “number of pizzas.” A continuous function is defined on an unbroken interval (draw a solid curve), e.g. “temperature” vs. “time.”

Tip

Tip: f(x)f(x) does not mean ff times xx. It is a single output value.

Parent Functions and Their Graphs

Concept
The six parents

Each family of functions is built from a simple “parent.” Memorize their shapes, domains, and ranges.

1.3

% Linear and quadratic

% Cubic and absolute value

% Square root and reciprocal

Tip

Tip: y=x2y=x^2 and y=xy=|x| both open upward with a minimum at the origin, but the parabola is curved while the absolute value is two straight rays meeting in a sharp corner.

Transformations: y=af(xh)+ky=a\,f(x-h)+k

Concept
Reading the transformation

Starting from a parent f(x)f(x), the graph of y=af(xh)+ky=a\,f(x-h)+k is transformed as follows:

  • [leftmargin=*]
  • kk: vertical shift --- up if k>0k>0, down if k<0k<0.
  • hh: horizontal shift --- right if h>0h>0, left if h<0h<0 (it moves opposite the sign inside).
  • aa: vertical stretch if a>1|a|>1, vertical compression if 0<a<10<|a|<1.
  • a<0a<0: reflection over the xx-axis. Replacing xx with x-x reflects over the yy-axis.
Example
Example: describe the transformation

Compare g(x)=2(x1)2+3g(x)=-2(x-1)^2+3 to the parent f(x)=x2f(x)=x^2. Here a=2a=-2, h=1h=1, k=3k=3, so gg is the parabola stretched vertically by 22, reflected over the xx-axis, shifted right 11 and up 33. Its vertex is (1,3)(1,3) and it opens downward.

Tip

Tip (order of operations for graphs): apply horizontal shift and stretch/reflection first, then the vertical shift last. The vertex of y=a(xh)2+ky=a(x-h)^2+k is always (h,k)(h,k).

Operations on Functions

Concept
Combining functions

For two functions ff and gg:

(f+g)(x)=f(x)+g(x),(fg)(x)=f(x)g(x),(f+g)(x)=f(x)+g(x),\quad (f-g)(x)=f(x)-g(x),
(fg)(x)=f(x)g(x),(fg)(x)=f(x)g(x)  (g(x)0).(fg)(x)=f(x)\cdot g(x),\quad \left(\tfrac{f}{g}\right)(x)=\frac{f(x)}{g(x)}\ \ (g(x)\ne 0).

The domain of the result is where both pieces are defined, and for the quotient we also exclude any xx with g(x)=0g(x)=0.

Example
Example

Let f(x)=x2+1f(x)=x^2+1 and g(x)=x2g(x)=x-2. Then

(f+g)(x)=x2+x1,(fg)(x)=(x2+1)(x2)=x32x2+x2,(f+g)(x)=x^2+x-1,\qquad (fg)(x)=(x^2+1)(x-2)=x^3-2x^2+x-2,
(fg)(x)=x2+1x2  (x2).\left(\tfrac{f}{g}\right)(x)=\frac{x^2+1}{x-2}\ \ (x\ne 2).
Tip

Tip: Operations happen at the same input. Only the quotient forces you to worry about a zero denominator.

Composition of Functions

Concept
Composition

The composition (fg)(x)=f(g(x))(f\circ g)(x)=f\bigl(g(x)\bigr) means: run gg first, then feed its output into ff. Composition is usually not commutative: (fg)(x)(gf)(x)(f\circ g)(x)\ne (g\circ f)(x) in general.

Example
Example

Let f(x)=x2+1f(x)=x^2+1 and g(x)=x2g(x)=x-2.

(fg)(x)=f(x2)=(x2)2+1=x24x+5,(f\circ g)(x)=f(x-2)=(x-2)^2+1=x^2-4x+5,
(gf)(x)=g(x2+1)=(x2+1)2=x21.(g\circ f)(x)=g(x^2+1)=(x^2+1)-2=x^2-1.

And numerically (fg)(5)=f(3)=10(f\circ g)(5)=f(3)=10.

Tip

Tip: Work from the inside out. Substitute the whole expression for g(x)g(x) into every xx of ff.

Inverse Functions

Concept
What an inverse does

The inverse f1f^{-1} undoes ff: it swaps inputs and outputs, so if f(a)=bf(a)=b then f1(b)=af^{-1}(b)=a. To find it: replace f(x)f(x) with yy, swap xx and yy, then solve for yy.

Example
Example: find and verify

Let f(x)=2x6f(x)=2x-6. Swap and solve: x=2y6y=x+62x=2y-6\Rightarrow y=\dfrac{x+6}{2}, so f1(x)=x+62f^{-1}(x)=\dfrac{x+6}{2}.

Verify by composition:

f(f1(x))=2 ⁣(x+62)6=x,f1(f(x))=(2x6)+62=x. f\bigl(f^{-1}(x)\bigr)=2\!\left(\tfrac{x+6}{2}\right)-6=x,\qquad f^{-1}\bigl(f(x)\bigr)=\tfrac{(2x-6)+6}{2}=x.\ \checkmark

Both compositions give xx, confirming the inverse.

Tip

Tip: The graph of f1f^{-1} is the mirror image of ff across the line y=xy=x. If ff passes the vertical line test and its inverse must too, ff must be one-to-one (pass the horizontal line test).

Piecewise Functions

Concept
Reading a piecewise rule

A piecewise function uses different formulas on different parts of the domain. To evaluate, first decide which interval the input falls in, then use that piece.

f(x)={x+3,x<0x2,0x24,x>2f(x)=\begin{cases} x+3, & x<0\\ x^2, & 0\le x\le 2\\ 4, & x>2\end{cases}
Example
Example: evaluate the piecewise function above
f(4)=4+3=1  (use x+3),f(1)=12=1  (use x2),f(5)=4  (use the constant).f(-4)=-4+3=-1\ \ (\text{use }x+3),\quad f(1)=1^2=1\ \ (\text{use }x^2),\quad f(5)=4\ \ (\text{use the constant}).

Watch the endpoints: at x=0x=0 we use x2x^2 because that piece includes 00 (0x0\le x).

Tip

Tip: A filled dot means the endpoint is included (\le or \ge); an open dot means it is not (<< or >>). Only one piece may own each xx.

Going Deeper: Advanced Function Ideas

Concept
Functional equations: solve for the rule, not a number
2

A functional equation constrains an unknown function ff instead of an unknown number. The classic trick: substitute a cleverly chosen input to generate a second equation, then treat f(x)f(x) and f(other)f(\text{other}) as two unknowns and eliminate. For equations mixing f(x)f(x) with f(1/x)f(1/x), the magic substitution is x1/xx\mapsto 1/x, which swaps the two terms.

Amplitude is the height; period is one full cycle.

Example
Worked example: solve f(x)+2f(1/x)=3xf(x)+2f(1/x)=3x

Write the given equation, then replace every xx with 1/x1/x (note 1/(1/x)=x1/(1/x)=x):

f(x)+2f ⁣(1x)=3x,(1)f ⁣(1x)+2f(x)=3x.(2)\begin{aligned} f(x)+2f\!\left(\tfrac1x\right) &= 3x, &&\text{(1)}\\ f\!\left(\tfrac1x\right)+2f(x) &= \tfrac{3}{x}. &&\text{(2)} \end{aligned}

Now eliminate f(1/x)f(1/x): multiply (2) by 22 and subtract (1):

(2f(1x)+4f(x))(f(x)+2f(1x))=6x3x    3f(x)=6x3x.\bigl(2f(\tfrac1x)+4f(x)\bigr)-\bigl(f(x)+2f(\tfrac1x)\bigr)=\tfrac{6}{x}-3x \;\Longrightarrow\; 3f(x)=\tfrac{6}{x}-3x.

So f(x)=2xxf(x)=\dfrac{2}{x}-x. Check: f(x)+2f(1/x)=(2xx)+2(2x1x)=2xx+4x2x=3x.f(x)+2f(1/x)=\left(\tfrac2x-x\right)+2\left(2x-\tfrac1x\right)=\tfrac2x-x+4x-\tfrac2x=3x.

Concept
Iterated composition and involutions

Composing ff with itself is written f[n]=fffn copiesf^{[n]}=\underbrace{f\circ f\circ\cdots\circ f}_{n\text{ copies}}, so f[2](x)=f(f(x))f^{[2]}(x)=f(f(x)). Beware: this is iteration, not the power (f(x))n\bigl(f(x)\bigr)^n and not the inverse f1f^{-1}.

  • [leftmargin=*]
  • If f[n]=idf^{[n]}=\mathrm{id} (the identity xxx\mapsto x) for some nn, then ff is periodic under iteration with period dividing nn, and f[m]f^{[m]} depends only on mmodnm \bmod n.
  • An involution is the special case n=2n=2: f(f(x))=xf(f(x))=x, so ff is its own inverse, f1=ff^{-1}=f. Its graph is symmetric across y=xy=x.
Example
Worked example: a period-3 map and a self-inverse map

(a) Iteration. Let f(x)=11xf(x)=\dfrac{1}{1-x}. Then

f[2](x)=f ⁣(11x)=1111x=1xx=x1x,f[3](x)=f ⁣(x1x)=11x1x=x.f^{[2]}(x)=f\!\left(\tfrac{1}{1-x}\right)=\frac{1}{1-\frac{1}{1-x}}=\frac{1-x}{-x}=\frac{x-1}{x}, \qquad f^{[3]}(x)=f\!\left(\tfrac{x-1}{x}\right)=\frac{1}{1-\frac{x-1}{x}}=x.

So f[3]=idf^{[3]}=\mathrm{id}: the map has period 33. To find f[100]f^{[100]}, reduce the exponent: 1001(mod3)100\equiv 1\pmod 3, hence f[100]=f[1]=ff^{[100]}=f^{[1]}=f.

(b) Involution. Let g(x)=2x3x2g(x)=\dfrac{2x-3}{x-2}. Composing gg with itself,

g(g(x))=22x3x232x3x22=xx21x2=x,g(g(x))=\frac{2\cdot\frac{2x-3}{x-2}-3}{\frac{2x-3}{x-2}-2} =\frac{\frac{x}{x-2}}{\frac{1}{x-2}}=x,

so gg is an involution: g1=gg^{-1}=g. Any g(x)=ax+bcxag(x)=\dfrac{ax+b}{cx-a} is self-inverse for the same reason.

Example
Worked example: the domain of a nasty composition

Let f(x)=1x1f(x)=\dfrac{1}{x-1} and g(x)=4x2g(x)=\sqrt{4-x^2}, and form h(x)=(fg)(x)=14x21h(x)=(f\circ g)(x)=\dfrac{1}{\sqrt{4-x^2}-1}. The domain needs two conditions, checked in order:

  • [leftmargin=*]
  • xx must be legal for the inner gg:   4x202x2\;4-x^2\ge 0\Rightarrow -2\le x\le 2.
  • The output g(x)g(x) must be legal for the outer ff, i.e. g(x)1g(x)\ne 1:   4x214x21x±3\;\sqrt{4-x^2}\ne 1\Rightarrow 4-x^2\ne 1\Rightarrow x\ne\pm\sqrt{3}.

Domain: [2,2][-2,2] with the two holes x=±3x=\pm\sqrt{3} removed. Moral: the domain of fgf\circ g is not just the domain of gg; you must also delete inputs whose output lands in a forbidden spot for ff.

Concept
Invertibility via monotonicity

A function is invertible exactly when it is one-to-one (passes the horizontal line test). You do not need an explicit formula for f1f^{-1} to know it exists:

If ff is strictly increasing on its domain (or strictly decreasing), then ff is one-to-one, so f1f^{-1} exists.

For example, f(x)=x5+x+1f(x)=x^5+x+1 is a sum of the strictly increasing pieces x5x^5, xx, and a constant, so it is strictly increasing and therefore invertible on all of R\mathbb{R} --- even though solving y=x5+x+1y=x^5+x+1 for xx by hand is hopeless. Monotonicity is also how you restrict a non-injective parent (like y=x2y=x^2) to make it invertible: choose a branch, e.g. x0x\ge 0.

Concept
Exploiting even and odd symmetry

A function is even if f(x)=f(x)f(-x)=f(x) (graph symmetric across the yy-axis) and odd if f(x)=f(x)f(-x)=-f(x) (symmetric through the origin). Symmetry halves your work: knowing ff on x0x\ge 0 determines it everywhere. Two facts worth memorizing:

  • [leftmargin=*]
  • Products behave like parity signs: even×even=even\text{even}\times\text{even}=\text{even}, odd×odd=even\text{odd}\times\text{odd}=\text{even}, even×odd=odd\text{even}\times\text{odd}=\text{odd}.
  • Every function splits uniquely into an even part plus an odd part: @@BLOCK0@@
Tip

Tip: If ff is odd then f(0)=0f(0)=0 (set x=0x=0 in f(x)=f(x)f(-x)=-f(x)). And if a problem asks for f(a)f(-a) and you already know f(a)f(a), don't recompute --- just flip the sign for odd, copy for even.

Example
Worked example: piecewise continuity with a parameter

Choose the constant aa so that

f(x)={x2+a,x13x1,x>1f(x)=\begin{cases} x^2+a, & x\le 1\\[2pt] 3x-1, & x>1\end{cases}

is continuous. Continuity at the seam x=1x=1 requires the two pieces to agree there. The left piece gives f(1)=12+a=1+af(1)=1^2+a=1+a; the right piece approaches 3(1)1=23(1)-1=2 as x1+x\to 1^{+}. Set them equal:

1+a=2    a=1.1+a=2\;\Longrightarrow\; a=1.

With a=1a=1 the graph joins with no jump. For any other aa there is a gap of height 1+a2=a1|1+a-2|=|a-1| at x=1x=1.

Concept
Composing several transformations into one mapping

A chain of transformations can always be collapsed into a single rule y=af(b(xh))+ky=a\,f\bigl(b(x-h)\bigr)+k. Track what happens to a generic point, applying inner (horizontal) changes to xx and outer (vertical) changes to the whole expression. Order matters, because a horizontal shift done before a horizontal stretch is not the same as after.

Example. Starting from ff, reflect over the yy-axis, then shift left 22, then stretch vertically by 33, then shift up 11. Building inside-out, the horizontal reflect-and-shift turns the input into (x+2)-(x+2), and the outer stretch-and-shift wraps it:

y=3f((x+2))+1.y=3\,f\bigl(-(x+2)\bigr)+1.

A single expression now encodes all four moves --- feed in one xx, get the fully transformed yy.

Formulas, Proofs & Tips

Tip
Function transformations
y=af(b(xh))+ky = a\,f\big(b(x-h)\big)+k

What it means. hh shifts right, kk shifts up, aa stretches vertically (flipping if negative), bb compresses horizontally.

Example. y=(x2)2+3y=(x-2)^2+3 shifts y=x2y=x^2 right 22 and up 33.

Why it works. Inside changes act on the input before ff does, so they run backwards: replacing xx by xhx-h means the graph reaches a given output hh units later, i.e. shifted right. Outside changes act after ff, so they behave as written.

Tip. Inside the function: opposite of what it looks like. Outside: exactly what it looks like.

Tip
Inverse functions
f(f1(x))=xandf1(f(x))=xf\big(f^{-1}(x)\big)=x \quad\text{and}\quad f^{-1}\big(f(x)\big)=x

What it means. The inverse undoes the function; their graphs are mirror images across y=xy=x.

Example. f(x)=2x+1f(x)=2x+1 has inverse f1(x)=x12f^{-1}(x)=\tfrac{x-1}{2}, and f(f1(x))=xf(f^{-1}(x))=x.

Why it works. Swapping xx and yy in y=f(x)y=f(x) and solving for yy produces the rule that reverses each input–output pair. Reflecting across y=xy=x is exactly what swapping coordinates does geometrically.

Tip. Only one-to-one functions have inverses. If a horizontal line hits the graph twice, restrict the domain first.