Functions & Graphs
TL;DR
Functions take an input, do something to it, and give you an output. Graphs are visual maps of these input-output relationships. Understanding both helps you predict behavior and visualize data.
1. The Mental Model
Think of a function as a machine: you put something in, the machine processes it, and something comes out. A graph is like drawing a picture of what that machine does for every input you can imagine.
2. The Core Material
What is a Function?
A function assigns exactly one output for each input. It's a rule that connects an input value (often called $x$) to an output value (often called $y$ or $f(x)$).
For example, $f(x) = x + 2$ is a function. If you input 3, the output is $3 + 2 = 5$. If you input -1, the output is $-1 + 2 = 1$. Each input only has one possible output. If an input could give two different outputs, it wouldn't be a function.
Domain and Range
The domain is the set of all possible input values for a function.
The range is the set of all possible output values that the function can produce.
For $f(x) = x + 2$, you can put any real number in, so the domain is all real numbers. Since the outputs can also be any real number, the range is all real numbers.
Consider $f(x) = \sqrt{x}$. You can't take the square root of a negative number and get a real number. So, the domain is $x \ge 0$. The outputs will always be 0 or positive, so the range is $y \ge 0$.
How to Graph a Function
A graph is a visual representation of a function, typically on a coordinate plane. The horizontal axis (x-axis) represents the input values, and the vertical axis (y-axis) represents the output values. Each point $(x, y)$ on the graph shows an input $x$ and its corresponding output $y$.
To graph a simple function:
1. Pick some input values (x-values): Choose a few numbers, both positive and negative, and zero.
2. Calculate the output values (y-values): Use the function's rule to find the corresponding output for each input.
3. Plot the points: For each pair $(x, y)$, mark that spot on the coordinate plane.
4. Connect the dots: Draw a line or curve through the points, assuming the domain allows for values in between your chosen points.
Types of Functions (and their graphs)
You'll encounter many types, but here are a few basic ones:
- Linear Functions: $f(x) = mx + b$. Their graphs are straight lines. 'm' is the slope (steepness), and 'b' is the y-intercept (where it cr