Rational Functions and How to Sketch Them
You already know how to read a
cubic or a reciprocal
graph by its silhouette, and you can
cancel a
common factor from an algebraic fraction. Put those two skills together and you can
sketch a whole new family: the rational functions.
A rational function is nothing more exotic than one polynomial divided by another:
f(x) = \dfrac{p(x)}{q(x)}, \qquad q(x) \neq 0.
The reciprocal y = \dfrac{1}{x} is the simplest interesting one
(p(x)=1, q(x)=x). Swap in bigger polynomials
and you get curves that rocket off to infinity at certain x-values
and flatten out towards a level line far away. The wonderful thing is that you can
predict exactly where both of those things happen just by looking at the top and the bottom
— no forty-point table required.
This page is a recipe. By the end you'll be able to take any \dfrac{p(x)}{q(x)}
and read off its vertical asymptotes, its horizontal (or slant)
asymptote, its holes, and its intercepts — then sketch the
thing in under a minute.
It feels like a contradiction — wild in one place, tame in another — but it's just the fraction doing
two different jobs at two different scales.
Near a bad spot: if the denominator q(x) shrinks towards
0 while the numerator stays away from 0, you're
dividing a normal number by something microscopic. Divide 7 by
0.001 and you get 7000; by
0.000001, seven million. The output explodes — that's a
vertical asymptote.
Far away: when x is huge, only the highest power
on the top and the bottom matters (the little terms are rounding errors beside it). So the whole
fraction settles down to the ratio of those leading terms — a flat horizontal line. Same formula, two
regimes: violent where the bottom vanishes, sleepy where the top and bottom race each other to
infinity and tie.
Vertical asymptotes: where the bottom hits zero
A fraction goes haywire exactly when its denominator is 0 — you cannot
divide by nothing. So the candidates for trouble are the zeros of
q(x). At (almost) every such x the curve
shoots up to +\infty on one side and plunges to
-\infty on the other, hugging an invisible vertical line it never touches:
a vertical asymptote.
I said almost every zero, and that word is the whole subtlety of this lesson — we'll meet the
exception (a hole) in a moment. First, the clean case. Take
f(x) = \dfrac{2x+1}{x-3}.
The denominator is zero when x-3=0, i.e. x=3, and
the numerator there is 2(3)+1 = 7 \neq 0. Seven divided by an ever-tinier
number: the curve has a vertical asymptote at x=3.
Horizontal asymptote: let the powers fight it out
Now zoom way out. For large x, a polynomial is dominated by its top term,
so compare the degree (highest power) of the top with that of the bottom. Three cases,
and that's the whole story:
-
Top degree < bottom degree — the bottom grows faster, so the fraction is crushed
towards 0: horizontal asymptote y = 0 (the
x-axis). This is what \dfrac{1}{x} does.
-
Top degree = bottom degree — they grow at the same rate and settle to the
ratio of the leading coefficients: horizontal asymptote
y = \dfrac{a}{b}.
-
Top degree = bottom degree + 1 — the top wins by one power, so instead of levelling
off the curve drifts alongside a slanted line, an oblique (slant) asymptote,
which you find by dividing p by q.
Back to f(x) = \dfrac{2x+1}{x-3}: top and bottom are both degree
1, with leading coefficients 2 and
1. Equal degrees, so the horizontal asymptote is
y = \dfrac{2}{1} = 2. (You can see why: for enormous
x, \dfrac{2x+1}{x-3} \approx \dfrac{2x}{x} = 2.)
Worked example 1 — sketch f(x) = \dfrac{2x+1}{x-3}
Let's run the full recipe on our example and turn it into a picture. Five quick questions:
-
Vertical asymptote? Denominator zero at x=3, numerator
non-zero there → vertical asymptote x = 3.
-
Horizontal asymptote? Equal degrees, leading coefficients
2 and 1 → y = 2.
-
x-intercept? The curve meets the x-axis where the
numerator is zero: 2x+1=0 \Rightarrow x = -\tfrac{1}{2}. So
\left(-\tfrac{1}{2},\, 0\right).
-
y-intercept? Put x=0:
f(0) = \dfrac{2(0)+1}{0-3} = \dfrac{1}{-3} = -\tfrac{1}{3}. So
\left(0,\, -\tfrac{1}{3}\right).
-
End behaviour? The two branches (one on each side of
x=3) both flatten towards y=2 far out.
Mark the two asymptotes as a dashed cross-hairs, drop in those two intercepts, and the shape draws
itself — a reciprocal-style curve threaded between the lines x=3 and
y=2. The chart below plots it live: drag the sliders to change the leading
coefficient a (which sets the horizontal asymptote
y=a) and the root c (which sets the vertical
asymptote x=c), and watch both dashed lines and the whole curve move with
them. Setting a = 2 and c = 3 gives exactly our
worked example.
Worked example 2 — the trap: f(x) = \dfrac{x^2-1}{x-1}
Here the denominator is zero at x=1, so you might reach for a vertical
asymptote there. Stop. Check the numerator first — it factorises:
f(x) = \dfrac{x^2-1}{x-1} = \dfrac{(x-1)(x+1)}{x-1}.
The factor (x-1) appears on both top and bottom, so it
cancels:
f(x) = x+1 \quad \text{for all } x \neq 1.
Away from x=1 this is just the straight line
y = x+1. But we are not allowed to put
x=1 into the original fraction (that would be
\tfrac{0}{0}), so the graph is the line y=x+1
with a single point punched out at x=1. Since the line
would pass through (1,\, 1+1) = (1,2), the graph is the line
y=x+1 with an open circle — a
hole — at (1,2).
A hole is a removable discontinuity: a factor that cancelled between top and bottom
leaves a single missing point, not an asymptote. The curve doesn't blow up there — it simply
skips one dot. In the picture below, the line is drawn solid and the hole marked at
(1,2).
This is the single most common mistake with rational functions. A zero of the denominator gives a
vertical asymptote only if the factor does NOT cancel with the numerator. If it
cancels, you get a hole instead — no blow-up, just one missing point.
-
\dfrac{x^2-1}{x-1} = \dfrac{(x-1)(x+1)}{x-1}: the
(x-1) cancels, so x=1 is a
hole at (1,2) — no asymptote there.
-
\dfrac{x+1}{x-1}: nothing cancels, so x=1 is a
genuine vertical asymptote.
The rule: always fully factor and cancel first. Then the un-cancelled zeros
of the denominator are your vertical asymptotes, and every factor that cancelled marks a hole. Skip the
cancelling step and you'll draw an asymptote where there's really just a pinprick — or miss a hole
entirely.
To sketch f(x) = \dfrac{p(x)}{q(x)}, factor top and bottom, cancel, then
read off:
-
Holes — every factor that cancels between p and
q gives a removable discontinuity (an open circle) at that
x-value.
-
Vertical asymptotes — the remaining (un-cancelled) zeros of the denominator; the
curve blows up to \pm\infty beside each.
-
Horizontal / oblique asymptote — compare degrees: top < bottom →
y=0; top = bottom → y = \dfrac{a}{b} (leading
coefficients); top = bottom + 1 → a slant asymptote found by dividing.
-
Intercepts — x-intercepts at the zeros of the
(cancelled) numerator; the y-intercept at
f(0).
Then there's no horizontal or slant asymptote — the curve runs away to infinity following a
parabola or higher curve. For example
\dfrac{x^3}{x-1} behaves like x^2 for large
x (polynomial long division gives
x^2 + x + 1 + \tfrac{1}{x-1}), so it hugs the parabola
y = x^2 + x + 1 far out. Same idea, one rung up: the quotient of the
division is the asymptotic curve, whatever its degree. When the top beats the bottom by just
one, that quotient is a line — the slant asymptote — which is why "degree + 1" is the special case
worth naming.