Chapter II · Functions of real variables

Solving equations with graphs

§30 30 min

Splitting an equation as f(x) = φ(x) so that its roots are where two easy graphs cross, and using the shapes of the graphs to count the roots.

Why this matters

Most equations cannot be solved by a formula: sin⁡x=x/8\sin x = x/8, tan⁡x=ax+b\tan x = ax + b, x5+ax+b=0x^5 + ax + b = 0. But we can often say how many roots there are and roughly where, by writing the equation as f(x)=ϕ(x)f(x) = \phi(x) with two functions whose graphs we know, and looking at where the graphs cross. That is §30. It is more than a drawing trick: arguments about counting crossings, made rigorous, are the intermediate value theorem and Rolle’s theorem of Chapters V and VI.

The idea

If the curves y=f(x)y = f(x) and y=ϕ(x)y = \phi(x) meet at a point PP with abscissa ξ\xi, then f(ξ)=ϕ(ξ)f(\xi) = \phi(\xi), so ξ\xi is a root. Conversely every root gives such a meeting point. The art lies in the split. For xm+ax+b=0x^m + ax + b = 0, take f(x)=xmf(x) = x^m (a fixed curve) and ϕ(x)=−ax−b\phi(x) = -ax - b (a line you can move with aa and bb). Counting roots becomes asking how many times a line can cut a known curve.

Explore Roots as crossings

Try this. Choose xm+ax+b=0x^m + ax + b = 0. With mm odd, move aa from positive to negative and then move bb; with mm even, move bb across 00. Then choose sin⁡x=x/k\sin x = x/k and try k=1k = 1, 33, 88 and 120120.

x3−3x+1=0x^{3} - 3x + 1 = 0Hardy: Examples XVII, 3
xy
  • y=xmy = x^m
  • y=−ax−by = -ax - b
  • intersections and their abscissae (the roots)
3 roots in the window: −1.879, 0.3473, 1.532-1.879,\ 0.3473,\ 1.532. m odd,a<0:three or onem \text{ odd}, a < 0: \text{three or one}.
What to notice

For odd mm and a>0a > 0 the line slopes downwards while xmx^m rises, so they cross exactly once. For odd mm and a<0a < 0 there are three crossings or one, with two at the moment of tangency. For even mm the line cuts the cup-shaped curve twice when b<0b < 0 and twice or not at all when b>0b > 0. The equation sin⁡x=x/k\sin x = x/k has 11, 33, 77 and 7575 roots for those values of kk: the line y=x/ky = x/k leaves the strip ∣y∣≤1|y| \le 1 at x=±kx = \pm k, so only the humps of the sine curve inside ∣x∣<k|x| < k can be cut.

Precise statements

Principle Graphical solution Hardy: §30

The real roots of f(x)=ϕ(x)f(x) = \phi(x) are exactly the abscissae of the points where the graphs of y=f(x)y = f(x) and y=ϕ(x)y = \phi(x) meet.

This is a restatement of what a graph is, so there is nothing to prove. The work is always in counting the meeting points. Here are two cases where the counting can be done completely now.

Theorem The quadratic by a parabola and a line Hardy: Examples XVII, 1

Let a≠0a \neq 0. The roots of ax2+2bx+c=0ax^2 + 2bx + c = 0 are the abscissae of the intersections of y=x2y = x^2 with the line y=−(2bx+c)/ay = -(2bx + c)/a. There are two, one or none according as b2−acb^2 - ac is positive, zero or negative.

Theorem sin x = x only at 0 Hardy: Examples XVII, 5

For every x≠0x \neq 0, ∣sin⁡x∣<∣x∣|\sin x| < |x|. Hence the equation sin⁡x=x\sin x = x has the single root x=0x = 0.

Proofs

Proof The quadratic by a parabola and a line
Strategy

Intersections correspond to roots by the principle; then count them by completing the square, which is the algebra behind “the line cuts, touches or misses the parabola”.

Translate

A point (x,y)(x, y) is on both curves when y=x2y = x^2 and y=−(2bx+c)/ay = -(2bx + c)/a, so its abscissa satisfies x2=−(2bx+c)/ax^2 = -(2bx + c)/a, i.e. ax2+2bx+c=0ax^2 + 2bx + c = 0. Conversely a root xx gives the common point (x,x2)(x, x^2).

Complete the square

ax2+2bx+c=0ax^2 + 2bx + c = 0 is equivalent to (x+ba)2=b2−aca2\left(x + \dfrac ba\right)^2 = \dfrac{b^2 - ac}{a^2}.

Count

If b2−ac>0b^2 - ac > 0 there are two roots (−b±b2−ac)/a\bigl(-b \pm \sqrt{b^2 - ac}\bigr)/a; if b2−ac=0b^2 - ac = 0, one (the line touches the parabola); if b2−ac<0b^2 - ac < 0, none, since a square is never negative (the line passes below the parabola).

Proof sin x = x only at 0
Strategy

For small positive xx, compare the half-chord sin⁡x\sin x with the arc xx in a circle of radius 11: a chord is shorter than its arc. For larger xx it is enough that ∣sin⁡x∣≤1|\sin x| \le 1. Negative xx follow by symmetry.

0<x≤12π0 < x \le \tfrac12\pi

In a circle of radius 11, take an arc subtending the angle 2x2x at the centre. Its length is 2x2x and its chord has length 2sin⁡x2\sin x. A straight segment is shorter than any other path between its ends, so 2sin⁡x<2x2\sin x < 2x, that is sin⁡x<x\sin x < x; and sin⁡x>0\sin x > 0 here. (Hardy assumes the geometry of arcs at this stage; Chapters VII and IX make it rigorous.)

x>12πx > \tfrac12\pi

Then x>12π>1≥∣sin⁡x∣x > \tfrac12\pi > 1 \ge |\sin x|.

x<0x < 0

∣sin⁡x∣=∣sin⁡(−x)∣<∣−x∣=∣x∣|\sin x| = |\sin(-x)| < |{-x}| = |x| by the previous cases, since sin⁡\sin is odd.

Conclude

So sin⁡x≠x\sin x \neq x when x≠0x \neq 0, and sin⁡0=0\sin 0 = 0: the only root is 00. In the picture, the line y=xy = x meets the sine curve at the origin and nowhere else.

The same comparison gives the other counts. For sin⁡x=x/k\sin x = x/k with k>1k > 1, every root has ∣x∣≤k|x| \le k, because ∣x/k∣>1≥∣sin⁡x∣|x/k| > 1 \ge |\sin x| otherwise; each positive hump (2jπ,(2j+1)π)(2j\pi, (2j + 1)\pi) lying in that range is cut twice if the line is below the top of the hump, and the first hump once more (besides 00). Count them for k=120k = 120 in the exercise below. The next example shows roots appearing and disappearing in pairs as a line slides.

Explore Roots come and go in pairs

Try this. Choose x−a=12πsin⁡2xx - a = \tfrac12\pi\sin^2 x. Start at a=0.01a = 0.01, then move aa slowly up past about 0.170.17, and on towards π\pi.

x−0.01=12πsin⁡2xx - 0.01 = \tfrac12\pi\sin^2 xHardy: Examples XVII, 6
xy
  • y=12πsin⁡2xy = \tfrac12\pi\sin^2 x
  • y=x−ay = x - a
  • intersections and their abscissae (the roots)
3 roots in the window: 0.01016, 0.7679, 1.5810.01016,\ 0.7679,\ 1.581.
What to notice

For small ∣a∣|a| there are three roots. As aa grows, two of them merge (the line becomes tangent to the curve) and vanish, leaving one; when aa approaches π\pi the pair is born again. The count only changes at tangencies, where two roots coincide.

Worked examples and exercises

Exercise ●○○ Hardy: Examples XVII, 2

Solve graphically, and then exactly: x2+2x−3=0x^2 + 2x - 3 = 0, x2−7x+4=0x^2 - 7x + 4 = 0, 3x2+2x−2=03x^2 + 2x - 2 = 0.

Hint
Use y=x2y = x^2 and the line y=−(2bx+c)/ay = -(2bx + c)/a; for the first, that line is y=3−2xy = 3 - 2x.

Solution

x2=3−2xx^2 = 3 - 2x meets at x=1x = 1 and x=−3x = -3 (indeed (x−1)(x+3)=0(x - 1)(x + 3) = 0). x2=7x−4x^2 = 7x - 4 gives x=12(7±33)≈6.372x = \tfrac12(7 \pm \sqrt{33}) \approx 6.372 and 0.6280.628. 3x2+2x−2=03x^2 + 2x - 2 = 0, i.e. x2=13(2−2x)x^2 = \tfrac13(2 - 2x), gives x=13(−1±7)≈0.549x = \tfrac13(-1 \pm \sqrt7) \approx 0.549 and −1.215-1.215. A careful drawing gives one or two correct decimals; the formula gives the rest.

Exercise ●●○ Hardy: Examples XVII, 3

Using the curves y=xmy = x^m and y=−ax−by = -ax - b, verify Hardy’s table for the number of real roots of xm+ax+b=0x^m + ax + b = 0: for mm even, two or none if b>0b > 0, two if b<0b < 0; for mm odd, one if a>0a > 0, three or one if a<0a < 0. Give a numerical example of each case.

Hint
For odd mm and a>0a > 0: xmx^m increases and −ax−b-ax - b decreases. Can two such graphs cross twice?
Hint
For even mm, the curve y=xmy = x^m is convex (every chord lies above it; you proved this for m=2m = 2, and Chapter VI proves it in general). A line meets a convex curve at most twice. When b<0b < 0, the line passes above the origin, which is on the curve.

Solution

mm odd, a>0a > 0. xmx^m is increasing and −ax−b-ax - b strictly decreasing, so their difference xm+ax+bx^m + ax + b is strictly increasing: at most one root. It is negative for large negative xx and positive for large positive xx (the leading term dominates), so the graphs do cross: exactly one root. Example: x3+x+1=0x^3 + x + 1 = 0, root ≈−0.682\approx -0.682.

mm odd, a<0a < 0. The line now rises. It can cut the S-shaped curve three times (when it passes close to the origin) or once (when it is far above or below); two exactly at a tangency, which the table ignores. Examples: x3−3x+1=0x^3 - 3x + 1 = 0 has roots ≈−1.879,0.347,1.532\approx -1.879, 0.347, 1.532; x3−3x+5=0x^3 - 3x + 5 = 0 has the single root ≈−2.279\approx -2.279.

mm even, b<0b < 0. The line passes through (0,−b)(0, -b), which is above the curve’s point (0,0)(0, 0), while far out on both sides the curve is above the line. So there is a crossing on each side of 00, and by convexity no more: exactly two. Example: x4+x−1=0x^4 + x - 1 = 0, roots ≈−1.221\approx -1.221 and 0.7240.724.

mm even, b>0b > 0. The line passes below the origin; it may cut the curve twice or miss it (touching it at a tangency). Examples: x4−3x+1=0x^4 - 3x + 1 = 0 has roots ≈0.338\approx 0.338 and 1.3071.307; x4+x+1=0x^4 + x + 1 = 0 has none.

Exercise ●●○ Hardy: Examples XVII, 4

Show that tan⁡x=ax+b\tan x = ax + b has infinitely many roots, whatever aa and bb are.

Hint
Look at one interval ((n−12)π,(n+12)π)\bigl((n - \tfrac12)\pi, (n + \tfrac12)\pi\bigr) between consecutive vertical asymptotes of tan⁡x\tan x.

Solution

On each interval In=((n−12)π,(n+12)π)I_n = \bigl((n - \tfrac12)\pi, (n + \tfrac12)\pi\bigr), tan⁡x\tan x runs (increasing) from values below any given number near the left end to values above any given number near the right end, while the line ax+bax + b stays between two fixed numbers on InI_n. So tan⁡x−(ax+b)\tan x - (ax + b) is negative near the left end of InI_n and positive near the right end, and the unbroken curve y=tan⁡xy = \tan x must cross the line somewhere in InI_n. (That an unbroken graph which changes sign must cross the axis is the intermediate value theorem of Chapter V.) There are infinitely many intervals InI_n, so infinitely many roots.

Exercise ●●○ Hardy: Examples XVII, 5

Determine the number of roots of sin⁡x=13x\sin x = \tfrac13 x, sin⁡x=18x\sin x = \tfrac18 x and sin⁡x=1120x\sin x = \tfrac{1}{120}x.

Hint
Roots satisfy ∣x∣≤k|x| \le k. Since both sides are odd, count positive roots and double, then add the root 00.
Hint
A hump (2jπ,(2j+1)π)(2j\pi, (2j + 1)\pi) with j≥1j \ge 1 is cut twice when the line is below its top, i.e. roughly when (2j+12)π<k(2j + \tfrac12)\pi < k; the first hump is cut once besides 00. Negative humps on the positive side cannot be cut, as the line is positive there.

Solution

k=3k = 3: positive roots lie in (0,3](0, 3], within the first hump, which is cut once: x≈2.279x \approx 2.279. Total 2⋅1+1=32 \cdot 1 + 1 = 3.

k=8k = 8: the first hump gives one positive root (≈2.786\approx 2.786). The second positive hump is (2π,3π)≈(6.283,9.425)(2\pi, 3\pi) \approx (6.283, 9.425) with top at 52π≈7.854\tfrac52\pi \approx 7.854, where the line is at 0.982<10.982 < 1: two roots (≈7.498\approx 7.498 and 7.9577.957). Total 2⋅3+1=72 \cdot 3 + 1 = 7.

k=120k = 120: the humps (2jπ,(2j+1)π)(2j\pi, (2j + 1)\pi) with 1≤j≤181 \le j \le 18 have tops at (2j+12)π≤114.67(2j + \tfrac12)\pi \le 114.67, where the line is at most 0.956<10.956 < 1: two roots each, 3636 in all. For j=19j = 19 the hump starts at 38π≈119.3838\pi \approx 119.38, and on [119.38,120][119.38, 120] the sine is at most sin⁡(0.62)≈0.58\sin(0.62) \approx 0.58 while the line is above 0.990.99: no roots. With the first hump’s one root, there are 3737 positive roots and 2⋅37+1=752 \cdot 37 + 1 = 75 in total. (The widget confirms all three counts.)

Exercise ●●● Hardy: Examples XVII, 6

Show that if aa is small and positive (say a=0.01a = 0.01) the equation x−a=12πsin⁡2xx - a = \tfrac12\pi\sin^2 x has three roots, and that the same is true for small negative aa. Explain how the number of roots varies with aa.

Hint
At a=0a = 0 check the roots 00, 14π\tfrac14\pi and 12π\tfrac12\pi directly.
Hint
The curve y=12πsin⁡2xy = \tfrac12\pi\sin^2x has period π\pi and lies between 00 and 12π\tfrac12\pi; the line y=x−ay = x - a has slope 11. Where can the line be tangent to the curve?

Solution

At a=0a = 0: 12πsin⁡20=0\tfrac12\pi\sin^2 0 = 0, 12πsin⁡214π=14π\tfrac12\pi\sin^2\tfrac14\pi = \tfrac14\pi, 12πsin⁡212π=12π\tfrac12\pi\sin^2\tfrac12\pi = \tfrac12\pi, so 00, 14π\tfrac14\pi, 12π\tfrac12\pi are roots, and the line crosses the curve (does not touch it) at each. The roots must lie where the line is in the band 0≤y≤12π0 \le y \le \tfrac12\pi, i.e. a≤x≤a+12πa \le x \le a + \tfrac12\pi, a window half a period long, so there are only a few.

Sliding the line slightly (small ∣a∣|a|) moves each crossing slightly without destroying it, so there are still three roots: for a=0.01a = 0.01 they are about 0.01020.0102, 0.7680.768 and 1.5811.581. The number can only change when the line becomes tangent to the curve, which needs slope 11: the slope of 12πsin⁡2x\tfrac12\pi\sin^2x is 12πsin⁡2x\tfrac12\pi\sin 2x (Chapter VI), so sin⁡2x=2/π\sin 2x = 2/\pi, giving x≈0.345x \approx 0.345 and x≈1.226x \approx 1.226 in [0,12π][0, \tfrac12\pi]. The corresponding values of a=x−12πsin⁡2xa = x - \tfrac12\pi\sin^2 x are ±a∗\pm a^* with a∗≈0.1653a^* \approx 0.1653. So there are three roots when ∣a∣<a∗|a| < a^*, two at ∣a∣=a∗|a| = a^*, and one when a∗<∣a∣≤12πa^* < |a| \le \tfrac12\pi. Because the curve has period π\pi, replacing aa by a+πa + \pi shifts the whole picture by π\pi; the pattern repeats, with three roots whenever aa is within a∗a^* of a multiple of π\pi and one root otherwise (apart from the tangent cases).

Check yourself

Check yourself Enter a number

How many real roots does sin⁡x=x/8\sin x = x/8 have?

Why

Three positive roots (one in the first hump, two in the hump around 52π≈7.85\tfrac52\pi \approx 7.85, where the line is still below 11), three negative ones by symmetry, and x=0x = 0: seven.

Check yourself Choose one

How many real roots has x5+2x−7=0x^5 + 2x - 7 = 0?

Why

m=5m = 5 is odd and a=2>0a = 2 > 0: x5x^5 increases and −2x+7-2x + 7 decreases, so they cross exactly once (near x≈1.3x \approx 1.3). A fifth-degree equation has at most five real roots, but here the shapes allow only one.

Check yourself True or false?

A carefully drawn graph proves that two curves meet only at the intersections we can see.

Why

False. A drawing shows a finite window at finite resolution; crossings may be off the page or too close together to separate. The counts in this lesson rest on arguments about the shapes (monotonic, convex, bounded, periodic), with the picture as a guide.

Check yourself Choose one

As a parameter varies continuously, the number of roots of f(x)=ϕ(x)f(x) = \phi(x) typically changes

Why

Transversal crossings move a little when the curves move a little, so they persist. A pair is created or destroyed at a tangency, as in x−a=12πsin⁡2xx - a = \tfrac12\pi\sin^2x. Roots can also escape through the edge of a window or into an asymptote, but tangency is the typical way.

Hardy’s language

Summary

Summary
  • To solve F(x)=0F(x) = 0 graphically, split it as f(x)=ϕ(x)f(x) = \phi(x) with easy graphs; the roots are the abscissae of the intersections.
  • Count roots by reasoning about shapes: a rising and a falling graph cross at most once; a line meets a convex curve at most twice; a bounded curve meets a line only in a bounded window.
  • ∣sin⁡x∣<∣x∣|\sin x| < |x| for x≠0x \neq 0, so sin⁡x=x\sin x = x only at 00; sin⁡x=x/k\sin x = x/k has 11, 33, 77, 7575 roots for k=1k = 1, 33, 88, 120120.
  • As parameters move, roots appear and disappear in pairs at tangencies.