1. Home
  2. Blog
  3. Intermediate value theorem

The IVT: proving a root exists without finding it

To prove that an equation has a root between a and b, write it as f(x)=0, check that f is continuous on [a,b], and show that f(a) and f(b) have opposite signs. The Intermediate Value Theorem then guarantees a root in (a,b), even for an equation like cosx=x that no algebra can solve. Below: the theorem, a complete proof for cosx=x, and a discontinuous function that shows why continuity cannot be dropped.

The theorem

The Intermediate Value Theorem (IVT) says: if f is continuous on the closed interval [a,b] and N is any number strictly between f(a) and f(b), then f(c)=N for at least one c in (a,b).

For roots, take N=0. Zero lies strictly between f(a) and f(b) exactly when one of them is positive and the other negative, which gives the version you will use most:

If f is continuous on [a,b] and f(a), f(b) have opposite signs, then f(c)=0 for at least one c in (a,b).

The picture behind it: on [a,b] the graph of a continuous function is one unbroken curve. If it starts above the x-axis and ends below it, it has to cross the axis on the way.

The picture hides why this is a theorem rather than an obvious fact: it depends on the real number line having no gaps. If only fractions were allowed as inputs, x2−2 would go from −1 at x=1 to 2 at x=2 without ever being zero, because 2 is not a fraction. The IVT is the guarantee that, on the real line, the crossing point is always there.

Worked example: cosx=x has a solution between 0 and 1

No algebraic step isolates x in cosx=x. The IVT proves a solution exists anyway, in four steps.

  1. Put everything on one side. The theorem is about one function taking one value, so let f(x)=cosx−x. A solution of cosx=x is exactly a zero of f.
  2. Check continuity on the closed interval. cosx is continuous everywhere, and so is the polynomial x. A difference of continuous functions is continuous, so f is continuous on [0,1].
  3. Find the signs at the endpoints. f(0)=cos0−0=1, which is positive. For f(1)=cos1−1: the cosine equals 1 only at multiples of 2π, and 1 is not one, so cos1<1 and f(1) is negative. No calculator needed.
  4. Conclude. f is continuous on [0,1], and 0 lies strictly between f(1) and f(0). By the IVT there is a c in (0,1) with f(c)=0, that is, cosc=c.
x y f(x) = cos x − x 1 1 f(0) = 1 f(1) < 0 c x y g jumps over 0 1 2 g(0) = −2 g(2) = 2
Left: f(x)=cosx−x is continuous, positive at 0 and negative at 1, so it crosses the axis at some c in between. Right: the function g from the next section changes sign too, but it jumps over the axis instead of crossing it.

That is a complete proof, and it never found c.

Narrowing it down, still without a calculator

The same argument works on any smaller interval where you can decide the signs. The exact values at π6 and π4, both inside (0,1), are enough:

f(π6)=32−π6>0f(π4)=22−π4<0

The first is positive because 32>0.85 while π6<0.54. The second is negative because 22<0.71 while π4>0.78. So the solution lies between π6≈0.52 and π4≈0.79.

Exactly one solution needs a separate argument

The IVT says “at least one”. To show there is only one, you need something else. On [0,1], cosx decreases while x increases, so f(x)=cosx−x is strictly decreasing there and can cross zero only once. Outside [0,1] there is nothing to find:

  • for x>1, cosx≤1<x;
  • for −1≤x<0, cosx>0>x;
  • for x<−1, cosx≥−1>x.

So cosx=x has exactly one real solution, and it lies between π6 and π4.

Why continuity cannot be skipped

Take this function on [0,2]:

g(x)={x−2,x<1x,x≥1

Its endpoint values have opposite signs, g(0)=−2 and g(2)=2, yet g is never zero. For x<1, g(x)=x−2 stays below −1; for x≥1, g(x)=x is at least 1. Approaching x=1 from the left, the values climb towards −1; at x=1 the graph restarts at height 1. Every height from −1 up to (but not including) 1 is skipped, and 0 is one of them.

The sign change was real. What failed was continuity, at the single point x=1 inside the interval. That is why the continuity check has to cover the whole closed interval, not just the two endpoints where you computed the signs.

The sign test only works in one direction. Opposite signs at the endpoints, together with continuity, guarantee a root. Equal signs guarantee nothing: there may be no root in between, or several. The trap is to compute f(a) and f(b), find that both are positive, and conclude there is no root. The function x2−14 is positive at −1 and at 1, and it is zero at −12 and at 12.

Check your understanding

No calculator needed.

  1. A function f is continuous on [2,6], with f(2)=−3 and f(6)=5. Which of the values −4, 0, 4 and 6 must f take somewhere in (2,6)?
  2. Show that ex+x=3 has a solution between 0 and 1.
  3. Show that xx=3 has a solution between 1 and 2.
  4. Find the error. “For f(x)=x2−3x+1, f(0)=1 and f(1)=−1, so by the Intermediate Value Theorem the root is x=12, halfway between.”
  5. True or false: if f is not continuous on [a,b], then f cannot take any value strictly between f(a) and f(b). Give a reason.
  6. Show that 2sinx=x has a solution with x>0. Choose your interval with care.
  7. Suppose f is continuous on [0,1] and 0≤f(x)≤1 for every x in [0,1]. Show that f(c)=c for some c in [0,1].
Show the answers
  1. 0 and 4. Both lie strictly between −3 and 5, so the IVT guarantees them. The values −4 and 6 lie outside that range: f may or may not reach them, and the theorem says nothing either way.
  2. Let f(x)=ex+x−3, continuous on [0,1] as a sum of continuous functions. f(0)=1+0−3=−2, which is negative, and f(1)=e−2, which is positive because e>2. By the IVT, ec+c=3 for some c in (0,1).
  3. For x>0, xx=exlnx is a composition of continuous functions, so it is continuous on [1,2]. Its endpoint values are 11=1 and 22=4, and 3 lies strictly between them, so cc=3 for some c in (1,2). The target is 3 rather than 0, so there is no need to rearrange first.
  4. The IVT says a root exists in (0,1); it says nothing about where. In fact f(12)=−14, not 0. Since f(12) is negative and f(0) is positive, the IVT applied again puts the root in (0,12). It is 3−52≈0.38.
  5. False. A discontinuity takes away the guarantee, not the value: the theorem no longer says anything, and f may take the value anyway. For example, let k(x)=x for x≤1 and k(x)=x+5 for x>1. On [0,2] it jumps at 1, and k(0)=0, k(2)=7. It still takes the value 12, which lies between them, at x=12.
  6. Let f(x)=2sinx−x, continuous everywhere. The obvious interval [0,π] fails: f(0)=0, so 0 is not strictly between the endpoint values and the theorem does not apply; the zero you already know sits at the endpoint. Use [π2,π] instead: f(π2)=2−π2 is positive because π<4, and f(π)=−π is negative. The IVT gives a root c between π2 and π, so c>0.
  7. Let g(x)=f(x)−x, continuous on [0,1]. Then g(0)=f(0)≥0 and g(1)=f(1)−1≤0. If either is 0, take c=0 or c=1. Otherwise g(0)>0>g(1), and the IVT gives c in (0,1) with g(c)=0, that is, f(c)=c. The worked example is the case f(x)=cosx, whose values on [0,1] lie between cos1>0 and 1.

Practise it

The free CEGEP Calculus I Limits and Continuity worksheet includes an Intermediate Value Theorem question, alongside one-sided limits, asymptotes and continuity at a point. If you are taking AP, the AP Calculus AB Unit 1 worksheet has one too. In every IVT answer, write the continuity reason and the two endpoint values before you write the conclusion.

Want one-on-one help with this? I offer CEGEP Science calculus and linear algebra tutoring in Montreal, in person or online. Sessions start with a short written diagnostic, and a written recap goes to whoever books after every session.

Free worksheets for this

Ready to improve your grades?

WhatsApp is the way to reach me — tell me the course you're taking and what you're stuck on, and we'll sort out a first session from there.

Message Me on WhatsApp

or send a message

I reply within a day, usually sooner. Your details are used only to answer you — see the Privacy Policy.

Private math & science tutoring in Montreal, QC — Westmount · Outremont · Town of Mount Royal · Hampstead · Côte-Saint-Luc · NDG · Nuns' Island · West Island — and online across Quebec.

Chat with Marius