No history yet

Functions and Limits

The Language of Relationships

At its core, calculus is the study of change. But before we can talk about change, we need a way to describe relationships between things. That's where functions come in. A function is simply a rule that takes an input and produces a single, predictable output.

Think of a coffee machine. You put in coffee beans (the input), and it gives you coffee (the output). The machine is the function. For any given input of beans, you get a specific output of coffee. It won't surprise you with tea. In mathematics, we often write a function as f(x)f(x), where ff is the rule, xx is the input, and f(x)f(x) (read as "f of x") is the output.

function

noun

A mathematical rule that assigns exactly one output for each given input.

For example, the function f(x)=x+5f(x) = x + 5 is a simple rule that says "take any number, xx, and add 5 to it." If you input 3, the output is f(3)=3+5=8f(3) = 3 + 5 = 8. If you input -10, the output is f(10)=10+5=5f(-10) = -10 + 5 = -5.

Domain and Range

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

The domain is the complete set of all possible inputs a function can accept. The range is the complete set of all possible outputs the function can produce.

For our simple function f(x)=x+5f(x) = x + 5, you can plug in any real number for xx without breaking the rule. So, its domain is all real numbers. Similarly, the output can be any real number, so its range is also all real numbers.

But consider the function g(x)=xg(x) = \sqrt{x}. Since we can't take the square root of a negative number (in the realm of real numbers), the domain is restricted to all non-negative numbers (x0x \ge 0). The output will also always be non-negative, so the range is also all numbers greater than or equal to zero.

Understanding a function's domain and range is critical in machine learning. It helps define the valid inputs for a model and anticipate the kinds of outputs it will generate, preventing errors and nonsensical results.

Getting Infinitely Close

Now for one of the biggest ideas in all of calculus: the limit. A limit describes the value that a function approaches as the input gets closer and closer to a certain number. The key idea is that we don't care what happens exactly at the number, only what happens in its immediate neighborhood.

Imagine walking toward a wall. You can take steps that are half the remaining distance. You'll get incredibly close to the wall—infinitesimally close—but you'll never technically touch it. The wall represents the limit of your position.

We write the limit of a function f(x)f(x) as xx approaches a value cc like this:

limxcf(x)=L\lim_{x \to c} f(x) = L

This reads as "the limit of f(x)f(x) as xx approaches cc equals LL." It means that as xx gets closer and closer to cc (from both sides), the output value f(x)f(x) gets closer and closer to LL.

Evaluating Limits and Continuity

For many simple functions, finding the limit is as easy as plugging the number in. These are called continuous functions. A continuous function is one you can draw without lifting your pencil from the paper; it has no jumps, holes, or gaps.

For the function f(x)=x+5f(x) = x + 5, what is the limit as xx approaches 3? We can just plug it in: limx3(x+5)=3+5=8\lim_{x \to 3} (x+5) = 3 + 5 = 8. The value the function approaches is the same as the function's value at that point.

But what about a function like this?

f(x)=x24x2f(x) = \frac{x^2 - 4}{x - 2}

If we try to find the limit as xx approaches 2, we run into a problem. Plugging in x=2x=2 gives us 00\frac{0}{0}, which is undefined. The function has a hole at x=2x=2. This is where limits shine. We can see what value the function is approaching from either side of 2.

Let's try a number very close to 2, like 2.001: f(2.001)=(2.001)242.0012=4.00400140.001=0.0040010.001=4.001f(2.001) = \frac{(2.001)^2 - 4}{2.001 - 2} = \frac{4.004001 - 4}{0.001} = \frac{0.004001}{0.001} = 4.001. Now let's try a number just below 2, like 1.999: f(1.999)=(1.999)241.9992=3.99600140.001=0.0039990.001=3.999f(1.999) = \frac{(1.999)^2 - 4}{1.999 - 2} = \frac{3.996001 - 4}{-0.001} = \frac{-0.003999}{-0.001} = 3.999.

The closer we get to 2 from either side, the closer the output gets to 4. We can also simplify the function algebraically for any x2x \ne 2: f(x)=(x2)(x+2)x2=x+2f(x) = \frac{(x-2)(x+2)}{x-2} = x+2. This simplified function makes it clear that as xx approaches 2, the value approaches 2+2=42+2=4. So, even though the function is undefined at x=2x=2, its limit is 4.

limx2x24x2=4\lim_{x \to 2} \frac{x^2 - 4}{x - 2} = 4

A function is continuous at a point cc if three conditions are met: f(c)f(c) is defined, the limit as xcx \to c exists, and the limit equals the function's value. In short: limxcf(x)=f(c)\lim_{x \to c} f(x) = f(c).

These concepts of functions, limits, and continuity form the bedrock of calculus. They allow us to handle ideas of infinite closeness and rates of change, which are essential for building and optimizing the complex algorithms used in machine learning.

Quiz Questions 1/5

What is the most fundamental characteristic of a function in mathematics?

Quiz Questions 2/5

What is the domain of the function f(x)=x3f(x) = \sqrt{x-3}?

With these foundational ideas in place, we're ready to explore how calculus measures change.