← All 70 questions
Question 12·St John's College·2025·Three parts on one prompt: the calculation is reachable by anyone who has met the definition, and the two logic parts are what separate candidates who know definitions from candidates who have memorised rules
Differentiation from first principles, and the logic between continuity and differentiability
12–18 minutes at interview pace
Live video, shared whiteboard. Everything under BOARD is written with the pen; everything under SAY is spoken over it, at the same time. Never write a line in silence, and never say a line you have not put on the board.
Differentiate x2sin⁡(x) from first principles. If a function is discontinuous at a point, can it be differentiable there? Can you think of a function that is continuous everywhere but differentiable nowhere?
Answer: (a) f′(x)=x2cos⁡x+2xsin⁡x. (b) No — differentiability at x forces continuity at x. (c) Yes — the Takagi function T(x)=∑n≥02−ndist⁡(2nx,ℤ) is continuous everywhere and differentiable nowhere.

The whiteboard, beat by beat

1 · Orient · beat 1 of 9

Three questions, and only one definition is allowed

f(x)=x2sin⁡x,f′(x)=limh→0⁡f(x+h)−f(x)h— the only tool I will use
rules OFF: product, chain, table
(a) the calculation
(b) discontinuous at x0 ⇒ differentiable there?
(c) continuous everywhere, differentiable nowhere?
What you say, out loud

There are really three questions here and they are not testing the same thing. The first is mechanical: can I work from the definition without reaching for a rule. The other two are about the logic between continuity and differentiability, and I will answer those with proofs rather than opinions.

For part one the only thing I write down is the difference quotient. I am deliberately not using the product rule, because this calculation is the product rule's proof in one particular case: using the rule here would be circular. What I am allowed is the angle-addition formula for sine, two elementary limits, and continuity.

One decision before I start: x stays a symbol. If I put a number in for x I get a number instead of a function, and if I ever divide by x I silently lose the case x equals nought. So x is arbitrary but fixed, and h is the thing that tends to nought.

Why this beat exists: The question's own key-points page says this item tests rigour over recall. Saying which tools are banned, and why, is the first piece of evidence.
2 · Set up · beat 2 of 9

Split the increment into three named pieces before taking any limit

sin⁡(x+h)=sin⁡xcos⁡h+cos⁡xsin⁡h,(x+h)2=x2+2xh+h2
f(x+h)−f(x)=x2sin⁡x(cos⁡h−1)⏟A+x2cos⁡xsin⁡h⏟B+(2xh+h2)sin⁡(x+h)⏟C
Check x=1, h=0.1: f(1.1)−f(1)=0.236890, A+B+C=0.236890
What you say, out loud

Two expansions do all the work. Sine of a sum is sine x cosine h plus cosine x sine h. It is not sine x plus sine h, and that one slip is the usual way to lose this question. And x plus h squared is x squared plus two x h plus h squared.

I multiply out and regroup by hand into three pieces, A, B and C, chosen so that each one wants exactly one limit: A wants the cosine one, B wants the sine one, and C will need nothing beyond continuity. Structurally this is the product rule's own proof split: the increment of u times the shifted v, plus u times the increment of v, with the second bracket then opened by the angle formula.

Before I pass to any limit I check the regrouping as an identity at a concrete pair of numbers. At x equals one and h equals a tenth, f of 1.1 minus f of 1 is 0.236890, and so is A plus B plus C. Cheap insurance, and it catches sign errors that no amount of staring will find.

Why this beat exists: Name the pieces and say in advance which limit each consumes. The interviewer is reading the plan, not the algebra.
3 · Draw · beat 3 of 9

The definition is a statement about slopes — so look at the slopes

chord slope through (1,f(1)) and (q,f(q))=f(q)−f(1)q−1
q=0.2↦1.0419,q=0.5↦1.4432,q=0.75↦1.8322⟶2.2232=2sin⁡1+cos⁡1
Definition: f′(1) = chord-slope limit
1.04191.44321.8322(1, 0.8415)tangent slope 2.2232chord slopes 1.0419, 1.4432, 1.8322 as q goes to 1y = x² sin x0.51.01.51234
Three chords through (1, f(1)) have slopes 1.0419, 1.4432, 1.8322 as the second point slides in, and the tangent at that point has slope 2 sin 1 + cos 1 = 2.223244. The picture proves the chords have a limit to aim at; only the algebra proves the formula for every x.
What you say, out loud

Let me draw the object I claim exists, because the definition is a statement about slopes and I want to see one. The amber curve is y equals x squared sine x; the point I am standing on is x equals one, f of one, which is 0.8415.

The three grey lines are chords through that point and a second point at q equals 0.2, 0.5 and 0.75. Their slopes are 1.0419, 1.4432 and 1.8322; plainly climbing. The blue line is the tangent, slope 2.2232, which is 2 times sine of 1 plus cosine of 1.

So the difference quotient is not an abstraction: it is the reading of a slope while the second intersection slides in. What the drawing does not do is prove anything for general x. It fixes the target; the algebra has to deliver it.

Why this beat exists: Say what the drawing proves (the chord slopes settle at x = 1) and what it does not (the formula for all x).
4 · Compute · beat 4 of 9

One limit per piece, and one named fact per limit

Ah=x2sin⁡x⋅cos⁡h−1h⟶x2sin⁡x⋅0,Bh=x2cos⁡x⋅sin⁡hh⟶x2cos⁡x⋅1
Ch=(2x+h)sin⁡(x+h)⟶2xsin⁡x (continuity)
f′(x)=x2cos⁡x+2xsin⁡xfor every x∈ℝ, including x=0
What you say, out loud

Now one limit at a time, and I only split the limit into three because each part provably converges on its own. A over h is x squared sine x times cosine h minus one over h, and that quotient tends to nought. B over h is x squared cosine x times sine h over h, and that tends to one. For C the h cancels against the h inside two x h plus h squared, leaving two x plus h times sine of x plus h, which tends to two x sine x by continuity of sine alone: no third borrowed fact.

Adding the three gives x squared cosine x plus two x sine x, and notice that came out of the definition and nothing else.

Also notice where the halves came from. The x squared cosine x is piece B, the two x sine x is piece C. The angle-addition formula created the extra piece A, and A is exactly the term that has to vanish, and it does, at the rate h over two.

Why this beat exists: A limit split is legal only once every part converges; saying that out loud is the rigour being tested here.
5 · Check numerically · beat 5 of 9

Do not believe the formula until the quotient has been tabulated

h0.10.010.001f(1+h)−f(1)h2.3688992.2382182.224745error+0.145655+0.014974+0.001501error/h1.45651.49741.5009
f′′(1)=sin⁡1+4cos⁡1=3.002680,12f′′(1)=1.501340✓
x=0: hsin⁡h=9.999998×10−7 at h=10−3, so f′(0)=0
x=1: h=−10−3 gives 2.221743, mirrors +10−3
What you say, out loud

I do not trust a first-principles answer until I have seen it numerically. At x equals one the formula predicts 2.223244. With h equal to a tenth the quotient gives 2.368899; with a hundredth, 2.238218; with a thousandth, 2.224745. It is closing on the target.

The errors are 0.145655, 0.014974 and 0.001501. Divide each error by h and you get 1.4565, 1.4974 and 1.5009; settling on 1.5. That is not luck: the chord slope should be wrong by half of f double prime at one, times h, and f double prime of one is sine of 1 plus 4 times cosine of 1, which is 3.002680. Its half is 1.501340. Agreement to three decimals tells me the quotient, the arithmetic and the formula are the same object.

The case I actually worried about is x equals nought, where the h in the denominator is doing all the work. There the quotient is exactly h sine h, which at a thousandth is 9.999998 times ten to the minus seven, heading to nought, as the formula promises. And from h equals minus a thousandth at x equals one the quotient is 2.221743, the mirror image of the plus side, so nothing here is a one-sided trick.

Why this beat exists: Read the rate off the errors, not just the agreement. Every figure on this line was computed, not estimated.
6 · Justify · beat 6 of 9

The two facts I borrowed, proved from geometry

triangle⊂sector⊂tangent triangle ⟹ 12sin⁡h≤12h≤12tan⁡h ⟹ cos⁡h≤sin⁡hh≤1
cos⁡h−1h=cos2⁡h−1h(1+cos⁡h)=−sin⁡hh⋅sin⁡h1+cos⁡h⟶−1⋅02=0
even in h: h→0−, same limit
sin⁡h/h=0.999999833,(cos⁡h−1)/h=−0.0005(h=10−3)
No l'Hôpital: it presumes (sin⁡x)′
half sin hhalf h (sector)half tan hP = (1, 0)A = (cos h, sin h)Ohhalf sin h <= half h <= half tan hcos h <= sin h / h <= 1h drawn large for clarity
The triangle of area (1/2) sin h sits inside the sector of area (1/2) h, which sits inside the tangent triangle of area (1/2) tan h. Dividing by (1/2) sin h gives cos h ≤ sin h / h ≤ 1 — the squeeze that produces sin h / h → 1 with no calculus at all.
What you say, out loud

Those two limits are the only facts I have borrowed, so they need proving from geometry rather than from a table. The first is the sector squeeze. The triangle with base one and height sine h lies inside the sector of angle h, which lies inside the tangent triangle with height tangent h. Their areas are a half sine h, a half h, and a half tangent h, so sine h is at most h, and h is at most tangent h. Divide by sine h and invert, and you get cosine h at most sine h over h at most one. Cosine h tends to one by continuity, so the squeeze hands over the limit one. For negative h nothing changes, because both the numerator and the denominator flip sign.

The second fact falls out of the first by conjugating. Multiply top and bottom of cosine h minus one over h by cosine h plus one; the numerator becomes cosine squared h minus one, that is minus sine squared h. Split it into minus sine h over h, times sine h over one plus cosine h, and the limit is minus one times nought over two, which is nought. That is why piece A vanishes, and it also shows it vanishes like h over two: at h equal to a thousandth, the board figure for the quotient is minus 0.0005.

What I did not do is call l'Hopital on sine h over h. That rule needs the derivative of sine, which is precisely what this exercise is proving, so it would assume the answer. If somebody asks for the derivative of sine from first principles, the squeeze is the honest route.

Why this beat exists: This beat is where the question's stated aim — rigour over recall — is actually demonstrated. Volunteering the circularity and then avoiding it is the signal.
7 · Cross-check · beat 7 of 9

A second route to the same function — and it explains the product rule

check only, not proof:  (x2)′sin⁡x+x2(sin⁡x)′=2xsin⁡x+x2cos⁡x✓
A+B=x2[sin⁡(x+h)−sin⁡x]=u(v(x+h)−v(x)),C=[u(x+h)−u(x)]v(x+h)
⟹ (uv)′=u′v+uv′for any differentiable u,v
What you say, out loud

Second route, purely as a check. If I allow myself the rule I refused earlier, the product rule gives two x sine x plus x squared cosine x, the same function. Two methods agree, so the answer is not an artefact of my algebra.

More to the point, look where the pieces landed. A plus B is x squared times the increment of sine, which is u times the increment of v. C is the increment of u times v, read at x plus h. Divide by h and let h go to nought, and I have just derived the product rule for this pair of functions.

Nothing about x squared and sine was special, so the same three lines prove the rule for any differentiable u and v. One hypothesis is worth naming: passing from v of x plus h to v of x needs v to be continuous at x, and differentiability gives that for free.

Why this beat exists: An independent route that also explains why the rule exists reads far better than a bare verification.
8 · Answer part (b) · beat 8 of 9

Discontinuous at a point: differentiable there? No — and here is the two-line reason

if f′(x) exists:f(x+h)−f(x)=h⋅f(x+h)−f(x)h⟶0⋅f′(x)=0
 differentiable at x⇒continuous at x 
contrapositive: discontinuous⇒not differentiable
jump: H(h)−H(0)h=1h=1000 (h=10−3)
left quotient≡0
hole: f(x)=sin⁡xx, f(0)=0: quotient 999.9998;repaired f(0)=1: quotient =−h6→0
What you say, out loud

Part b: no, and the reason is two lines. Suppose the derivative exists at x. Write the increment as h times the difference quotient. That quotient tends to f prime of x, so the product of the two limits is nought times f prime of x, which is nought. But saying the increment tends to nought is exactly continuity at the point. No extra hypotheses and no exceptions: differentiability at a point forces continuity at that point, and the contrapositive is the answer to b.

The failure is visible in the quotient, and I would rather quote numbers than say the slope is infinite. For a step at the origin the right-hand quotient is one over h, which is 1000 at h equal to a thousandth, while the left-hand quotient is identically nought. The two one-sided behaviours do not agree, so there is no limit at all, finite or infinite.

And a hole is as fatal as a jump. Define f to be sine x over x with f of nought equal to nought: that is discontinuous, and its quotient at a thousandth is 999.9998, blowing up like one over h. Repair the hole by defining f of nought to be one, and the quotient becomes minus h over six, which tends to nought, so the repaired function is differentiable at nought, with derivative nought. Continuity is the gate, and in this example opening it is enough to let differentiability through.

Why this beat exists: Answer with the proof and the contrapositive, then show the mechanism inside the quotient. 'Infinite slope at a jump' is the wrong reason and interviewers mark it down.
9 · Answer part (c), conclude and generalise · beat 9 of 9

Continuous everywhere, differentiable nowhere — a function you can write down

ϕ(t)=dist⁡(t,ℤ),T(x)=∑n=0∞2−nϕ(2nx),0≤T≤∑n2−n⋅12=1
M-test: 2−nϕ(2nx)≤2−n, ∑n2−n<∞ ⟹ uniform convergence⇒T∈C(ℝ)
level n: slope ±2−n2n=±1 over width 2−n
T(2−n)=∑k=0n−12−k⋅2k−n=n2n ⟹ T(2−n)−T(0)2−n=n→∞
x=13: quotients at h=±2−n
right: 0, −13;left: 1, +43forever
 (a) f′(x)=x2cos⁡x+2xsin⁡x;(b) no;(c) yes — T (Takagi 1903), or Weierstrass 
differentiable⇒continuous only, not conversely
|x|: one corner,T: everywhere
C[0,1]: nowhere-differentiables are generic
n=1n=2n=3n=4n=5sup T = 2/3, attained at x = 1/31/211/22/3grey dashed: level 0; green: levels 0-3; blue: levels 0-8; orange chords slope n
Takagi's function, drawn at levels 0, 0–3 and 0–8. Level n adds bumps of height 2^-n over width 2^-n, i.e. chords of slope exactly ±1, so the sizes shrink (continuity survives) while the slopes never settle (no tangent). The orange chords from the origin to (2^-n, n·2^-n) have slope n = 1, 2, 3, 4, 5: computed exactly, they run off to infinity.
What you say, out loud

Part c asks whether the converse can fail everywhere at once. Once is easy: the absolute value has a corner at nought and is smooth elsewhere. Everywhere needs a real witness, and here is one you can write down. Take the distance from t to the nearest integer, the grey triangle of height a half, and sum it at doubling frequency and halving height.

Continuity first, because this is the step people hand-wave. Each term is bounded by two to the minus n, the geometric series of those bounds converges, so the sum converges uniformly by the M-test, and a uniform limit of continuous functions is continuous. Uniformness is genuinely needed: x to the n on the interval from nought to one converges pointwise to a function that is nought inside and one at the end, and that limit is discontinuous.

Now the slopes. Level n is a zigzag of width two to the minus n whose pieces have slope plus or minus one exactly: halving the height and doubling the frequency cancel. So each new level shifts the chord slope over that window by another one, forever; the slopes never settle. At the origin I can compute it outright: T of two to the minus n is n times two to the minus n, because the first n levels each contribute two to the minus n and the rest are exact zeros. So the difference quotient at h equal to two to the minus n is exactly n, namely one, two, three, four, five, as the orange chords show. The chord slopes run away, so there is no tangent at nought.

At a typical point they do not run away, they oscillate, which is the more honest picture: at x equal to a third, in exact arithmetic, the one-sided quotients along h equal to plus and minus two to the minus n sit on four values forever: nought and minus a third from the right, and one and four thirds in absolute value from the left. Bounded, and still no derivative. So the answers are: part a, x squared cosine x plus two x sine x; part b, no, because differentiability forces continuity; and part c, yes, with Takagi's function as the witness. The only implication on the board runs one way, and the interesting boundary is that smoothness is the exception, not the rule: in the space of all continuous functions the nowhere-differentiable ones are generic.

Why this beat exists: Close with the three-part boxed answer, the one-way implication, and the failure boundary. Continuity of T must be argued by uniform convergence — that is the line the interviewer is waiting for.

Where the interviewer pushes next

“Does any of this depend on measuring angles in radians?”
What you say, out loud

It enters in exactly one place: the limit of sine h over h. The algebra, the three-piece split and the squeeze argument are all unit-free, but that single limit is where the choice of angle unit lands.

Feed the calculator an angle in degrees and the quotient stops at pi over 180. I get 0.0174524 at one degree, 0.01745328 at a tenth of a degree, and 0.0174532924 at a hundredth, converging to 0.0174532925, which is pi over 180.

So in degree measure the derivative of sine is pi over one hundred and eighty times cosine, and my answer would become two x sine x plus pi over one hundred and eighty times x squared cosine x. The factor hits piece B only, because piece C never touched that limit. Radians are not a convention here; they are the normalisation that makes that one limit equal to one and keeps the whole table of derivatives clean.

sin⁡(h∘)h⟶π180=0.0174532925,ddx[x2sin⁡(x∘)]=π180x2cos⁡(x∘)+2xsin⁡(x∘)
“Your derivative is continuous. Does a derivative have to be?”
What you say, out loud

Not necessarily, and it is worth having the witness ready. Take g of x equals x squared sine of one over x, with g of nought defined to be nought. At the origin the quotient is h sine of one over h, whose size is at most the size of h, so it tends to nought: g is differentiable at nought with derivative nought. Away from zero everything is smooth and the derivative is two x sine of one over x minus cosine of one over x.

That cosine term has no limit at nought. Put x equal to one over 200 pi, which is 0.00159155; then one over x is a whole multiple of two pi, the first term is negligible and the derivative is minus one. Put x equal to one over 399 pi, which is 0.00079777, and the cosine is minus one, so the derivative is plus one. Two points both within two thousandths of the origin where the derivative is two units apart.

So g is differentiable everywhere with a discontinuous derivative. Differentiable does not mean continuously differentiable; that is a bullet my x squared sine x happens to dodge, since it is smooth.

g(x)=x2sin⁡(1/x), g(0)=0:g′(0)=0,g′(x)=2xsin⁡(1/x)−cos⁡(1/x)→±1 as x→0
“You assumed both factors are differentiable. Is that necessary?”
What you say, out loud

It is sufficient, not necessary, and I would rather show you the gap than claim it away. Take u of x equals x and v of x equals the absolute value of x. Their product is x times the absolute value of x, and at the origin its difference quotient is h times the modulus of h over h, which is just the modulus of h: 0.1, 0.01 and 0.001 for the three h's I tried. So the product is differentiable at nought with derivative nought, while the absolute value is not differentiable there.

The mechanism is that a zero of one factor can absorb a corner of the other, the same absorption that made x squared tame the oscillation of sine of one over x in the previous question. My computation only ever used the existence of the two limits, so it proves the forward direction and gives no verdict when one of them fails.

u=x, v=|x|:h|h|−0h=|h|→0 ⟹ (uv)′(0)=0although v′(0) does not exist
“Is the origin just a special point for the Takagi function?”
What you say, out loud

At the origin the failure is blunt: the chord slopes are exactly n, so they run off. At a typical point they do not run off, they oscillate, which is why I would not try to prove the general theorem from the picture: Takagi's nineteen nought three argument has to track, at every point, which side of every triangle's peak the step lands on.

There is a clean way to see both at once. Over a step of two to the minus n only the first n levels move, and each of them moves by at most two to the minus n, so the function moves by at most n times two to the minus n, with equality at the origin. That bound still tends to nought, which is exactly why the function is continuous; divided by the step it is n, which is exactly why there is no derivative. The modulus of continuity is of order h log of one over h, so the function is Holder of every exponent below one and not Lipschitz at all.

For a completely different mechanism, Brownian sample paths are almost surely continuous and nowhere differentiable; there the failure comes from oscillation on every scale rather than from a fixed zigzag.

h=2−n:|T(x+h)−T(x)|≤n2−n for all x, with equality at x=0,n2−n2−n=n→∞

Traps on this question

  • Answering 'from first principles' with the product rule. The rule is the theorem this computation instantiates, so quoting it as the answer is circular; it belongs only as the labelled second check.
  • Expanding sin(x+h) as sin x + sin h. At x = 1, h = 0.1 that slip turns the quotient into 2.975073 instead of 2.368899, and it never settles on 2.223244 however small h gets — the angle-addition formula is the whole engine.
  • Calling (cos h − 1)/h equal to 0 'because cos h tends to 1'. That is 0/0, not a limit; conjugating shows its true size is −h/2 (−0.0005 at h = 0.001). And dispatching sin h/h with l'Hôpital assumes (sin x)′, which is what the question is proving.
  • Dividing by x, or setting x to a convenient number to tidy the algebra: the answer must be a function valid at x = 0, where the h in the denominator is the only thing doing work. Relatedly, answering (b) with 'the slope is infinite at a jump' — the honest reason is that no limit exists (right quotient 1000, left quotient 0 at h = 0.001), and a removable hole is just as fatal (999.9998) until it is repaired.
  • Answering (c) with |x| — a corner at one point is not 'nowhere' — or writing down the blancmange series and asserting it is continuous. Pointwise convergence is not enough (x^n on [0,1] jumps at 1); the M-test against 2^(-n) is what buys uniform convergence and hence continuity.

What gets written on the assessor’s form

  • Wrote the definition and the banned tools before computing, and explained why the product rule was off-limits rather than merely avoiding it.
  • Split the increment into three named pieces, declared in advance which limit each consumes, and verified the regrouping as an identity at x = 1, h = 0.1.
  • Kept x arbitrary, checked the formula separately at x = 0, and read the rate off the tabulated errors (1.5009 against ½f″(1) = 1.50134) instead of stopping at decimal agreement.
  • Proved sin h/h by the sector squeeze, derived (cos h − 1)/h from it without circularity, and volunteered the l'Hôpital trap unprompted.
  • Answered (b) with a two-line proof plus numeric diagnostics, and (c) with a named function, a uniform-convergence argument for continuity, and exact quotient values (n at the origin; right 0, −1/3 and left 1, 4/3 at x = 1/3) rather than a gesture at a picture.