Int 3 for Programmers

Functions, transformations, composition and inverses

4 / 396
Contents

Contents

Int 3 for Programmers

0 of 396 complete

9 min read

Reading a graph properly: intercepts, rising and falling

Where a curve meets the axes, and the stretches of input on which it climbs or drops.

An exam question that shows you a curve and asks you to describe it is not asking for an opinion. There is a fixed list of features it wants, each with a name, and the marks are for using the names correctly.

Every one of those features can be found by walking along the function and watching the numbers, which is exactly what a loop does. Start with the places where the curve meets the axes. Run this and look for the moment the sign of the output flips.

Try CodePython

Change the rule to x * x - 4 and run it again. Two crossings are reported. Which two whole numbers are they?

An input where the output is zero is called an x-intercept, because the graph touches the horizontal axis there. The same number is also called a zero of the function, or a root of the equation f(x)=0f(x) = 0. Three names, one thing.

The output at x=0x = 0 is the y-intercept, where the graph crosses the vertical axis. There is at most one of those, since a function gives 0 only one output, while there can be many x-intercepts.

The run reports zeros at x=−2x = -2 and at x=3x = 3, and both check out by hand: f(−2)=4+2−6=0f(-2) = 4 + 2 - 6 = 0 and f(3)=9−3−6=0f(3) = 9 - 3 - 6 = 0. The y-intercept is f(0)=−6f(0) = -6. Had a crossing fallen between two whole numbers, the output would still have changed sign across it and the second branch of the test would have caught it.

Rising and falling

The next question is where the curve goes up and where it goes down. Walking left to right, compare each output with the one before.

Try CodePython

Change the rule to x * x * x - 3 * x and run it again. Now there are three stretches rather than two.

The report switches from decreasing to increasing exactly once, near x=0.5x = 0.5. A function is increasing on an interval if moving right always raises the output, and decreasing if moving right always lowers it. Both are described using intervals of inputs, never of outputs.

One curve, read off

Everything so far came out of a loop. Here is the same function drawn, so that the numbers and the picture sit side by side.

Reading intercepts off a curve
f(x)=x2−x−6f(x) = x^2 - x - 6
-8-32712-4-1.750.52.755
y-intercept, which is f(0)f(0)
-6
Height at x=3x = 3
0
Height at x=−2x = -2
0

Leave c at 6 and find the two places where the curve meets the horizontal axis. They are at -2 and 3, and the last two numbers listed beside the slider both read 0 there. Then drag c and watch both crossings move while the shape of the curve stays the same.

The curve above, with c=6c = 6, is f(x)=x2−x−6f(x) = x^2 - x - 6. Give its x-intercepts, its y-intercept, and the interval on which it is increasing.

The x-intercepts are x=−2x = -2 and x=3x = 3, the two inputs where the curve meets the horizontal axis. The y-intercept is f(0)=0−0−6=−6f(0) = 0 - 0 - 6 = -6. The curve falls until its lowest point at x=0.5x = 0.5 and rises after it, so it is increasing on (0.5,∞)(0.5, \infty). Answering that it increases on (−6.25,∞)(-6.25, \infty) describes the outputs rather than the inputs, and earns nothing.

Check yourself

A graph passes through (0,−4)(0, -4) and crosses the horizontal axis at x=2x = 2 and x=−2x = -2. What is its y-intercept?

All lessons in Int 3 for Programmers