No history yet

Functions and Graphs

What is a Function?

Think of a function as a rule, like a recipe. You give it an input (an ingredient), and it gives you exactly one output (a finished dish). In math, we usually work with numbers. You put a number in, the function performs an operation on it, and you get exactly one number out.

function

noun

A mathematical relationship where each input value is associated with exactly one output value.

This relationship is often written as f(x)f(x), which you read as "f of x." The letter ff is the name of the function (the rule), and xx is the input. For example, if we have the function f(x)=x+5f(x) = x + 5, it tells us to take any input xx and add 5 to it. If we plug in x=3x = 3, we get f(3)=3+5=8f(3) = 3 + 5 = 8. The input is 3, and the output is 8.

The key rule is that for any single input, there can only be one output. If you put 3 into the machine, it can't spit out both 8 and 10.

Domain and Range

Every function has two important sets of values associated with it: the domain and the range.

domain

noun

The set of all possible input values (x-values) for a function.

range

noun

The set of all possible output values (y-values) that a function can produce.

Imagine a function that squares any number you give it, f(x)=x2f(x) = x^2. You can put any real number into this function, so its domain is "all real numbers." However, the output will always be zero or positive. You can't square a number and get a negative result. So, its range is "all real numbers greater than or equal to 0."

Lesson image

Graphing Functions

A graph is a visual representation of a function. It plots every input-output pair (x,y)(x, y) as a point on a coordinate plane. The x-axis represents the domain (inputs), and the y-axis represents the range (outputs). By connecting these points, we can see the shape of the function and understand its behavior.

A simple test to see if a graph represents a function is the Vertical Line Test. If you can draw a vertical line anywhere on the graph and it crosses the curve more than once, it is not a function. This is because it would mean one x-value has multiple y-values.

Let's look at a few common types of functions.

Linear Functions: These create straight lines on a graph. Their rule is f(x)=mx+bf(x) = mx + b. Here, mm represents the slope (how steep the line is) and bb is the y-intercept (where the line crosses the y-axis).

Polynomial Functions: These are built from variables raised to positive integer powers, like f(x)=x2f(x) = x^2 (a parabola) or f(x)=x32x+1f(x) = x^3 - 2x + 1 (a cubic function).

Exponential and Logarithmic Functions: Exponential functions, like f(x)=2xf(x) = 2^x, show rapid growth or decay. Logarithmic functions, like f(x)=log2(x)f(x) = \log_2(x), are their inverses and grow very slowly.

Function Transformations

Once you know the shape of a basic function, like f(x)=x2f(x) = x^2, you can create many variations by transforming it. These transformations shift, stretch, or reflect the graph.

  • Vertical Shifts: Adding a constant outside the function moves the graph up or down. f(x)+cf(x) + c shifts the graph up by cc units. f(x)cf(x) - c shifts it down.
  • Horizontal Shifts: Adding a constant inside the function moves the graph left or right. f(xc)f(x - c) shifts the graph to the right by cc units. f(x+c)f(x + c) shifts it to the left.
  • Reflections: A negative sign can reflect the graph. f(x)-f(x) reflects it across the x-axis (flipping it upside down). f(x)f(-x) reflects it across the y-axis (flipping it left to right).
Lesson image

Inverse Functions

Some functions have an inverse, which essentially undoes the original function's operation. If a function ff turns an input aa into an output bb, its inverse, written as f1f^{-1}, will turn bb back into aa. In other words, if f(a)=bf(a) = b, then f1(b)=af^{-1}(b) = a.

For a function to have an inverse, it must be "one-to-one." This means that every output corresponds to exactly one input. It must pass the Horizontal Line Test—a horizontal line can never cross the graph more than once.

A classic example is the relationship between exponential and logarithmic functions. The function f(x)=2xf(x) = 2^x takes an input and uses it as a power. Its inverse, f1(x)=log2(x)f^{-1}(x) = \log_2(x), finds what power you need to raise 2 to in order to get xx.

Graphically, the inverse of a function is its reflection across the diagonal line y=xy = x.

Lesson image

Let's check your understanding of these core concepts.

Quiz Questions 1/5

What is the fundamental rule for a relationship to be considered a function?

Quiz Questions 2/5

If you have the function f(x)=x2f(x) = x^2, what is its range?

Understanding functions and how they are represented visually is a critical first step for tackling calculus.