Skip to content

Unit 3: Functions

AP Precalc cheatsheet

Open ↗

Loading…


A function assigns each input exactly one output. If ff is a function and xx is an input, then f(x)f(x) is the output.

The domain is the set of all allowed inputs. The range is the set of all outputs the function actually produces.

For example,

f(x)=x2+4x=x(x+4)f(x)=x^2+4x=x(x+4)

has domain (−∞,∞)(-\infty,\infty) because every real number can be substituted. To find the range, complete the square:

f(x)=x2+4x=(x+2)2−4.f(x)=x^2+4x=(x+2)^2-4.

Since (x+2)2≥0(x+2)^2\ge 0, the smallest possible value is −4-4. Therefore,

range=[−4,∞).\text{range}=[-4,\infty).

Most domain work comes from asking what operations are legal.

  • Denominators cannot be 00.
  • Even roots (e.g. square roots) require the inside expression to be nonnegative.
  • Logarithms require the input to be positive.
  • Contextual functions like parametrics may have extra restrictions, such as time t≥0t\ge 0 or length x>0x>0.

Always keep track of domain restrictions, and the legal domain is everything that is not part of the domain restriction.


The range is often harder than the domain because it asks what output values are possible.

Example. Find the domain and range of

g(x)=x2+4xx+2.g(x)=\frac{\sqrt{x^2+4x}}{x+2}.

For the domain, first use the square-root restriction:

x2+4x≥0.x^2+4x\ge 0.

Factor:

x(x+4)≥0.x(x+4)\ge 0.

Using a sign chart,

x≤−4orx≥0.x\le -4 \quad\text{or}\quad x\ge 0.

The denominator also cannot be 00, so x≠−2x\ne -2. But x=−2x=-2 is not in the radical domain anyway, so it does not change the answer:

domain=(−∞,−4]∪[0,∞).\text{domain}=(-\infty,-4]\cup[0,\infty).

For the range, rewrite the expression inside the radical by completing the square:

x2+4x=(x+2)2−4.x^2+4x=(x+2)^2-4.

So

g(x)=(x+2)2−4x+2.g(x)=\frac{\sqrt{(x+2)^2-4}}{x+2}.

Let y=g(x)y=g(x). Then

y=(x+2)2−4x+2.y=\frac{\sqrt{(x+2)^2-4}}{x+2}.

Square both sides:

y2=(x+2)2−4(x+2)2=1−4(x+2)2.y^2 =\frac{(x+2)^2-4}{(x+2)^2} =1-\frac{4}{(x+2)^2}.

From the domain, x≤−4x\le -4 or x≥0x\ge 0, so

∣x+2∣≥2.\lvert x+2\rvert\ge 2.

That means

0≤4(x+2)2≤1,0\le \frac{4}{(x+2)^2}\le 1,

so

0≤y2<1.0\le y^2<1.

Therefore −1<y<1-1<y<1. The value y=0y=0 occurs at x=−4x=-4 and x=0x=0, while y=1y=1 and y=−1y=-1 are approached but never reached. Therefore,

range=(−1,1).range=(-1,1).

A graph represents a function exactly when each xx-value has at most one yy-value. This is tested with the vertical line test.

If any vertical line intersects the graph more than once, the graph is not a function. A circle, for example, is not the graph of yy as a function of xx because many vertical lines hit it twice.

Six parent functions are especially useful to recognize:

  • y=∣x∣y= \lvert x \rvert: absolute value, V-shaped.
  • y=x2y = x^2: quadratic, a parabola opening upward.
  • y=x3y = x^3: cubic, increasing through the origin, kind of doing a wiggly motion.
  • y=1xy=\frac{1}{x}: reciprocal, a rotated hyperbola with asymptotes x=0x=0 and y=0y=0.
  • y=xy=\sqrt{x}: square-root curve, starting at (0,0)(0,0) and moving right.

Knowing these shapes helps you sketch the transformed functions covered later. The chart below includes exponential, logarithmic, and trig functions, which also appear in later units.

LinearxQuadraticx2Cubicx3Absolutejxj
Reciprocal1=xExponentialexLogarithmiclnxSquarerootpx
SinesinxCosinecosxTangenttanx

A piecewise function uses different formulas on different parts of its domain. The rule depends on which interval contains the input.

For example,

f(x)={1x,x>2,12x2,x≤2.f(x)= \begin{cases} \dfrac{1}{x}, & x>2,\\[4pt] \dfrac{1}{2}x^2, & x\le 2. \end{cases}

To graph it, graph each formula only on the part of the domain where it applies. Endpoints matter:

  • use a closed dot when the endpoint is included,
  • use an open dot when the endpoint is not included.

At x=2x=2, the second rule applies because x≤2x\le 2. Therefore,

f(2)=12(2)2=2.f(2)=\frac{1}{2}(2)^2=2.

The reciprocal rule would approach 1/21/2 near x=2x=2 from the right, but it does not include x=2x=2.


Some equations describe relationships between xx and yy without directly solving for yy. These are called implicit equations. For example,

x2+y2=1x^2+y^2=1

describes a circle, not a function of xx, because many xx-values have two possible yy-values.

Sometimes an implicit equation can be solved for yy, but it may produce multiple branches. If solving gives

y=±1−x2,y=\pm\sqrt{1-x^2},

then the plus branch is the top half of the circle and the minus branch is the bottom half. Each branch is a function, but the whole circle is not.

When an equation is complicated but quadratic in yy, it can sometimes be rearranged into

ay2+by+c=0,ay^2+by+c=0,

where aa, bb, and cc may contain xx. Then the quadratic formula gives

y=−b±b2−4ac2a.y=\frac{-b\pm\sqrt{b^2-4ac}}{2a}.

The ±\pm is a warning that the relation may split into two separate function branches.

Example. Find the explicit forms for the relation

(x2+y2)2−8x(x2−3y2)+18(x2+y2)=27.(x^2+y^2)^2-8x(x^2-3y^2)+18(x^2+y^2)=27.

This looks intimidating, but the trick is to notice that only even powers of yy appear. Let

u=y2.u=y^2.

Then rewrite the equation in terms of uu:

(x2+u)2−8x(x2−3u)+18(x2+u)=27.(x^2+u)^2-8x(x^2-3u)+18(x^2+u)=27.

Expand and collect powers of uu:

u2+(2x2+24x+18)u+x4−8x3+18x2−27=0.u^2+(2x^2+24x+18)u+x^4-8x^3+18x^2-27=0.

Now this is quadratic in uu. Its discriminant simplifies nicely:

(2x2+24x+18)2−4(x4−8x3+18x2−27)=16(2x+3)3.(2x^2+24x+18)^2-4(x^4-8x^3+18x^2-27)=16(2x+3)^3.

Using the quadratic formula,

u=−(x2+12x+9)±2(2x+3)3.u=-(x^2+12x+9)\pm 2\sqrt{(2x+3)^3}.

Since u=y2u=y^2,

y2=−(x2+12x+9)±2(2x+3)3.y^2=-(x^2+12x+9)\pm 2\sqrt{(2x+3)^3}.

Finally, take the square root of both sides. This gives four possible explicit branches:

y=−(x2+12x+9)+2(2x+3)3,y=\sqrt{-(x^2+12x+9)+2\sqrt{(2x+3)^3}}, y=−−(x2+12x+9)+2(2x+3)3,y=-\sqrt{-(x^2+12x+9)+2\sqrt{(2x+3)^3}}, y=−(x2+12x+9)−2(2x+3)3,y=\sqrt{-(x^2+12x+9)-2\sqrt{(2x+3)^3}}, y=−−(x2+12x+9)−2(2x+3)3.y=-\sqrt{-(x^2+12x+9)-2\sqrt{(2x+3)^3}}.

The first two branches come from

−(x2+12x+9)+2(2x+3)3≥0,-(x^2+12x+9)+2\sqrt{(2x+3)^3}\ge 0,

which gives

−32≤x≤3.-\frac{3}{2}\le x\le 3.

The last two branches come from

−(x2+12x+9)−2(2x+3)3≥0,-(x^2+12x+9)-2\sqrt{(2x+3)^3}\ge 0,

which gives

−32≤x≤−1.-\frac{3}{2}\le x\le -1.

So the original relation is not one function of xx. It is made from multiple explicit branches, with the outer ±\pm giving the top and bottom halves.


The average rate of change of ff on [a,b][a,b] is the slope of the secant line through (a,f(a))(a,f(a)) and (b,f(b))(b,f(b)):

ΔyΔx=f(b)−f(a)b−a.\frac{\Delta y}{\Delta x} =\frac{f(b)-f(a)}{b-a}.

If the interval is written as [x,x+h][x,x+h], then the same idea becomes the difference quotient:

f(x+h)−f(x)h.\frac{f(x+h)-f(x)}{h}.

This measures the average rate of change from xx to x+hx+h.

Example. Let

f(x)=2x2−x+1.f(x)=2x^2-x+1.

Find the average rate of change from aa to xx:

f(x)−f(a)x−a=(2x2−x+1)−(2a2−a+1)x−a.\frac{f(x)-f(a)}{x-a} =\frac{(2x^2-x+1)-(2a^2-a+1)}{x-a}.

Simplify the numerator:

2x2−x+1−2a2+a−1=2(x2−a2)−(x−a).2x^2-x+1-2a^2+a-1 =2(x^2-a^2)-(x-a).

Factor:

2(x−a)(x+a)−(x−a)=(x−a)(2x+2a−1).2(x-a)(x+a)-(x-a) =(x-a)(2x+2a-1).

So

f(x)−f(a)x−a=2x+2a−1,x≠a.\frac{f(x)-f(a)}{x-a}=2x+2a-1,\qquad x\ne a.

For the difference quotient of the same function,

f(x+h)−f(x)h=2(x+h)2−(x+h)+1−(2x2−x+1)h.\frac{f(x+h)-f(x)}{h} =\frac{2(x+h)^2-(x+h)+1-(2x^2-x+1)}{h}.

After expanding and canceling,

f(x+h)−f(x)h=4x+2h−1.\frac{f(x+h)-f(x)}{h} =4x+2h-1.

If hh becomes very small, this approaches 4x−14x-1, which equals to the functions derivative (a calculus topic).


Transformations move or change a graph while preserving the basic shape of the parent function.

If c>0c>0:

  • y=f(x)+cy=f(x)+c shifts the graph up cc units.
  • y=f(x)−cy=f(x)-c shifts the graph down cc units.
  • y=f(x+c)y=f(x+c) shifts the graph left cc units.
  • y=f(x−c)y=f(x-c) shifts the graph right cc units.
  • y=−f(x)y=-f(x) reflects the graph over the xx-axis.
  • y=f(−x)y=f(-x) reflects the graph over the yy-axis.

The input changes happen in the opposite direction from how they look. For example, f(x−3)f(x-3) shifts right 33 because the inside of the function reaches the old input value when xx is 33 larger.

For f(x)=∣x∣f(x)= \lvert x \rvert, the vertex form

y=a∣x−h∣+ky=a\lvert x-h\rvert+k

has vertex (h,k)(h,k).

  • a>0a>0 opens upward.
  • a<0a<0 opens downward.
  • Larger ∣a∣\lvert a \rvert makes the graph steeper.
  • Smaller ∣a∣\lvert a \rvert makes the graph wider.

For f(x)=x2f(x)=x^2, the vertex form

y=a(x−h)2+ky=a(x-h)^2+k

has vertex (h,k)(h,k) and axis of symmetry x=hx=h.

  • a>0a>0 opens upward.
  • a<0a<0 opens downward.
  • Larger ∣a∣\lvert a \rvert makes the parabola narrower.
  • Smaller ∣a∣\lvert a \rvert makes the parabola wider.

For

y=ax−h+k,y=a\sqrt{x-h}+k,

the starting point is (h,k)(h,k). The basic domain is x≥hx\ge h unless there is a reflection inside the radical. All transformations behave the same except it changes the domain/range of the radical.

For example,

f(x)=−x+3f(x)=\sqrt{-x+3}

requires

−x+3≥0⟹x≤3.-x+3\ge 0 \quad\Longrightarrow\quad x\le 3.

So the graph starts at (3,0)(3,0) and extends left.


Functions can be combined using arithmetic operations:

(f+g)(x)=f(x)+g(x)(f+g)(x)=f(x)+g(x) (f−g)(x)=f(x)−g(x)(f-g)(x)=f(x)-g(x) (fg)(x)=f(x)g(x)(fg)(x)=f(x)g(x) (fg)(x)=f(x)g(x),g(x)≠0.\left(\frac{f}{g}\right)(x)=\frac{f(x)}{g(x)},\qquad g(x)\ne 0.

The domain of a combined function is the intersection of the domains of the pieces, with any extra restrictions from the operation. For a quotient, the denominator must not be 00.

For example, if

f(x)=1x2−2,g(x)=x,h(x)=1x,f(x)=\frac{1}{x^2-2}, \qquad g(x)=\sqrt{x}, \qquad h(x)=\frac{1}{x},

then

domain of f:x≠±2,\text{domain of }f: x\ne \pm\sqrt{2}, domain of g:x≥0,\text{domain of }g: x\ge 0, domain of h:x≠0.\text{domain of }h: x\ne 0.

Any arithmetic combination must respect the restrictions from all functions involved.


The composition f∘gf\circ g means “apply gg first, then apply ff”:

(f∘g)(x)=f(g(x)).(f\circ g)(x)=f(g(x)).

Composition is not usually commutative, so f(g(x))f(g(x)) and g(f(x))g(f(x)) are usually different.

Example. Let

f(x)=1x2−2andg(x)=x.f(x)=\frac{1}{x^2-2} \qquad\text{and}\qquad g(x)=\sqrt{x}.

Then

(f∘g)(x)=f(x)=1(x)2−2=1x−2.(f\circ g)(x)=f(\sqrt{x}) =\frac{1}{(\sqrt{x})^2-2} =\frac{1}{x-2}.

The domain must satisfy both conditions:

  1. xx must be in the domain of gg, so x≥0x\ge 0.
  2. g(x)g(x) must be in the domain of ff, so (x)2−2≠0(\sqrt{x})^2-2\ne 0, meaning x≠2x\ne 2.

Therefore,

domain=[0,2)∪(2,∞).\text{domain}=[0,2)\cup(2,\infty).

For

(g∘f)(x)=g(f(x)),(g\circ f)(x)=g(f(x)),

the domain would be different because ff is the inside function and the output of ff must be allowed inside the square root.


Sometimes a complicated formula can be understood as one function inside another.

For example,

F(x)=(3x−2)2F(x)=(3x-2)^2

can be written as

F(x)=h(g(x)),F(x)=h(g(x)),

where

g(x)=3x−2andh(x)=x2.g(x)=3x-2 \qquad\text{and}\qquad h(x)=x^2.

Another valid decomposition is

g(x)=3xandh(x)=(x−2)2.g(x)=3x \qquad\text{and}\qquad h(x)=(x-2)^2.

There may be more than one correct way to express a function as a composition.


Two functions ff and gg are inverse functions if they undo each other:

f(g(x))=xf(g(x))=x

for every xx in the domain of gg, and

g(f(x))=xg(f(x))=x

for every xx in the domain of ff. BOTH conditions must be sastisfied!

For example, let

f(x)=3x−2andg(x)=13x+23.f(x)=3x-2 \qquad\text{and}\qquad g(x)=\frac{1}{3}x+\frac{2}{3}.

Then

f(g(x))=3(13x+23)−2=x+2−2=x,f(g(x))=3\left(\frac{1}{3}x+\frac{2}{3}\right)-2=x+2-2=x,

and

g(f(x))=13(3x−2)+23=x−23+23=x.g(f(x))=\frac{1}{3}(3x-2)+\frac{2}{3} =x-\frac{2}{3}+\frac{2}{3} =x.

So ff and gg are inverses.

Extension. Prove that the graph of f(x)f(x) and f−1(x)f^{-1}(x) are reflections of each other over the line y=xy=x.


It is very improtant to note that the domain of ff becomes the range of f−1f^{-1}, and the range of ff becomes the domain of f−1f^{-1}.

Example. Find the inverse of

f(x)=2x+13x−4.f(x)=\frac{2x+1}{3x-4}.

Start with

y=2x+13x−4.y=\frac{2x+1}{3x-4}.

Switch xx and yy:

x=2y+13y−4.x=\frac{2y+1}{3y-4}.

Solve for yy:

x(3y−4)=2y+1x(3y-4)=2y+1 3xy−4x=2y+13xy-4x=2y+1 3xy−2y=4x+13xy-2y=4x+1 y(3x−2)=4x+1y(3x-2)=4x+1 y=4x+13x−2.y=\frac{4x+1}{3x-2}.

Therefore,

f−1(x)=4x+13x−2.f^{-1}(x)=\frac{4x+1}{3x-2}.

Injective, Surjective, and Bijective Functions

Section titled “Injective, Surjective, and Bijective Functions”

A function has an inverse that is also a function only if the original function is one-to-one, also called injective.

A function is injective if different inputs always produce different outputs. Equivalently, every output that the function actually hits comes from exactly one input. In symbols,

f(a)=f(b)⟹a=b.f(a)=f(b)\quad\Longrightarrow\quad a=b.

Graphically, injective functions pass the horizontal line test: every horizontal line intersects the graph at most once.

A function is surjective, or onto, if every element of the target set is hit by the function. In other words, for every allowed output yy in the codomain, there is at least one input xx in the domain such that

f(x)=y.f(x)=y.

Surjectivity depends on the codomain you choose. For example,

f(x)=x2f(x)=x^2

is not surjective as a function from R\mathbb{R} to R\mathbb{R}, because negative outputs are never reached. But it is surjective as a function from R\mathbb{R} to [0,∞)[0,\infty).

A function is bijective if it is both injective and surjective. This means every output in the codomain is hit exactly once. Bijective functions have inverse functions that undo them perfectly on the stated domain and codomain.

For example,

y=x2y=x^2

is a function because it passes the vertical line test, but it is not injective on R\mathbb{R} because it fails the horizontal line test. Both x=2x=2 and x=−2x=-2 give the same output 44.

To make y=x2y=x^2 injective, restrict the domain. For example, on x≥0x\ge 0,

f(x)=x2f(x)=x^2

is injective. If we define it as a function from [0,∞)[0,\infty) to [0,∞)[0,\infty), then it is also surjective, so it is bijective. Its inverse is

f−1(x)=x.f^{-1}(x)=\sqrt{x}.

On x≤0x\le 0, its inverse would instead be

f−1(x)=−x.f^{-1}(x)=-\sqrt{x}.

Domain restrictions are how we choose one branch when a relation would otherwise give more than one output.

A quick map of bijectivity, surjectivity, and injectivity is shown below:

Injection(one-to-one)Surjection(onto)Bijection(one-to-oneandonto)

  1. Find the domain and range of f(x)=9−(x−2)2x−2f(x)=\frac{\sqrt{9-(x-2)^2}}{x-2}.
  1. Let f(x)={x2−4x+1,x<1,ax+b,1≤x<4,x+c,x≥4.f(x)=\begin{cases}x^2-4x+1, & x<1,\\ax+b, & 1\le x<4,\\\sqrt{x+c}, & x\ge 4.\end{cases}. Find aa, bb, and cc so that the pieces connect at x=1x=1 and x=4x=4, and so that the middle piece has average rate of change 33 on [1,4][1,4].
  1. Find the explicit form(s) for the relation (x2+y2)2=4(x2−y2)(x^2+y^2)^2=4(x^2-y^2).
  1. Find the explicit form(s) for the relation y2−2xy+x2=4x+4y^2-2xy+x^2=4x+4. State the domain of each branch.
  1. Let f(x)=(x−3)2+2f(x)=(x-3)^2+2 with domain x≥3x\ge 3. Find f−1(x)f^{-1}(x), and state the domain and range of f−1f^{-1}.
  1. Let f:[−2,∞)→[−4,∞)f:[-2,\infty)\to[-4,\infty) be defined by f(x)=(x+2)2−4f(x)=(x+2)^2-4. Determine whether ff is injective, surjective, bijective, or none.
  1. Simplify the difference quotient for f(x)=2x−1f(x)=\frac{2}{x-1}. That is, simplify f(x+h)−f(x)h.\frac{f(x+h)-f(x)}{h}.
  1. The graph of y=f(x)y=f(x) has domain [−4,6][-4,6] and range [−2,5][-2,5]. Find the domain and range of g(x)=−3f(x−2x+1)+7g(x)=-3f(\frac{x-2}{x+1})+7.
  1. Find f−1(3)f^{-1}(3) given that f(x)=3x+12x+f(x)f(x)=\frac{3x+1}{2x+f(x)}.
  1. Let h(x)=4−∣x−1∣.h(x)=\sqrt{4-\lvert x-1 \rvert}. Find the domain and range of hh, and describe the transformations from y=xy=\sqrt{x} as clearly as possible.
  1. Let f(x)=2x+5f(x)=\sqrt{2x+5} and g(x)=1x−3g(x)=\frac{1}{x-3}. Find formulas and domains for (f∘g)(x)(f\circ g)(x) and (g∘f)(x)(g\circ f)(x).
  1. Let f(x)=∣x−2∣+1f(x)=\lvert x-2\rvert+1. If the domain is restricted to [2,∞)[2,\infty) and the codomain is [1,∞)[1,\infty), determine whether ff is bijective and find f−1(x)f^{-1}(x). Then explain what goes wrong if the domain is all real numbers.
  1. Let f(x)={2x+a,x<1,x2+b,1≤x<3,cx−1,x≥3.f(x)=\begin{cases}2x+a, & x<1,\\x^2+b, & 1\le x<3,\\cx-1, & x\ge 3.\end{cases} Find aa, bb, and cc so that ff is continuous everywhere and f(0)=5f(0)=5.
  1. Suppose ff is an odd function with domain [−5,5][-5,5], range [−3,3][-3,3], and f(2)=−1f(2)=-1. Define g(x)=2f(x−1)−4g(x)=2f(x-1)-4. Find the domain and range of gg, and find g(3)g(3) and g(−1)g(-1).
  1. Suppose f:A→Bf:A\to B and g:B→Cg:B\to C. Prove that if ff and gg are both injective, then g∘fg\circ f is injective. Also prove that if g∘fg\circ f is surjective onto CC, then gg must be surjective onto CC.
  1. (Bonus, Cauchy’s Functional Equation)

Consider a function Q⟶Q\mathbb{Q} \longrightarrow \mathbb{Q} (basically taking rational inputs and giving rational outputs) such that f(x+y)=f(x)+f(y)f(x+y)=f(x)+f(y) (basically for any two rational numbers, this equation holds true for f(x)f(x)).

(A) Show that f(0)=0f(0) = 0 and f(−x)=−f(x)f(-x) = -f(x). What does this show about f(x)f(x)?

(B) Prove that f(nx)=nf(x)f(nx) = nf(x) for all n∈Zn \in \mathbb{Z} (for all integer nn).

(C) Prove that f(xn)=f(x)nf(\frac{x}{n}) = \frac{f(x)}{n}.

(D) Determine all such functions f(x)f(x) that satisfy Cauchy’s Functional Equation. Remember you not only need to find all such solutions, but prove that each one is a valid solution to the equation.

(E) The solution in part (D) is the only solution for the rationals, but there exist infinitely more solutions for the reals! Why can’t your proof in steps (A) - (D) extend to real numbers?