Functions and Rational Functions
☰ Contents
A function is a rule that takes an input and gives back exactly one output. That definition decides which inputs are allowed, when a rule can be run backwards, and why some graphs have gaps.
What does f(x) mean?
f(x) is the output of the function f when the input is x. It is not f multiplied by x. To evaluate it, put the input in place of every x in the rule. If , then f(5) is . The x is only a placeholder, so any number or expression can take its place: f(a + 1) means . The notation is useful because it names the input and the output in one symbol, so a statement such as f(5) = 10 records both at once. A negative input needs brackets: f(−2) is , and leaving the brackets out turns into −4. Check a value against the graph: the point (5, 10) lies on the curve y = f(x), because y is the output when x is 5.
passing through (2, 3) forces 2m + c = 3, so each intercept c fixes m = (3 − c) / 2
Make the line pass through (2, 3)
If f(x) = 2x + 1, then f(3) = 2 × 3 + 1 = 7. In the same way, f(a + 1) = 2a + 3.
See Function Notation.
Now you
f(x) = 6x + 1. What is f(5)?
f(x) = 6x − 4. What is f(6)?
How do you find the domain and range?
The domain is the set of inputs a function accepts, and the range is the set of outputs it produces. Begin the domain with all real numbers and remove every value that breaks a rule: a denominator cannot be zero, a square root cannot hold a negative number, and a logarithm needs a positive input. For , the root needs , so the domain is . The smallest root is 0, at x = 3, so the smallest output is 0 + 1 = 1, and the range is . These rules exist because each operation is undefined outside them. A real setting can shrink the domain further, as when a length must be positive. The range usually needs the graph or the shape of the rule, not a list of banned values. Test with a value: x = 7 gives , which is 3, inside the range.
4 − x²: every x is allowed, so the whole x-axis is lit; but 4 − x² ≤ 4, so the y-shadow stops at 4 and never goes above
Choose √(x + 3) and drag the point to where its shadow starts
Two more examples: has domain every real number except 2. has domain .
For every input is allowed, but a square is never negative, so the range is .
See Domain and Range.
Now you
. Which input is not allowed?
. What is the smallest output?
Functions built out of pieces
A piecewise function uses a different rule on each stretch of its domain. To evaluate it, first find which stretch the input falls in, then use that rule. The boundary belongs to the rule whose inequality includes "or equal to".
x = 0.4 < 1: the first rule is in charge, f(x) = 2x + 1 = 1.8, and the other line is not consulted
Drag x to exactly 1 and read which rule owns it
The pieces join without a jump when both rules give the same value at the boundary. To make that happen, work out each rule at the boundary, set the two values equal, and solve for the unknown constant.
See Piecewise Functions, Graphing a Piecewise Function and Making a Piecewise Function Continuous.
Composite and inverse functions
A composite function sends the output of one function into another as its input. fg(x) means f(g(x)): apply g first, then f. If f(x) = x + 1 and , then fg(2) = f(4) = 5, but gf(2) = g(3) = 9.
P = (a, a³) reflects in y = x to P′ = (a³, a): swap the coordinates and the mirror point traces the inverse, y = ∛x, which is still a function
On x³, drag P to (2, 8) and read where its mirror lands
An inverse function undoes the original: if f sends 3 to 10, then sends 10 back to 3. To find one, reverse the order of the steps and replace each step with its opposite. f(x) = 3x + 1 multiplies by 3 and then adds 1, so subtracts 1 and then divides by 3: .
Swapping input and output swaps the coordinates of every point, so (3, 10) becomes (10, 3).
See Composite Functions and Inverse Functions.
Now you
f(x) = x + 2, g(x) = 3x. What is gf(4)?
f(x) = x + 6, g(x) = 4x. What is gf(3)?
How do transformations change a graph?
A change outside the bracket acts on the output and moves the graph the way it reads: lifts every point of up 3. Inside the bracket, a change acts on the input and works in reverse: shifts the graph 3 to the right. The reversal happens because x must now be 3 bigger to give the bracket the same value, so the vertex moves from x = 0 to x = 3. When several changes act together, apply those inside the bracket first and those outside last: shifts right 3, doubles every height, then lifts 3. Check with one point: (1, 1) on should move to (4, 4) on , and indeed .
c = 0: f(x − 0) = f(x), so the graph is where it started
Set c = 3 and find where the peak lands
Stretches follow the same split. doubles every height, and no point moves sideways. acts on the input, so the bracket reaches its old value at half the x, and the curve is squashed to half its width.
See Transforming Graphs, Stretching a Graph Vertically and Stretching a Graph Horizontally.
What makes exponential growth different?
Exponential growth multiplies by the same factor at each step, while linear growth adds the same amount. After n steps of doubling, a starting amount A has become . From 3, adding 3 each step gives 6, 9, 12, 15, but doubling gives 6, 12, 24, 48. Doubling ten times multiplies by 1,024, and 3 × 1,024 = 3,072 against 3 + 10 × 3 = 33. Each exponential step is bigger than the last because the increase is a fixed fraction of the current amount, so the curve eventually overtakes any straight line. A percentage rate gives the factor: growth of 10% a year multiplies by . The picture reverses when the factor is below 1: the amount shrinks toward zero without reaching it, which is exponential decay. To test data, divide each term by the one before. For 6, 12, 24, 48 every ratio is 2, while the differences 6, 12, 24 keep changing.
one unit along: 2ˣ goes 4 → 8, ×2, an increase of 4; 2x gains +2 as always: the exponential adds a fixed fraction of itself, the line adds a fixed amount
Slide the bracket to start at x = 5 and read both gains
A half-life of 3 days means the amount halves every 3 days: 80 g becomes 40 g, then 20 g, then 10 g.
Nothing real doubles forever, because the room runs out. A logistic model grows like an exponential at first, then flattens onto a ceiling called the carrying capacity.
See Exponential Growth, Exponential Decay, Growth and Decay Problems and Logistic Growth and Carrying Capacity.
What is a logarithm for?
A logarithm gives the power that a base must be raised to: because . Taking a logarithm undoes raising to a power, as subtraction undoes addition. In general, the logarithm of y to base b is the number x with , so every logarithm fact is an exponent fact read backward: , since 10 × 10 × 10 = 1,000. Logarithms solve equations with the unknown in the exponent. When the answer is not a whole number, take the logarithm of both sides and bring the power down with the power law: gives x log 5 = log 30, so x = log 30 / log 5. Only positive numbers have real logarithms, since no power of a positive base is zero or negative. Confirm by raising the base to the answer: 2 × 2 × 2 = 8.
The laws of logarithms come from the laws of exponents. Multiplying powers of one base adds the exponents, , so log(ab) = log a + log b. Dividing subtracts: . A power is repeated multiplying, so the exponent comes to the front: .
To solve : x log 3 = log 20, so .
A calculator offers only and ln, and the change of base rule reaches every other base from those two: . ln is the logarithm with base , and it obeys every law above.
See Exponentials and Logarithms, The Laws of Logarithms, Solving Exponential Equations, The Change of Base Rule and The Natural Logarithm.
Now you
. What is x?
. Which expression gives x?
Reading data on a log scale
A logarithmic axis places each value v at distance log v, so equal distances stand for equal multiples: 1, 10, 100 and 1000 are evenly spaced.
linear axis: 10, 100 and 1000 are all within the bottom tenth, and 10000 sets the scale; the ×10 steps are invisible
Slide the axis all the way to log scale
A log axis tests for exponential growth. If , taking logs of both sides gives log y = log a + x log b, a straight line in x. Plot log y against x: if the points straighten, the data is exponential, and undoing the logs on the gradient and the intercept recovers b and a.
The axis that takes the logs picks the model. A power law straightens when log y is plotted against log x, and the gradient is n. A logarithmic model y = a + b ln x straightens when y is plotted against ln x.
See Logarithmic Graphs, Straightening Growth with Logarithms, Straightening a Power Law and Fitting a Logarithmic Model.
Why do some graphs have gaps?
A rational function is one polynomial divided by another, and it has no value where the denominator is zero, so its graph has a gap there. Factor both, then check each factor that makes the denominator zero. If it does not cancel, the graph has a vertical asymptote: has one at x = 3, because near 3 the denominator is tiny and the values grow without bound. If it cancels, the gap is a single missing point, a hole. For , the top is (x − 3)(x + 3), so the graph is the line y = x + 3 with the point at x = 3 removed, at height 3 + 3 = 6. The fraction and the line agree everywhere except at x = 3. Nearby inputs test an asymptote: is 100 at and −100 at .
at x = 2 the denominator is 0 and the numerator is not, so f grows without bound: a vertical asymptote, with opposite signs either side
Bring x to 0.1 from the forbidden point
A fraction is zero only when its numerator is zero, so the zeros of the numerator are the x-intercepts.
. Cancel, and x + 2 is left for every x except 2, where the original reads 0 ÷ 0. A hole is a removable discontinuity; an asymptote cannot be repaired.
Far from the origin the leading terms decide the shape, so compare the degrees of the top and the bottom. If the bottom has the higher degree, the curve flattens onto y = 0. If the degrees are equal, it flattens onto the ratio of the leading coefficients: flattens onto y = 2. If the top is exactly one degree higher, the curve approaches a slanted line instead.
Long division finds that line. Divide polynomials the way you divide numbers: compare the leading terms, multiply back, subtract, and repeat. The quotient is the slant asymptote, and the remainder over the divisor fades to nothing far out. , so the slant asymptote is y = x + 2.
See Zeros and Vertical Asymptotes, Holes Where a Factor Cancels, Horizontal Asymptotes by Degree, Long Division of Polynomials and Slant Asymptotes by Long Division.
Now you
What is the horizontal asymptote of ?
What is the horizontal asymptote of ?
The mistakes worth naming
- Reading f(x) as multiplication. f(4) means put 4 in for x, and f(a + b) is not f(a) + f(b) unless f(x) = kx.
- Shifting the wrong way. f(x + 3) moves the graph 3 to the left. A change inside the bracket works in reverse.
- Composing in the wrong order. fg(x) means f(g(x)): apply g first.
- Canceling without recording the hole. Simplifying to x + 2 loses the fact that x = 2 was never allowed.
Graphs of equations and coordinate geometry covers the lines and curves these transformations act on, and sequences and series continues from exponential growth into geometric series. Related guides: Limits and Continuity and Quadratics and Polynomials.
Your turn
Three to try — tap what you get.
f(x) = 2x + 3. What is f(4)?
Where is 1/(x − 2) undefined?
f(x) = x² and g(x) = x + 1. f(g(2))?
Questions and answers
- What does f(x) actually mean?
- It means the output of the rule f when the input is x, and it is not f multiplied by x. If f(x) equals 2x plus 1, then f(3) is 7. The notation exists so that a rule can be named once and used many times, and so that you can talk about the output at an unnamed input, which is what makes calculus expressible at all.
- How do you find the domain of a function?
- Start with every real number and remove the inputs that break the rule. Division by zero removes any x that makes a denominator zero, square roots remove anything that would make the inside negative, and logarithms remove zero and everything below it. For f(x) equal to 1 over (x minus 2), the domain is every real number except 2.
- Why does the inverse of a function reflect in the line y = x?
- Because the inverse swaps the roles of input and output, and swapping the coordinates of a point is exactly what reflecting in y = x does to it. If the original function sends 3 to 10, its graph passes through (3, 10) and the inverse's graph passes through (10, 3). Doing that to every point at once reflects the whole curve.
- What is a logarithm, in plain terms?
- A logarithm answers the question 'what power do I need?'. Log base 2 of 8 is 3 because 2 to the power 3 is 8. It is the inverse of raising to a power, which is why it is the tool that gets an unknown down out of an exponent — and why the laws of logarithms turn multiplication into addition.
- What is a vertical asymptote, and how is it different from a hole?
- A vertical asymptote is an input the function cannot take where the graph runs off to infinity on at least one side; a hole is an input it cannot take where the graph would otherwise be ordinary. The difference is whether the troublesome factor cancels. In the factor cancels, so there is a hole at x = 1; in nothing cancels, so it is an asymptote.
- How do you find the horizontal asymptote of a rational function?
- Compare the degrees of the top and the bottom. If the bottom has the higher degree the asymptote is y = 0; if the degrees are equal it is the ratio of the leading coefficients; and if the top is exactly one degree higher there is no horizontal asymptote but there is a slanted one, found by long division. For very large x, only the leading terms matter, which is why the degrees are the whole story.