Chapter II · Functions of real variables

Rational functions

§§24–25 35 min

Quotients of polynomials, why cancelling a common factor changes the function, why rational functions of rational functions are rational, and how asymptotes come from long division.

Why this matters

After polynomials, the next simplest functions are their quotients. Rational functions (§24) bring two new phenomena: values of xx where the function is not defined at all, near which the graph shoots off to infinity, and the subtle fact that “simplifying” a formula can change the function it defines. Their graphs (§25) are organised by asymptotes, lines the graph approaches far out or near a zero of the denominator. Hardy says these graphs really belong to the differential calculus, but a surprising amount can be seen with algebra alone.

The idea

A rational function is R(x)=P(x)/Q(x)R(x) = P(x)/Q(x) with PP and QQ polynomials. Where Q(x)=0Q(x) = 0 the formula is meaningless and RR is not defined. Two things then shape the graph:

  • Near a zero of QQ (that is not also cancelled by PP), Q(x)Q(x) is small while P(x)P(x) is not, so ∣R(x)∣|R(x)| is large: the graph runs up or down alongside a vertical line, a vertical asymptote.
  • Far out, long division writes R(x)=S(x)+T(x)/Q(x)R(x) = S(x) + T(x)/Q(x) with SS a polynomial and TT of lower degree than QQ. The fraction T/QT/Q is small for large ∣x∣|x|, so the graph runs alongside the graph of SS: a horizontal line if deg⁡P≤deg⁡Q\deg P \le \deg Q, an oblique line if deg⁡P=deg⁡Q+1\deg P = \deg Q + 1, a curve otherwise.
Explore Asymptotes near and far

Try this. Start with 1/xm1/x^m and compare even and odd mm. Then try ax+b/xax + b/x (make b=0b = 0 too), x2±1/x2x^2 \pm 1/x^2 and (x2+1)/(x2−1)(x^2+1)/(x^2-1). For each, use “zoom out” and move the trace point far to the right, reading f(x)−S(x)f(x) - S(x).

y=1xy = \dfrac{1}{x}Hardy: Examples XII, 1, 5
xy
  • the function
  • far-out asymptote y=0y = 0
  • vertical asymptotes (denominator = 0)
At x=0.96x = 0.96: f(x)=1.0417f(x) = 1.0417, the asymptote gives 00, difference f(x)−S(x)=1.04f(x) - S(x) = 1.04. Zoom out: far from the origin the graph becomes indistinguishable from its asymptote.
What to notice

Every vertical asymptote sits at a zero of the denominator, and the graph goes off to ±∞\pm\infty on each side of it, with the same sign on both sides when the factor is squared (1/x21/x^2, 1/(x−1)21/(x-1)^2) and opposite signs when it is not. Far out, f(x)−S(x)f(x) - S(x) shrinks roughly like a constant over xx, so the graph merges with its asymptote, which for x2±1/x2x^2 \pm 1/x^2 is the parabola y=x2y = x^2. With b=0b = 0 the function ax+0/xax + 0/x is the line y=axy = ax with one point missing.

Precise statements

Definition Rational function Hardy: §24

A rational function of xx is a quotient R(x)=P(x)/Q(x)R(x) = P(x)/Q(x) of two polynomials, QQ not identically zero. It is defined wherever Q(x)≠0Q(x) \neq 0. When QQ is a constant, RR is a polynomial. We usually suppose that PP and QQ have no common factor (other than constants), any such factor having been removed by division; RR is then in standard form.

“Rational” refers to how xx enters, not to the coefficients: 2 x/(x+π)\sqrt2\,x/(x + \pi) is a rational function. The name comes from the way RR is generated from xx by finitely many additions, multiplications and divisions, just as every rational number is generated from 11.

Hardy makes a point that is easy to skip and important to keep: removing a common factor changes the function. The function x/xx/x equals 11 for every x≠0x \neq 0, but at x=0x = 0 it is 0/00/0, which is meaningless. So x/xx/x is not the function 11: it is undefined at one point. In the same way Hardy’s example

(1x+1+1x−1)/(1x+1x−2)reduces tox2(x−2)(x−1)2(x+1),\left(\frac{1}{x+1} + \frac{1}{x-1}\right) \Big/ \left(\frac{1}{x} + \frac{1}{x-2}\right) \quad\text{reduces to}\quad \frac{x^2(x-2)}{(x-1)^2(x+1)},

but the original is undefined at x=−1,1,0,2x = -1, 1, 0, 2, while the reduced form is defined (and equal to 00) at 00 and 22. Try “Hardy’s reduction” and “x/xx/x” in the explorer: the holes are the points where the two functions differ.

By agreement, once we have noted such exceptional points we work with the reduced, standard form. Then the familiar operations stay inside the class.

Theorem Rational functions are closed under the rational operations Hardy: §24 (5)

Sums, differences, products and quotients of rational functions are rational functions. Moreover a rational function of a rational function is a rational function: if z=P(y)/Q(y)z = P(y)/Q(y) and y=P1(x)/Q1(x)y = P_1(x)/Q_1(x), then, after simplification, z=P2(x)/Q2(x)z = P_2(x)/Q_2(x) for some polynomials P2P_2, Q2Q_2.

Theorem The polynomial part is the asymptote

Let R=P/QR = P/Q with QQ of degree n≥1n \ge 1. There are polynomials SS and TT, with T=0T = 0 or deg⁡T<n\deg T < n, such that R(x)=S(x)+T(x)/Q(x)R(x) = S(x) + T(x)/Q(x) wherever Q(x)≠0Q(x) \neq 0. Moreover there are numbers CC and XX such that

∣R(x)−S(x)∣≤C∣x∣whenever ∣x∣≥X.|R(x) - S(x)| \le \frac{C}{|x|} \quad \text{whenever } |x| \ge X.

Proofs

Proof Rational functions are closed under the rational operations
Strategy

For the arithmetic operations, use the usual rules for fractions. For composition, substitute and clear the inner denominators by multiplying top and bottom by a suitable power of Q1(x)Q_1(x).

Sums and products

PQ±P′Q′=PQ′±P′QQQ′\dfrac{P}{Q} \pm \dfrac{P'}{Q'} = \dfrac{PQ' \pm P'Q}{QQ'} and PQ⋅P′Q′=PP′QQ′\dfrac{P}{Q}\cdot\dfrac{P'}{Q'} = \dfrac{PP'}{QQ'}. Sums and products of polynomials are polynomials, so these are rational.

Quotients

PQ/P′Q′=PQ′QP′\dfrac{P}{Q} \Big/ \dfrac{P'}{Q'} = \dfrac{PQ'}{QP'}, provided P′P' is not identically zero. (This is where the agreement about exceptional points is used: at zeros of Q′Q' the left side is meaningless, the right side may not be.)

Substitute y=P1/Q1y = P_1/Q_1 into P(y)/Q(y)P(y)/Q(y)

Let mm be the larger of the degrees of PP and QQ. A term c ykc\,y^k with k≤mk \le m becomes c P1k/Q1k=c P1kQ1m−k/Q1mc\,P_1^k/Q_1^k = c\,P_1^kQ_1^{m-k}/Q_1^m. So P(y)=A(x)/Q1(x)mP(y) = A(x)/Q_1(x)^m and Q(y)=B(x)/Q1(x)mQ(y) = B(x)/Q_1(x)^m, where AA and BB are polynomials in xx.

Cancel the common denominator

Then z=P(y)/Q(y)=A(x)/B(x)z = P(y)/Q(y) = A(x)/B(x), a rational function of xx (with the usual exceptional points, where Q1(x)=0Q_1(x) = 0 or Q(y)=0Q(y) = 0, set aside).

Proof The polynomial part is the asymptote
Strategy

Long division gives SS and TT. Then bound T(x)T(x) above and Q(x)Q(x) below for large ∣x∣|x|, using the estimate of the last lesson: for ∣x∣≥1|x| \ge 1 the lower terms of a polynomial are at most (sum of their coefficients) × ∣x∣degree−1\times\,|x|^{\text{degree}-1}.

Divide

Dividing PP by QQ (long division, as in algebra) gives P=SQ+TP = SQ + T with T=0T = 0 or deg⁡T<n\deg T < n. Dividing by Q(x)Q(x) where it is not zero, R=S+T/QR = S + T/Q. If T=0T = 0 there is nothing more to prove.

Bound the numerator

Let KTK_T be the sum of the absolute values of the coefficients of TT. Since deg⁡T≤n−1\deg T \le n - 1, for ∣x∣≥1|x| \ge 1 every term of TT is at most its coefficient times ∣x∣n−1|x|^{n-1}, so ∣T(x)∣≤KT∣x∣n−1|T(x)| \le K_T|x|^{n-1}.

Bound the denominator from below

Write Q(x)=b0xn+(lower terms)Q(x) = b_0x^n + (\text{lower terms}) and let KQK_Q be the sum of the absolute values of the lower coefficients. For ∣x∣≥1|x| \ge 1, the lower terms are at most KQ∣x∣n−1K_Q|x|^{n-1}, so ∣Q(x)∣≥∣b0∣ ∣x∣n−KQ∣x∣n−1|Q(x)| \ge |b_0|\,|x|^n - K_Q|x|^{n-1}. If also ∣x∣≥2KQ/∣b0∣|x| \ge 2K_Q/|b_0|, then KQ∣x∣n−1≤12∣b0∣ ∣x∣nK_Q|x|^{n-1} \le \tfrac12|b_0|\,|x|^n and ∣Q(x)∣≥12∣b0∣ ∣x∣n>0|Q(x)| \ge \tfrac12|b_0|\,|x|^n > 0.

Combine

For ∣x∣≥X=max⁡(1,2KQ/∣b0∣)|x| \ge X = \max(1, 2K_Q/|b_0|) we get ∣R(x)−S(x)∣=∣T(x)∣/∣Q(x)∣≤KT∣x∣n−112∣b0∣ ∣x∣n=C∣x∣|R(x) - S(x)| = |T(x)|/|Q(x)| \le \dfrac{K_T|x|^{n-1}}{\frac12|b_0|\,|x|^n} = \dfrac{C}{|x|} with C=2KT/∣b0∣C = 2K_T/|b_0|.

In the language of Chapters IV and V this says R(x)−S(x)→0R(x) - S(x) \to 0 as x→±∞x \to \pm\infty. If deg⁡P<deg⁡Q\deg P < \deg Q then S=0S = 0 and the axis of xx is the asymptote; if deg⁡P=deg⁡Q\deg P = \deg Q, SS is the constant a0/b0a_0/b_0; if deg⁡P=deg⁡Q+1\deg P = \deg Q + 1, SS is an oblique line.

Worked examples and exercises

Exercise ●○○ Hardy: Examples XII, 1, 5

Describe the graphs of y=1/xmy = 1/x^m for m=1,2,3,…m = 1, 2, 3, \dots, distinguishing odd and even mm, and say what shape they approach as mm grows.

Hint
Use the graphs of xmx^m from the last lesson: where xmx^m is small, 1/xm1/x^m is large, and the reverse.

Solution

All are undefined at x=0x = 0 and pass through (1,1)(1, 1). For even mm the function is even and positive, so the graph lies above the axis in two symmetric pieces, rising to infinity on both sides of x=0x = 0 and approaching the axis of xx far out. For odd mm it is odd: positive for x>0x > 0, negative for x<0x < 0, with the two pieces symmetric about the origin, going to +∞+\infty on the right of 00 and −∞-\infty on the left. As mm grows, 1/xm1/x^m gets larger for 0<∣x∣<10 < |x| < 1 and smaller for ∣x∣>1|x| > 1: the graph approaches the vertical lines x=±1x = \pm1 inside (shooting up, or down for odd mm on the left) and the axis of xx outside, with the points (1,1)(1, 1) and (−1,±1)(-1, \pm1) fixed. The limiting shape is a pair of “walls” at x=±1x = \pm1 joined to the axis.

Exercise ●●○ Hardy: Examples XII, 2

Show that x+1/x≥2x + 1/x \ge 2 for every x>0x > 0, with equality only at x=1x = 1, and describe the graph of y=ax+b/xy = ax + b/x when ab>0ab > 0 and when ab<0ab < 0.

Hint
x+1/x−2=(x−1)2/xx + 1/x - 2 = (x - 1)^2/x.
Hint
For ax+b/xax + b/x, ask whether the two terms have the same sign for x>0x > 0, and whether the function is odd.

Solution

For x>0x > 0, x+1/x−2=(x2−2x+1)/x=(x−1)2/x≥0x + 1/x - 2 = (x^2 - 2x + 1)/x = (x-1)^2/x \ge 0, with equality only at x=1x = 1. So on x>0x > 0 the graph of x+1/xx + 1/x has its lowest point at (1,2)(1, 2); it is asymptotic to x=0x = 0 (going up) and to the line y=xy = x (from above). Since the function is odd, the left half is the right half turned through two right angles, with highest point (−1,−2)(-1, -2).

For y=ax+b/xy = ax + b/x (odd, asymptotes x=0x = 0 and y=axy = ax): if ab>0ab > 0, the two terms have the same sign for x>0x > 0, so ∣y∣≥2ab|y| \ge 2\sqrt{ab} there (by the same argument with a/b x\sqrt{a/b}\,x in place of xx), and the graph has two separate U-shaped pieces as for x+1/xx + 1/x. If ab<0ab < 0, the terms have opposite signs; the function then takes every real value on x>0x > 0 (it goes from ∓∞\mp\infty near 00 to ±∞\pm\infty far out, through a single crossing of the axis at x=−b/ax = \sqrt{-b/a}), and each half of the graph is a single rising or falling branch, as for x−1/xx - 1/x.

Exercise ●○○ Hardy: Examples XII, 3

Write x+1x−1\dfrac{x+1}{x-1} and x2+1x2−1\dfrac{x^2+1}{x^2-1} in the form S(x)+T(x)/Q(x)S(x) + T(x)/Q(x), and use this to describe their graphs.

Hint
x+1=(x−1)+2x + 1 = (x - 1) + 2.

Solution

x+1x−1=1+2x−1\dfrac{x+1}{x-1} = 1 + \dfrac{2}{x-1}. The graph is the hyperbola y=2/xy = 2/x moved one unit right and one up: asymptotes x=1x = 1 and y=1y = 1, in the two quadrants (relative to (1,1)(1, 1)) where x−1x - 1 and y−1y - 1 have the same sign.

x2+1x2−1=1+2x2−1\dfrac{x^2+1}{x^2-1} = 1 + \dfrac{2}{x^2-1}. It is even, with vertical asymptotes x=±1x = \pm1 and horizontal asymptote y=1y = 1. For ∣x∣>1|x| > 1 the fraction is positive, so the graph is above y=1y = 1, falling towards it. For ∣x∣<1|x| < 1 it is negative, with its highest point at (0,−1)(0, -1), and runs down to −∞-\infty at both x=±1x = \pm1.

Exercise ●●○ Hardy: Examples XII, 4

Let a<ba < b. Describe the graph of y=1/{(x−a)(x−b)}y = 1/\{(x - a)(x - b)\}, and find its highest point between aa and bb (where it is negative, “highest” means nearest the axis).

Hint
Find the sign of (x−a)(x−b)(x - a)(x - b) in the three intervals. Between aa and bb, write (x−a)(x−b)=(x−m)2−h2(x - a)(x - b) = (x - m)^2 - h^2 with m=12(a+b)m = \tfrac12(a + b) and h=12(b−a)h = \tfrac12(b - a).

Solution

The denominator is positive for x<ax < a and for x>bx > b, negative between. So the graph is positive outside [a,b][a, b], approaching the axis far out and going to +∞+\infty at the asymptotes x=ax = a (from the left) and x=bx = b (from the right); and negative between, going to −∞-\infty at both ends. Between aa and bb, (x−a)(x−b)=(x−m)2−h2(x - a)(x - b) = (x - m)^2 - h^2 lies between −h2-h^2 (at x=mx = m) and 00, so y≤−1/h2=−4/(b−a)2y \le -1/h^2 = -4/(b - a)^2, with equality at x=mx = m. The highest point of the middle branch is (12(a+b),−4/(b−a)2)\bigl(\tfrac12(a + b), -4/(b - a)^2\bigr), and the graph is symmetric about the line x=12(a+b)x = \tfrac12(a + b).

Exercise ●○○ Hardy: §24 (3)

Verify Hardy’s reduction above, and list the values of xx at which the original expression and the reduced one differ.

Hint
Combine each bracket over a common denominator first.

Solution

1x+1+1x−1=2xx2−1\dfrac{1}{x+1} + \dfrac{1}{x-1} = \dfrac{2x}{x^2 - 1} and 1x+1x−2=2x−2x(x−2)\dfrac1x + \dfrac{1}{x-2} = \dfrac{2x - 2}{x(x-2)}. The quotient is 2xx2−1⋅x(x−2)2(x−1)=x2(x−2)(x−1)2(x+1)\dfrac{2x}{x^2-1}\cdot\dfrac{x(x-2)}{2(x-1)} = \dfrac{x^2(x-2)}{(x-1)^2(x+1)}. The original is meaningless at x=−1x = -1 and 11 (zero denominators inside), and at 00 and 22 (the terms 1/x1/x and 1/(x−2)1/(x-2)). The reduced form is also meaningless at ±1\pm1, but at 00 and 22 it equals 00. So the two functions differ exactly at x=0x = 0 and x=2x = 2, where one is defined and the other is not.

Check yourself

Check yourself True or false?

The functions x/xx/x and 11 are the same function.

Why

False. They agree for every x≠0x \neq 0, but x/xx/x is not defined at x=0x = 0 (the formula gives 0/00/0), while 11 is. Two functions are the same only if they are defined at the same points and agree there. In practice we often agree to ignore such exceptional points, but we must know we are doing it.

Check yourself Choose one

What are the asymptotes of y=(x2+1)/(x2−1)y = (x^2 + 1)/(x^2 - 1)?

Why

The zeros of the denominator give x=±1x = \pm1. Numerator and denominator have the same degree, so the polynomial part is the ratio of leading coefficients, 11: the graph approaches y=1y = 1. The asymptote is y=0y = 0 only when the numerator has lower degree.

Check yourself Enter a number

The graph of y=(2x2+3x)/(x−1)y = (2x^2 + 3x)/(x - 1) has an oblique asymptote y=2x+cy = 2x + c. What is cc?

Why

Long division: 2x2+3x=(x−1)(2x+5)+52x^2 + 3x = (x - 1)(2x + 5) + 5, so y=2x+5+5/(x−1)y = 2x + 5 + 5/(x - 1) and the asymptote is y=2x+5y = 2x + 5.

Check yourself Choose one

Is f(x)=2 x2−πx+ef(x) = \dfrac{\sqrt2\,x^2 - \pi}{x + e} a rational function?

Why

Hardy stresses this in §24 (6). A rational function is a quotient of polynomials in xx; the constants in them are arbitrary real numbers.

Hardy’s language

It should however be observed that this removal of common factors does as a rule change the function.

— G. H. Hardy, §24

Summary

Summary
  • A rational function is P(x)/Q(x)P(x)/Q(x); it is undefined where Q(x)=0Q(x) = 0, and “rational” refers to xx, not to the coefficients.
  • Cancelling a common factor changes the function at the cancelled zeros: x/xx/x is not 11 at x=0x = 0.
  • Sums, products, quotients and compositions of rational functions are rational (after setting aside exceptional points).
  • Long division gives R=S+T/QR = S + T/Q; for large ∣x∣|x|, ∣R−S∣≤C/∣x∣|R - S| \le C/|x|, so the graph approaches the graph of SS. Zeros of QQ that survive cancellation give vertical asymptotes.