7.2 Continuity and Differentiability
A function is continuous at $a$ when its limit there equals its value, and differentiable at $a$ when the difference quotient $\frac{f(a+h)-f(a)}{h}$ has a limit as $h\to0$. We classify discontinuities, use the intermediate value theorem, prove that differentiability implies continuity, and test both properties at the junctions of piecewise formulas, the corners of $|x|$ and the jumps of $[x]$.
Imagine a simplified income-tax rule: no tax on the first $\text{โน}\,3$ lakh, $5\%$ on the part of the income between $\text{โน}\,3$ lakh and $\text{โน}\,7$ lakh, and $10\%$ on the part above $\text{โน}\,7$ lakh. The total tax $T$ is a function of the income $I$. Earn one more rupee and your tax rises by at most $10$ paise: the graph of $T$ has no jumps โ it is continuous. Now imagine a badly drafted rule that charged the higher rate on the whole income as soon as it crossed $\text{โน}\,7$ lakh: at that point the tax would leap from $\text{โน}\,20\,000$ to $\text{โน}\,70\,000$, and earning one rupee more would cost $\text{โน}\,50\,000$. That is a discontinuity, and real tax systems are designed to avoid it.
The sensible rule still has a feature worth noticing. The extra tax per extra rupee โ the slope of the graph, the marginal rate โ is $5\%$ just below $\text{โน}\,7$ lakh and $10\%$ just above. The graph is unbroken but has a corner there, and at a corner the slope is not defined: $T$ is continuous but not differentiable at $I=7$ lakh. This section makes both ideas precise using the limits of Section 7.1. JEE Main tests them in almost every paper: find the constants that make a piecewise function continuous or differentiable, count the points where a function built from $|\ |$, $[\ ]$ or $\max/\min$ fails to be continuous or differentiable, or evaluate a derivative directly from its definition.
Continuity at a Point and Kinds of Discontinuity
Let $f$ be defined on an open interval containing $a$. Then $f$ is continuous at $a$ if
$$\lim_{x\to a}f(x)=f(a),$$that is: (i) $f(a)$ is defined, (ii) the limit exists โ LHL $=$ RHL โ and (iii) the limit equals $f(a)$. If only $\displaystyle\lim_{x\to a^-}f(x)=f(a)$ holds, $f$ is left-continuous at $a$; if only $\displaystyle\lim_{x\to a^+}f(x)=f(a)$, right-continuous. If $f$ is not continuous at a point $a$ of its domain, it is discontinuous there.
$f$ is continuous on an open interval $(a,b)$ if it is continuous at every point of it, and on a closed interval $[a,b]$ if it is continuous on $(a,b)$, right-continuous at $a$ and left-continuous at $b$. A continuous function is one that is continuous at every point of its domain. Informally, its graph over an interval can be drawn without lifting the pen.
Note the words "of its domain". $\dfrac1x$ is continuous at every point where it is defined โ it is a continuous function โ even though its graph has two separate branches. When a JEE question asks where $\dfrac1{x-1}$ "is discontinuous" in $\mathbb{R}$, it means $x=1$, where the function is not even defined; read such questions in that sense.
Suppose $f$ is defined near $a$, but not continuous at $a$ (or not defined at $a$).
- Removable: $\displaystyle\lim_{x\to a}f(x)=L$ exists, but $f(a)\ne L$ or $f(a)$ is undefined. Redefining $f(a)=L$ makes $f$ continuous at $a$.
- Jump (finite discontinuity): both one-sided limits are finite but different; the jump is $\left|\text{RHL}-\text{LHL}\right|$.
- Infinite: at least one one-sided limit is $\pm\infty$.
- Oscillatory: the values oscillate and at least one one-sided limit fails to exist, as for $\sin\dfrac1x$ at $0$.
The last three are non-removable: no choice of $f(a)$ mends them.
If $f$ and $g$ are continuous at $a$, then so are $f+g$, $f-g$, $fg$ and $cf$, and so is $\dfrac fg$ provided $g(a)\ne0$. If $g$ is continuous at $a$ and $f$ is continuous at $g(a)$, then $f\circ g$ is continuous at $a$.
Proof. The first part is Theorem 7.4 with $L=f(a)$, $M=g(a)$: for instance $\lim(fg)=f(a)g(a)=(fg)(a)$. For the composite: as $x\to a$, $g(x)\to g(a)$; and $f$ is continuous at $g(a)$, so $f(g(x))\to f(g(a))$. $\blacksquare$ The converse fails: $[x]$ and $\{x\}$ are both discontinuous at every integer, yet their sum $[x]+\{x\}=x$ is continuous everywhere.
Polynomials are continuous on $\mathbb{R}$; a rational function is continuous wherever its denominator is non-zero. $\sin x$, $\cos x$, $a^x$ ($a\gt0$) and $|x|$ are continuous on $\mathbb{R}$; $\tan x$, $\cot x$, $\sec x$, $\operatorname{cosec}x$, $\log_ax$ and $\sqrt[n]{x}$ are continuous on their domains; and the inverse of a continuous strictly monotonic function on an interval is continuous. $[x]$ and $\{x\}$ are continuous at every non-integer and have a jump of size $1$ at every integer; $\operatorname{sgn}x$ is continuous except at $0$.
Proof for $\sin$ and $\cos$. $|\sin(a+h)-\sin a|$ $=\left|2\cos\!\left(a+\tfrac h2\right)\sin\tfrac h2\right|$ $\le2\left|\tfrac h2\right|=|h|\to0$, using $|\sin u|\le|u|$ from Figure 7.2; similarly for $\cos$. Polynomials and rational functions follow from Theorem 7.4; $|x|$ from $\big||x|-|a|\big|\le|x-a|$. $\blacksquare$ With Theorem 7.10, every function built from these by $+,-,\times,\div$ and composition is continuous wherever it is defined โ so discontinuities can only hide at the points where a formula breaks down or changes.
$f(x)=\dfrac{x^2-1}{x-1}$ for $x\ne1$ and $f(1)=2$. At $x=1$, $f$ is
Properties of Continuous Functions
A continuous function on a closed interval cannot skip a value and cannot escape to infinity. These two facts are the theoretical backbone of root-finding and of the maxima and minima of Section 7.4.
If $f$ is continuous on $[a,b]$ and $k$ is any number between $f(a)$ and $f(b)$, then $f(c)=k$ for at least one $c\in[a,b]$. In particular, if $f(a)$ and $f(b)$ have opposite signs, $f$ has a zero in $(a,b)$.
If $f$ is continuous on a closed interval $[a,b]$, then $f$ is bounded there and attains a greatest and a least value: there are $c,d\in[a,b]$ with $f(c)\le f(x)\le f(d)$ for all $x\in[a,b]$.
Both theorems rest on the completeness of the real numbers (the real line has no gaps), so we accept them without proof; the pictures are convincing โ an unbroken curve from below the line $y=k$ to above it must cross it. Every hypothesis matters. $\dfrac1x$ on $(0,1]$ is continuous but unbounded (the interval is not closed). $f(x)=x$ on $[0,1)$ and $f(1)=0$ is defined on a closed interval but has no greatest value (it is discontinuous at $1$). $[x]$ on $[0,2]$ jumps from $0$ to $1$ and never takes the value $\tfrac12$.
In the lab below choose the jump function ($f(x)=[x]$ for $x\ne1$, $f(1)=k$). Which value of the slider $k$ makes $f$ continuous at $x=1$?
$f$ is continuous on $[0,2]$ with $f(0)=3$ and $f(2)=-1$. Which statement must be true?
Differentiability
For a function given by a graph, the slope of the chord from $P=(a,f(a))$ to a nearby point $Q=(a+h,f(a+h))$ is the difference quotient $\dfrac{f(a+h)-f(a)}{h}$. As $h\to0$, $Q$ slides towards $P$ and the chord turns towards the tangent at $P$. If $f(t)$ is the position of a car at time $t$, the same quotient is the average velocity over $[a,a+h]$, and its limit is the speedometer reading of the opening paragraph of Section 7.1.
Let $f$ be defined on an open interval containing $a$. $f$ is differentiable at $a$ if the limit
$$f'(a)=\lim_{h\to0}\frac{f(a+h)-f(a)}{h}=\lim_{x\to a}\frac{f(x)-f(a)}{x-a}$$exists as a real number; $f'(a)$ is the derivative of $f$ at $a$ โ the slope of the tangent to $y=f(x)$ at $(a,f(a))$, and the instantaneous rate of change of $f$ at $a$. Computing $f'(a)$ straight from this limit is called differentiating from first principles.
The left-hand derivative and right-hand derivative at $a$ are
$$Lf'(a)=\lim_{h\to0^-}\frac{f(a+h)-f(a)}{h},\qquad Rf'(a)=\lim_{h\to0^+}\frac{f(a+h)-f(a)}{h}.$$By Theorem 7.3, $f$ is differentiable at $a$ if and only if both exist (finite) and are equal. $f$ is differentiable on $(a,b)$ if it is differentiable at every point of it, and on $[a,b]$ if, in addition, $Rf'(a)$ and $Lf'(b)$ exist. The function $x\mapsto f'(x)$ is the derivative $f'$, also written $\dfrac{dy}{dx}$ or $\dfrac{d}{dx}f(x)$.
If $f$ is differentiable at $a$, then $f$ is continuous at $a$. The converse is false.
Proof. For $h\ne0$, $f(a+h)-f(a)=h\cdot\dfrac{f(a+h)-f(a)}{h}$. As $h\to0$ the right side tends to $0\cdot f'(a)=0$ (Theorem 7.4), so $f(a+h)\to f(a)$. $\blacksquare$ For the converse take $f(x)=|x|$ at $0$: it is continuous, but $\dfrac{|h|}{h}$ is $-1$ for $h\lt0$ and $1$ for $h\gt0$, so $Lf'(0)=-1\ne1=Rf'(0)$ โ a corner. Read the theorem backwards too: a function that is not continuous at $a$ cannot be differentiable there. That disposes of $[x]$ at every integer at once.
A continuous function can fail to be differentiable in three ways: a corner (finite one-sided derivatives that differ, as for $|x|$), a vertical tangent (the quotient tends to $\pm\infty$, as for $\sqrt[3]{x}$ at $0$, where $\tfrac{h^{1/3}}{h}=h^{-2/3}\to\infty$), or endless wiggling (as for $x\sin\tfrac1x$ at $0$, where the quotient is $\sin\tfrac1h$).
For all $x$ in the stated domains:
$$\frac{d}{dx}x^n=nx^{n-1},\qquad \frac{d}{dx}e^x=e^x,\qquad \frac{d}{dx}\ln x=\frac1x\ (x\gt0),$$ $$\frac{d}{dx}\sin x=\cos x,\qquad \frac{d}{dx}\cos x=-\sin x,$$where $n$ is a positive integer ($x\in\mathbb{R}$), or any rational number with $x\gt0$.
Proof. Each is a standard limit of Section 7.1 in disguise. $x^n$: with $t=x+h$, $\dfrac{t^n-x^n}{t-x}\to nx^{n-1}$ (Theorem 7.5). $\sin$: $\dfrac{\sin(x+h)-\sin x}{h}$ $=\cos\!\left(x+\tfrac h2\right)\cdot\dfrac{\sin(h/2)}{h/2}\to\cos x$ (Theorem 7.7). $\cos$: $\dfrac{\cos(x+h)-\cos x}{h}$ $=-\sin\!\left(x+\tfrac h2\right)\cdot\dfrac{\sin(h/2)}{h/2}\to-\sin x$. $e^x$: $\dfrac{e^{x+h}-e^x}{h}=e^x\cdot\dfrac{e^h-1}{h}\to e^x$ (Theorem 7.8). $\ln$: $\dfrac{\ln(x+h)-\ln x}{h}=\dfrac1x\cdot\dfrac{\ln(1+h/x)}{h/x}\to\dfrac1x$. $\blacksquare$ Section 7.3 adds the rules (sum, product, quotient, chain) that produce the derivative of every other function from these.
In the lab below choose $x^2\sin\frac1x$ (with $f(0)=0$) at $a=0$. Its graph wiggles infinitely often near $0$. As $h$ shrinks to $0.001$, what do the two difference quotients do?
Which of these functions is differentiable at $x=0$?
Differentiability of Piecewise, Modulus and Greatest-integer Functions
Inside an interval where $f$ is given by one standard formula, Theorems 7.10, 7.11 and 7.15 (and the rules of Section 7.3) settle continuity and differentiability at once. The real questions are at the junctions where the formula changes, at the zeros of expressions inside $|\ |$, and where expressions inside $[\ ]$ cross integers.
Suppose $f(x)=g(x)$ for $a-\delta\lt x\le a$ and $f(x)=k(x)$ for $a\lt x\lt a+\delta$, where $g$ and $k$ are differentiable on an open interval containing $a$. Then $Lf'(a)=g'(a)$; $Rf'(a)$ exists if and only if $k(a)=g(a)$, and then $Rf'(a)=k'(a)$. Hence
$$f\ \text{is differentiable at }a\iff g(a)=k(a)\ \text{and}\ g'(a)=k'(a).$$Proof. For $h\lt0$: $\dfrac{f(a+h)-f(a)}{h}=\dfrac{g(a+h)-g(a)}{h}\to g'(a)$. For $h\gt0$: $\dfrac{f(a+h)-f(a)}{h}$ $=\dfrac{k(a+h)-k(a)}{h}+\dfrac{k(a)-g(a)}{h}$; the first part tends to $k'(a)$, and the second tends to $\pm\infty$ unless $k(a)=g(a)$. $\blacksquare$ So the recipe is: first make the pieces meet, then make their slopes agree. Comparing slopes alone is not enough: $f(x)=x$ for $x\le0$ and $x+1$ for $x\gt0$ has slope $1$ on both sides but a jump, so it is not differentiable at $0$.
- Let $g$ be differentiable at $a$ with $g(a)=0$. Then $|g|$ is differentiable at $a$ if and only if $g'(a)=0$. If $g'(a)\ne0$, $|g|$ has a corner at $a$ with one-sided derivatives $\mp|g'(a)|$.
- Let $\varphi$ be continuous at $a$. Then $f(x)=|x-a|\,\varphi(x)$ is differentiable at $a$ if and only if $\varphi(a)=0$.
Proof. (1) $\dfrac{|g(a+h)|-0}{h}$ $=\dfrac{|h|}{h}\cdot\left|\dfrac{g(a+h)-g(a)}{h}\right|$ $\to\pm|g'(a)|$ as $h\to0^\pm$; these agree only if $g'(a)=0$. (2) $\dfrac{|h|\,\varphi(a+h)}{h}\to\pm\varphi(a)$ as $h\to0^\pm$. $\blacksquare$ So $|x^2-1|$ has corners at $\pm1$ (simple zeros), but $|x^3|$ and $|(x-1)^2(x+2)|$ at $x=1$ are smooth (repeated zeros). And $|x-1|(x^2-1)$ is differentiable at $1$, because the factor $x^2-1$ vanishes there.
- List the suspicious points: junctions of piecewise formulas; zeros of expressions inside $|\ |$; points where an expression inside $[\ ]$ or $\{\ \}$ crosses an integer; crossings of the graphs in $\max\{\cdot\}$ or $\min\{\cdot\}$; points where a root like $\sqrt[3]{\ }$ has argument $0$.
- At each, check continuity first: a discontinuity is automatically a point of non-differentiability (Theorem 7.14).
- Where $f$ is continuous, compare the one-sided derivatives: differentiate each piece (Theorem 7.16), or use Theorem 7.17 for moduli โ simple zero $\Rightarrow$ corner, repeated zero or a vanishing factor $\Rightarrow$ smooth.
- Count only the points inside the stated interval, and never count a point twice.
Rolle's theorem and Lagrange's mean value theorem are in the JEE Advanced 2026 syllabus but not in the JEE Main 2026 list (they were removed from JEE Main from 2024). This box is for interest only; nothing in it is used in the exercises, the Exam corner or the quiz.
Rolle: if $f$ is continuous on $[a,b]$, differentiable on $(a,b)$ and $f(a)=f(b)$, then $f'(c)=0$ for some $c\in(a,b)$ โ somewhere the tangent is horizontal. Mean value theorem: if $f$ is continuous on $[a,b]$ and differentiable on $(a,b)$, then $f'(c)=\dfrac{f(b)-f(a)}{b-a}$ for some $c\in(a,b)$ โ somewhere the tangent is parallel to the chord. For $f(x)=x^3$ on $[0,2]$: $3c^2=\tfrac{8-0}{2}=4$, so $c=\tfrac{2}{\sqrt3}\approx1.155$. Both theorems need every hypothesis: $|x|$ on $[-1,1]$ has equal end values but no horizontal tangent, because of the corner at $0$.
1. A $\tfrac00$ formula is not a discontinuity by itself. When $f(a)$ is defined separately, compare it with the limit; continuity may well hold.
2. Continuity first. At a junction, equal slope formulas mean nothing if the pieces do not meet: $x$ and $x+1$ glued at $0$ have equal slopes but a jump, so no derivative (Theorem 7.16).
3. Differentiable $\Rightarrow$ continuous, never the reverse. $|x|$, $\sqrt[3]{x}$ and $x\sin\tfrac1x$ are continuous at $0$ but not differentiable there.
4. Not every zero of a modulus is a corner. $|g|$ has a corner at a simple zero only; $|x^3|$, $|x|\,x$, $|x-1|(x-1)$ and $|x-1|\sin\pi x$ are differentiable at the zero (Theorem 7.17).
5. $[g(x)]$ breaks where $g(x)$ crosses an integer, not where $x$ does. $[x^2]$ jumps at $x=\sqrt2$; and $[g(x)]$ at a point where $g$ touches an integer from one side only (like $[\sin x]$ at $\tfrac\pi2$) is still discontinuous.
$f(x)=|x-1|\,\varphi(x)$, where $\varphi$ is continuous and $\varphi(1)=3$. At $x=1$, $f$ is
Exercises
Unless an interval is named, functions are considered on their natural domains. For "find the number of points", justify each point you count.
- 1 $f(x)=\dfrac{x^2-25}{x-5}$ for $x\ne5$ and $f(5)=k$. Find $k$ for continuity at $5$.
- 2 $f(x)=\dfrac{1-\cos4x}{x^2}$ for $x\ne0$ and $f(0)=k$. Find $k$ for continuity at $0$.
- 3 $f(x)=3x+a$ for $x\lt2$ and $f(x)=x^2+1$ for $x\ge2$. Find $a$ for continuity at $2$.
- 4 $f(x)=\dfrac{\sqrt{x+9}-3}{x}$ for $x\ne0$ and $f(0)=k$. Find $k$ for continuity at $0$.
- 5 Name the kind of discontinuity: (a) $\operatorname{sgn}x$ at $0$; (b) $\dfrac{1}{(x+2)^2}$ at $-2$; (c) $\dfrac{x^3+8}{x+2}$ at $-2$ (give the limit there).
- 6 $f(x)=x+a$ for $x\lt1$, $f(x)=bx^2$ for $1\le x\le3$, $f(x)=2x+12$ for $x\gt3$. Find $a$ and $b$ so that $f$ is continuous on $\mathbb{R}$, and give $a+b$.
- 7 Find the number of points in $(0,3)$ where $f(x)=[x^2]$ is discontinuous.
- 8 Use the intermediate value theorem to show that $x^4-3x-1=0$ has at least two real roots.
- 9 Let $u=\dfrac{1}{x-1}$ and $f=\dfrac{1}{u^2+u-2}$. Find all points where the composite $f$, as a function of $x$, is discontinuous (undefined), and say how many there are.
- 1 Show that $x^3-5x+1=0$ has three real roots, and find consecutive integers between which each lies. How many real roots are there?
- 2 Give an example of a function on $[0,1]$ that has no greatest value, and say which hypothesis of Theorem 7.13 it violates.
- 3 $f$ is continuous on $[0,1]$ and $0\le f(x)\le1$ for all $x$. Prove that $f(c)=c$ for some $c\in[0,1]$ (a fixed point).
- 4 $[x]$ and $\{x\}$ are discontinuous at every integer. Is $[x]+\{x\}$ continuous? At which integers is $[x]\cdot\{x\}$ continuous?
- 5 Show that $\cos x=x$ has a root in $\left(0,\tfrac\pi2\right)$ and find it to two decimal places by halving the interval.
- 6 (Modelling) A taxi charges $\text{โน}\,50$ for the first $2$ km and $\text{โน}\,15$ for each further kilometre or part of a kilometre. Write the fare $F(x)$ for a trip of $x$ km using $[\ ]$, find the fare for $7.3$ km, and find where $F$ is discontinuous.
- 1 $f(x)=x^2-4x$: find $f'(3)$ from first principles.
- 2 $f(x)=\dfrac1x$: find $f'(x)$ from first principles, and $f'(2)$.
- 3 $f(x)=\sqrt{2x+1}$: find $f'(4)$ from first principles.
- 4 $f(x)=\cos x$: find $f'\!\left(\tfrac\pi2\right)$ from first principles.
- 5 $f(x)=|x^2-9|$: find $Lf'(3)$ and $Rf'(3)$.
- 6 Show that $f(x)=x^{2/3}$ is continuous but not differentiable at $0$.
- 7 Show that $f(x)=x^2\sin\tfrac1x$ ($f(0)=0$) is differentiable at $0$, but $g(x)=x\sin\tfrac1x$ ($g(0)=0$) is not.
- 8 If $f$ is differentiable at $a$, show that $\displaystyle\lim_{h\to0}\frac{f(a+3h)-f(a-h)}{h}=4f'(a)$, and evaluate it for $f(x)=x^3$, $a=1$.
- 9 (Modelling) A stone dropped from a cliff has fallen $s(t)=4.9t^2$ metres after $t$ seconds. Find its speed at $t=2$ s from first principles.
- 1 $f(x)=x^2$ for $x\le1$ and $2x-1$ for $x\gt1$. Is $f$ differentiable at $1$? If so, find $f'(1)$.
- 2 $f(x)=ax^2+1$ for $x\le1$ and $x+b$ for $x\gt1$ is differentiable at $1$. Find $a$, $b$ and $a+b$.
- 3 $f(x)=x^3$ for $x\le2$ and $ax+b$ for $x\gt2$ is differentiable at $2$. Find $a$ and $b$.
- 4 Find the number of points where $f(x)=|x^2-5x+6|+|x-4|$ is not differentiable.
- 5 Find the points where $f(x)=|x^3-x^2|$ is not differentiable.
- 6 Find the number of points in $(-1,2)$ where $f(x)=x\,[x]$ is not differentiable.
- 7 Where is $f(x)=\max\{x,\ x^2\}$ not differentiable?
- 8 $f(x)=|x-2|\,(x^2+cx+2)$ is differentiable at $x=2$. Find $c$.
- 9 Find the number of points in $(0,2\pi)$ where $f(x)=[\sin x]$ is not differentiable.
E1. JEE Main ยท MCQ Let $f(x)=\dfrac{e^{2x}-1}{x}$ for $x\lt0$, $f(0)=a$, and $f(x)=\dfrac{\sqrt{1+x}-1}{bx}$ for $x\gt0$. If $f$ is continuous at $0$, then (A) $a=2,\ b=\tfrac14$ (B) $a=2,\ b=4$ (C) $a=\tfrac12,\ b=\tfrac14$ (D) $a=\tfrac14,\ b=2$
E2. JEE Main ยท Numerical Find the number of points in the open interval $(-1,2)$ at which $f(x)=[x^2]$ is discontinuous. Give the answer to the nearest integer.
E3. JEE Main ยท MCQ Let $k$ be an integer and $f(x)=x^k\sin\dfrac1x$ for $x\ne0$, $f(0)=0$. Then $f$ is continuous but not differentiable at $x=0$ exactly when (A) $k=2$ (B) $k=1$ (C) $k\ge1$ (D) $k\ge2$
E4. JEE Main ยท Numerical $f(x)=ax^2+bx$ for $x\lt1$ and $f(x)=\ln x+3$ for $x\ge1$. If $f$ is differentiable at $x=1$, find $a^2+b^2$. Give the answer to the nearest integer.
E5. JEE Main ยท MCQ Which function is continuous at $x=0$ but not differentiable there? (A) $x|x|$ (B) $x^2\sin\dfrac1x$ with $f(0)=0$ (C) $|\sin x|$ (D) $\operatorname{sgn}x$
E6. JEE Main ยท Numerical Let $f(x)=(x^2-1)\,|x^2-3x+2|+|x-4|\cos x$. Find the sum of all points at which $f$ is not differentiable. Give the answer to the nearest integer.
Research question. Speeds in sport, traffic and medicine are computed from sampled positions โ a difference quotient with a small but non-zero $h$. How small should $h$ be, and is "as small as possible" really best?
Why it matters. Timing gates in athletics, GPS watches, wearable heart-rate monitors and car crash recorders all estimate derivatives from data. A large $h$ blurs the instant you care about (truncation error); a tiny $h$ divides a difference of nearly equal, rounded numbers by a tiny number (rounding error). Engineers who design these systems choose the sampling interval to balance the two.
What to do.
- Take $f(x)=e^x$ at $a=1$, where the exact derivative is $e$. For $h=10^{-1},10^{-2},\dots,10^{-15}$ compute the forward quotient $\dfrac{f(a+h)-f(a)}{h}$ and its error.
- Plot the error against $h$ on logarithmic scales. You should see a "V". Where is its bottom?
- Repeat with the central quotient $\dfrac{f(a+h)-f(a-h)}{2h}$ (the average of the left and right quotients of Interactive 2). Where is its best $h$, and how small is its error?
- Explain the left arm of the V using the size of the rounding error in $f$ (about $10^{-16}$ of its value), and the right arm using the curvature of the graph.
Tools: Spreadsheet or Python with ordinary floating-point numbers.
Hand in: The table, the logโlog plot with both quotients, the best $h$ for each, and a recommendation (with reasons) for the sampling interval of a GPS watch that records position to the nearest metre.
Going further. Why can't the central quotient detect a corner? Compute it for $|x|$ at $0$ and compare with the one-sided quotients.
๐งช Self-check quiz
Q1. $f(x)=\dfrac{x^2-4}{x-2}$ for $x\ne2$ and $f(2)=k$. $f$ is continuous at $2$ when $k$ equals
Q2. For a function $f$ defined near $a$, which statement is always true?
Q3. The number of points at which $f(x)=|x|+|x-1|$ is not differentiable is
Q4. At $x=3$, the function $f(x)=[x]$ is
Q5. For $f(x)=x|x|$, $f'(0)$ is