No history yet

Introduction to Functions

The Function Machine

Think of a function as a simple machine, like a vending machine. You press a button (the input), and it gives you a specific snack (the output). Each button corresponds to exactly one type of snack. You wouldn't expect the button for chips to sometimes give you a soda. That reliability is the core idea of a function.

function

noun

A rule that assigns to each input exactly one output.

In mathematics, we write this relationship as f(x)f(x), which you'd read as "f of x." Here, ff is the name of the function (the machine), and xx is the input. The entire expression, f(x)f(x), represents the output. So, if we have a function that doubles any number you give it, we could write it as f(x)=2xf(x) = 2x. If you input a 3, the output is f(3)=2×3=6f(3) = 2 \times 3 = 6.

Key rule: For any given input, a function must produce exactly one output. This is often checked with the "vertical line test" on a graph. If a vertical line can cross the graph more than once, it's not a function.

Domain and Range

A function's machine doesn't just accept any input. A vending machine might be out of stock for certain items, or it might not accept pennies. The set of all possible inputs a function can accept is called the domain. The set of all possible outputs it can produce is called the range.

For the function f(x)=xf(x) = \sqrt{x}, the domain is all non-negative numbers (x0x \ge 0), because you can't take the square root of a negative number in the real number system. The range is also all non-negative numbers, because the result of a square root is never negative.

For the function g(x)=1/xg(x) = 1/x, the domain is all real numbers except 0, because you can't divide by zero. The range is also all real numbers except 0.

Common Function Types

Functions come in many flavors. You'll encounter some types over and over again.

TypeExampleDescription
Linearf(x)=2x+1f(x) = 2x + 1Forms a straight line when graphed.
Quadraticg(x)=x23x+2g(x) = x^2 - 3x + 2Forms a parabola (a U-shape) when graphed.
Polynomialh(x)=x34xh(x) = x^3 - 4xFunctions with non-negative integer powers of xx.
Exponentialj(x)=2xj(x) = 2^xThe variable is in the exponent; models rapid growth or decay.
Logarithmick(x)=log10(x)k(x) = \log_{10}(x)The inverse of an exponential function.

There are also rational functions (ratios of polynomials) and trigonometric functions (like sin(x)\sin(x) and cos(x)\cos(x)) which describe relationships in triangles and periodic waves. We'll explore these more deeply later on.

Transforming Functions

Once you know the basic shape of a function's graph, you can move it around without having to plot a bunch of new points. These movements are called transformations.

Lesson image

Let's use the basic parabola, f(x)=x2f(x) = x^2, as our starting point.

  • Vertical Shifts: Adding a constant outside the function moves the graph up or down. For example, f(x)=x2+3f(x) = x^2 + 3 shifts the parabola up by 3 units. The function f(x)=x22f(x) = x^2 - 2 shifts it down by 2 units.

  • Horizontal Shifts: Adding a constant inside the function moves the graph left or right. This one can feel backward. The function f(x)=(x4)2f(x) = (x-4)^2 shifts the parabola to the right by 4 units. The function f(x)=(x+1)2f(x) = (x+1)^2 shifts it to the left by 1 unit.

  • Stretching and Compressing: Multiplying the function by a constant can stretch or compress it. Multiplying by a number greater than 1, like in f(x)=3x2f(x) = 3x^2, makes the parabola narrower (a vertical stretch). Multiplying by a fraction between 0 and 1, like in f(x)=0.5x2f(x) = 0.5x^2, makes it wider (a vertical compression).

  • Reflections: A negative sign also has an effect. Placing it outside, as in f(x)=x2f(x) = -x^2, flips the graph over the x-axis. Placing it inside, like f(x)=(x)2f(x) = (-x)^2, flips it over the y-axis (though for x2x^2, this looks the same).

These transformations can be combined. The function g(x)=(x+5)2+3g(x) = -(x+5)^2 + 3 takes the basic x2x^2 parabola, flips it upside down, moves it 5 units to the left, and 3 units up.

Understanding these rules is a powerful shortcut. Instead of calculating dozens of points, you can recognize the base function and simply shift, stretch, or flip its graph into place.

Ready to test your knowledge?

Quiz Questions 1/6

Which statement best describes the core characteristic of a function?

Quiz Questions 2/6

What is the domain of the function f(x)=1xf(x) = \frac{1}{x}?

Functions are the building blocks of calculus. Getting comfortable with what they are, how they behave, and how to manipulate their graphs will set a strong foundation for everything that comes next.