Math Core

Lesson 1.1 · Functions

Functions and their graphs

Almost everything in precalculus and calculus is a statement about functions: how fast they grow, where they turn around, what values they can and can't produce. This lesson sharpens the tools you already have (notation, domain and range, reading graphs) and adds a few new ones you'll use constantly from here on: interval notation, the difference quotient, average rate of change and symmetry.

What makes something a function

Definition

Function

A function ff from a set DD to a set RR is a rule that assigns to each input xx in DD exactly one output f(x)f(x) in RR. The set DD of allowed inputs is the domain. The set of outputs the function actually produces is the range.

The key word is exactly. An input can't be sent to two different outputs. Two different inputs sharing one output is perfectly fine: f(x)=x2f(x) = x^2 sends both 22 and −2-2 to 44, and it is still a function.

On a graph, "exactly one output" becomes the vertical line test: a graph is the graph of a function of xx if and only if no vertical line crosses it more than once. A vertical line x=cx = c hits the graph at every point whose input is cc, so two crossings would mean two outputs for one input.

The cubic passes the vertical line test. The sideways parabola x = y² − 2 fails it: the line x = 1 crosses it twice.Open in grapher →

Function notation

The symbol f(x)f(x) means "the output of ff when the input is xx." The letter inside the parentheses is only a placeholder. Whatever you put in the parentheses replaces every xx in the rule, even if what you put in is an expression.

Worked example: Evaluating with expressions

Let f(x)=2x2−3x+1f(x) = 2x^2 - 3x + 1. Find f(−2)f(-2) and f(a+1)f(a + 1).

Replace each xx with −2-2, keeping it in parentheses:

f(−2)=2(−2)2−3(−2)+1=8+6+1=15f(-2) = 2(-2)^2 - 3(-2) + 1 = 8 + 6 + 1 = 15

Now replace each xx with a+1a + 1:

f(a+1)=2(a+1)2−3(a+1)+1=2a2+4a+2−3a−3+1=2a2+a\begin{aligned} f(a + 1) &= 2(a + 1)^2 - 3(a + 1) + 1 \\ &= 2a^2 + 4a + 2 - 3a - 3 + 1 \\ &= 2a^2 + a \end{aligned}

Common mistake

f(a+1)f(a + 1) is not f(a)+1f(a) + 1, and f(2x)f(2x) is not 2f(x)2f(x). Here f(a)+1=2a2−3a+2f(a) + 1 = 2a^2 - 3a + 2, which is a different expression from 2a2+a2a^2 + a. Substitute first, then simplify.

Domain and interval notation

When a function is given by a formula and no domain is stated, its implied domain is every real number for which the formula makes sense. At this level, two things can go wrong:

  • Division by zero. Exclude any xx that makes a denominator 00.
  • Even roots of negatives. The expression under   \sqrt{\ \ } (or any even root) must be ≥0\ge 0.

Precalculus usually writes domains and ranges in interval notation. A square bracket means the endpoint is included; a parenthesis means it isn't. Infinity always gets a parenthesis, and ∪\cup ("union") joins separate pieces.

InequalityInterval
−2≤x<5-2 \le x < 5[−2,5)[-2, 5)
x>3x > 3(3,∞)(3, \infty)
x≤0x \le 0(−∞,0](-\infty, 0]
x≠1x \ne 1(−∞,1)∪(1,∞)(-\infty, 1) \cup (1, \infty)

Worked example: Finding an implied domain

Find the domain of g(x)=6−2xx+1g(x) = \dfrac{\sqrt{6 - 2x}}{x + 1}.

The square root needs 6−2x≥06 - 2x \ge 0, so −2x≥−6-2x \ge -6 and x≤3x \le 3 (dividing by −2-2 flips the inequality).

The denominator needs x+1≠0x + 1 \ne 0, so x≠−1x \ne -1.

Both conditions must hold: x≤3x \le 3 and x≠−1x \ne -1. In interval notation the domain is

(−∞,−1)∪(−1,3](-\infty, -1) \cup (-1, 3]

The 33 is included because g(3)=04=0g(3) = \dfrac{0}{4} = 0 is perfectly defined.

The difference quotient

Much of calculus starts from one expression that measures how a function changes between an input xx and a nearby input x+hx + h.

Difference quotient

For h≠0h \ne 0, the difference quotient of ff is

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

It is the slope of the line through the points (x,f(x))\big(x, f(x)\big) and (x+h,f(x+h))\big(x + h, f(x + h)\big) on the graph.

For polynomials, the hh in the denominator always cancels after you simplify the numerator. That cancellation is the point of the exercise, so don't stop early.

Worked example: Simplifying a difference quotient

Find and simplify the difference quotient of f(x)=x2−4xf(x) = x^2 - 4x.

First find f(x+h)f(x + h):

f(x+h)=(x+h)2−4(x+h)=x2+2xh+h2−4x−4hf(x + h) = (x + h)^2 - 4(x + h) = x^2 + 2xh + h^2 - 4x - 4h

Subtract f(x)=x2−4xf(x) = x^2 - 4x. The x2x^2 and −4x-4x terms cancel:

f(x+h)−f(x)=2xh+h2−4hf(x + h) - f(x) = 2xh + h^2 - 4h

Every remaining term has a factor of hh, so divide:

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

Reading a graph

A graph shows the behavior of a function all at once. Here is the vocabulary for describing it.

  • The zeros of ff are the inputs where f(x)=0f(x) = 0: the xx-intercepts.
  • ff is increasing on an interval if the graph rises from left to right there, and decreasing if it falls. Intervals of increase and decrease are described with xx-values, using open intervals.
  • A relative (local) maximum is an output that is larger than every nearby output: a hilltop. A relative minimum is a valley bottom.
  • The average rate of change of ff from x=ax = a to x=bx = b is f(b)−f(a)b−a\dfrac{f(b) - f(a)}{b - a}, the slope of the secant line joining those two points.

Worked example: Describing a cubic

The graph of f(x)=x3−3xf(x) = x^3 - 3x is shown. Describe where it increases and decreases, give its relative extrema, and find its average rate of change from x=0x = 0 to x=2x = 2.

f(x) = x³ − 3x with the secant line from (0, 0) to (2, 2) dashed.Open in grapher →

Reading left to right, the graph rises until x=−1x = -1, falls until x=1x = 1, then rises again.

  • Increasing on (−∞,−1)(-\infty, -1) and (1,∞)(1, \infty); decreasing on (−1,1)(-1, 1).
  • Relative maximum f(−1)=−1+3=2f(-1) = -1 + 3 = 2; relative minimum f(1)=1−3=−2f(1) = 1 - 3 = -2.
  • Average rate of change: f(0)=0f(0) = 0 and f(2)=8−6=2f(2) = 8 - 6 = 2, so 2−02−0=1\dfrac{2 - 0}{2 - 0} = 1. On average the function climbs 11 unit per unit of xx on [0,2][0, 2], even though it dips below the axis in between.

Even and odd functions

Some graphs have a built-in symmetry that you can test with algebra.

  • ff is even if f(−x)=f(x)f(-x) = f(x) for every xx in the domain. Its graph is symmetric about the yy-axis. Example: x2x^2, ∣x∣\lvert x \rvert, x4−5x2x^4 - 5x^2.
  • ff is odd if f(−x)=−f(x)f(-x) = -f(x) for every xx in the domain. Its graph is symmetric about the origin: rotating it 180∘180^\circ leaves it unchanged. Example: x3x^3, 1x\dfrac{1}{x}, x3−3xx^3 - 3x.

Most functions are neither. To test, compute f(−x)f(-x), simplify, and compare it with f(x)f(x) and with −f(x)-f(x). For f(x)=x3−3xf(x) = x^3 - 3x: f(−x)=−x3+3x=−(x3−3x)=−f(x)f(-x) = -x^3 + 3x = -(x^3 - 3x) = -f(x), so it is odd, which matches the graph above (the hilltop at (−1,2)(-1, 2) mirrors the valley at (1,−2)(1, -2)).

Tip

For polynomials there's a shortcut: if every power of xx is even (a constant counts as x0x^0), the function is even; if every power is odd, it is odd. x2+xx^2 + x mixes both, so it is neither.

Practice

Practice 1

Which of these equations does not define yy as a function of xx?

Practice 2

Let f(x)=3x2−5x+2f(x) = 3x^2 - 5x + 2. Find f(−1)f(-1).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

Find the domain of f(x)=12−3xf(x) = \sqrt{12 - 3x}. Write it as an inequality in xx.

Enter an inequality, e.g. x >= 4, -2 < x <= 3, or x < 1 or x > 5

Practice 4

What is the domain of h(x)=x+2x2−9h(x) = \dfrac{x + 2}{x^2 - 9}?

Practice 5

Find the average rate of change of f(x)=x2+2xf(x) = x^2 + 2x from x=1x = 1 to x=4x = 4.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

Which is the simplified difference quotient f(x+h)−f(x)h\dfrac{f(x + h) - f(x)}{h} for f(x)=3x2+xf(x) = 3x^2 + x?

Practice 7

Is f(x)=x3x2+1f(x) = \dfrac{x^3}{x^2 + 1} even, odd or neither?

Practice 8

The graph of f(x)=−(x−2)2+5f(x) = -(x - 2)^2 + 5 is shown. What is the range of ff? Write it as an inequality in yy.

y = -(x - 2)^2 + 5(2, 5)Open in grapher →

Enter an inequality, e.g. x >= 4, -2 < x <= 3, or x < 1 or x > 5