← All 70 questions
Question 34·Fitzwilliam College·2025·Standard first-round Fitzwilliam calculus question — the mechanism is one line, so discrimination comes from the sqrt(x^2)=|x| point, the independent check and the generalisation
Differentiating under the integral sign: the Leibniz rule with a variable upper limit, compounded with the chain rule
6–10 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.
Let f(x)=∫0x2cos⁡(t)dt. Find the exact derivative f'(x) with respect to x. What is the value of f′(π)?
Answer: f′(x)=2xcos⁡x, and f′(π)=2πcos⁡π≈−0.710022

The whiteboard, beat by beat

1 · Orient · beat 1 of 9

Name the object before you touch the integral

f(x)=∫0x2cos⁡(t)dt,find f′(x) and f′(π)
structure:f=G∘φ,φ(x)=x2,G(u)=∫0ucos⁡(t)dt
What you say, out loud

Before I differentiate anything, let me say what this object is. It is not an integral to be evaluated. It is a composition. The inner function is x squared; the outer function is the accumulation function G, which carries the integral from zero up to a plain variable u.

Once I see f as G composed with x squared, the derivative is the chain rule talking about an accumulation function. That is the calculus fundamental theorem in motion, with the Leibniz rule wrapped around it.

So my plan: differentiate first, integrate never, and then verify by integrating, because on this particular integrand the direct integral is secretly possible and it makes an honest cross-check.

Why this beat exists: The key-points page names exactly this: the Leibniz integral rule compounded with the chain rule, tested through an upper limit that is a function of x. Naming the composition up front is the move the interviewer is listening for.
2 · Set up · beat 2 of 9

State the Leibniz rule, then specialise it

ddx∫a(x)b(x)h(t)dt=h(b(x))b′(x)−h(a(x))a′(x)
h(t)=cos⁡t,a(x)≡0 ⇒ a′(x)=0,b(x)=x2 ⇒ b′(x)=2x
f′(x)=h(b(x))b′(x)=cos⁡(x2)⋅2x
What you say, out loud

The full two-moving-ends rule: derivative of an integral with limits a of x and b of x is h evaluated at the top times the rate the top rises, minus h at the bottom times the rate the bottom rises. I state the general rule so that my special case is a specialization, not a half-remembered formula.

Here the bottom is the constant zero, so its rate is zero and that whole term dies. The top is x squared, rising at the rate 2 x, and the integrand sampled at the top is cosine of the square root of x squared.

That is the answer waiting to be tidied. The two traps I can already see coming: forgetting the 2 x factor, and what the square root of x squared actually equals.

Why this beat exists: Write the general rule once, then the three ingredients h, a, b as one tidy block, then the substituted line. Define, then claim — the rhythm the interviewer reads.
3 · Draw · beat 3 of 9

The picture predicts the sign of f'(√π) before any arithmetic

cos⁡t=0 ⟺ t=π2 ⟺ t=π24≈2.4674
at x=π: x2=π≈3.1416>π24
⟹ integrand negative at top
⟹ f′(π)<0
1π²/4πx=√πy = cos√tred strip: top edge in negativetshaded band 0 to π = f(√π); it grows while the curve is abovethe axis, shrinks past π²/4
The integrand vanishes at t = π²/4 ≈ 2.4674 and is negative beyond. At x = √π the upper limit is x² = π ≈ 3.1416, which is past that zero — so the strip being added as x grows has negative height, and the picture forces f'(√π) < 0 before any number is computed.
What you say, out loud

Let me draw the integrand itself, because f is the signed area of this curve from zero up to the moving point x squared. The curve starts at one, slides down, and crosses the axis exactly where square root of t equals pi over two; that is t equals pi squared over four, about 2.47.

Now the evaluation point: x is square root of pi, so the upper limit is x squared, which is pi, about 3.14. That lands to the right of the crossing. The strip being glued on as x grows is drawn from the part of the curve that is below the axis.

So the picture already tells me f prime of square root of pi must be negative, before I multiply anything. If my algebra later hands me a positive number, I will know I have erred.

Why this beat exists: Drawing is a thinking step: state what the drawing proves — here, a sign prediction that a wrong chain of substitutions would violate.
4 · Compute · beat 4 of 9

Tidy the formula — including the |x| nobody mentions

x2=|x|,cos⁡|x|=cos⁡x  (cos⁡ is even)
f′(x)=2xcos⁡(x2)=2xcos⁡|x|=2xcos⁡xfor every real x
f′(π)=2πcos⁡π=2(1.7724538)(−0.2002935)≈−0.710022
What you say, out loud

Tidying: the square root of x squared is the modulus of x, not x itself. That is the line candidates skip, and I refuse to skip it silently. It collapses here only because cosine is an even function: cosine of the modulus of x equals cosine of x. So f prime of x is 2x cosine x, and it holds for every real x, negatives included.

Now substitute x equals square root of pi, about 1.7725. The cosine argument is the square root of pi itself, which is not pi; its cosine is about minus 0.2003. Times 2 root pi, the exact value is 2 square root pi cosine square root pi, roughly minus 0.710022.

The sign agrees with the drawing. The magnitude is honest: nothing about this number simplifies, and I will not pretend it does.

Why this beat exists: Explicitly resolving sqrt(x^2)=|x| and saying why it is harmless (cos even) is precisely the discrimination point being tested.
5 · Check numerically · beat 5 of 9

Finite differences on the raw integral, nothing else assumed

h10−110−210−310−4diff. quotient−0.715364−0.710076−0.710023−0.710022error−5.34×10−3−5.35×10−5−5.35×10−7−5.3×10−9
sign matches drawing ✓
shrinks ∼100 per decade: second order
What you say, out loud

I do not trust my own first answer yet. So back to the definition: f of x is the integral from zero to x squared of cosine square root t, which I will integrate numerically and form the symmetric difference quotient f of x plus h minus f of x minus h over 2h, at x equal to square root of pi.

With h a tenth I get minus 0.7154. Cut h to a hundredth: minus 0.71008. To a thousandth: minus 0.710023. To a ten-thousandth: minus 0.7100221. The error is dropping by roughly a factor of one hundred per decade of h, the clean second-order signature of a central difference, marching onto minus 0.710022.

That is the same number my formula produced, obtained from the integral alone with no differentiation rule involved.

Why this beat exists: All table entries were computed fresh from the integral definition by composite Simpson quadrature before being written on the board.
6 · Justify · beat 6 of 9

Why the rule is legal here, plus a symmetry consequence

h(t)=cos⁡t continuous for t≥0
⇒ G′(u)=h(u), every u≥0
φ(x)=x2 smooth: chain rule, all x
f depends on x via x2: f even, f′ odd
2xcos⁡x odd: f′(−π)=+0.710022 ✓
At x=0: directly f(x)=x2−x44+⋯, so f′(0)=limx→0⁡f(x)/x=0 ✓ with 2xcos⁡x at 0.
What you say, out loud

The Leibniz rule is not unconditional. It asks that the integrand be continuous at the moving endpoint. Cosine of square root t is a composition of continuous functions on the non-negative axis; the square root is continuous even at zero. So the accumulation function G is differentiable everywhere on the domain, x squared is smooth, and the chain rule is legal at every real x. There is no hidden exception.

A consequence I can test for free: f depends on x only through x squared, so f is an even function, so its derivative must be odd. Two x cosine x is indeed odd, and it predicts f prime of minus square root pi equals plus 0.710022; the mirror sign. That is structural insurance, independent of any calculation.

The one corner I want to look at: x equals zero. The formula gives zero there, and from the definition the integral up to x squared is approximately its length times one; that is x squared to leading order; so f of x over x tends to zero. The derivative at the origin exists and agrees.

Why this beat exists: Volunteering the hypothesis of the theorem, then a symmetry consequence, then the boundary point x = 0 — three free checks inside one beat.
7 · Cross-check · beat 7 of 9

The second route: actually integrate, then differentiate that

t=u2, dt=2udu:f(x)=2∫0|x|ucos⁡udu=2[usin⁡u+cos⁡u]0|x|=2(xsin⁡x+cos⁡x−1)
ddx2(xsin⁡x+cos⁡x−1)=2(sin⁡x+xcos⁡x−sin⁡x)=2xcos⁡x✓
checked at x=0.3, 1.2, 2.7 to 10−11
bonus exact: f(π/2)=π−2≈1.1416
π/2√πmax = π − 2f(x)f′(x) = 2x cos xtangent at √π, slope −0.710022x
The explicit accumulation function from the second route peaks exactly at x = π/2 with height π − 2, and its slope at x = √π — already past the peak — is negative, reproducing −0.710022: the two routes and the drawing all agree.
What you say, out loud

Let me get the same derivative a second, independent way: this integrand actually yields to brute force. Substitute t equals u squared, so dt is 2u du, and the square root of t is just u. So the integral becomes 2 times the integral of u cosine u, from zero up to the modulus of x.

Integrate by parts and I get 2 of u sine u plus cosine u, evaluated at the modulus of x minus at zero. Since u sine u is even in disguise, the modulus times sine of the modulus equals x times sine of x, the closed form is 2 of x sine x plus cosine x minus one, and that is valid for every real x.

Differentiate that directly: the sines cancel and I am left with 2x cosine x. Same as the Leibniz route, which never needed the integral at all. Two independent routes agreeing. And the closed form lets me read off a free exact fact: f peaks at x equals pi over two with height exactly pi minus two, about 1.1416, consistent with the tangent in the drawing sitting just past that peak.

Why this beat exists: Two independent routes to the same derivative is the strongest whiteboard signal. Checking the closed form numerically against the raw integral before claiming agreement is what makes the second route real.
8 · Conclude and generalise · beat 8 of 9

Answer, widen the family, find where the method breaks

f′(x)=2xcos⁡x;f′(π)=2πcos⁡π≈−0.710022
family:  Fn(x)=∫0xncos⁡tdt ⇒ Fn′(x)=nxn−1cos⁡(|x|n/2)  (n even)
boundary (i): odd n, xn<0 for x<0
cos⁡t not real there
boundary (ii): jump in h
corner on F where xn crosses
What you say, out loud

So the answer: f prime of x is 2x cosine x for every real x, and f prime of square root of pi is 2 square root pi cosine square root pi, exactly that, approximately minus 0.710022.

The square on the upper limit was never special. For the x to the n family, the same two-line argument gives n x to the n minus one, times cosine of the modulus of x to the n over two. Note that the modulus has reappeared, because now it is x to the n that gets square-rooted.

And two boundaries where the method stops being legal. For odd n, negative x makes the upper limit negative and the integrand itself stops being real; the domain of f feels the square-root issue too. And the rule needs the integrand continuous at the moving top: swap cosine square root t for something with a jump, and the derivative acquires a corner exactly where x squared crosses the jump. I would rather state the boundary of the tool than discover it by failing.

Why this beat exists: Generalising, then locating both failure modes (domain of definition and continuity hypothesis), is the closing move that answers the interviewer's next question before it is asked.
9 · Only if invited · beat 9 of 9

When the shortcut is not lazy but the only way

ddx∫0xe−t2dt=e−x2no elementary closed form
2πcos⁡π does not simplify
π≈1.7725≠π, cos⁡π≈−0.2003
What you say, out loud

If you want to know why interviewers ask this shape of question: here the integral was doable, so differentiating-first was the efficient route. Replace the integrand by e to the minus t squared and the integral has no elementary closed form at all, but the Leibniz shortcut still hands you the derivative instantly. The shortcut is not a trick that replaces integration; it is a door that opens when integration cannot.

And on exactness: the answer minus 0.710022 is not simplifying to anything pretty. Cosine of square root pi is about minus 0.2003; square root pi is 1.77, not pi. I keep the exact form boxed and the decimal only as evidence.

I would offer this as a bonus rather than as the answer: the question only asked for the derivative and its value.

Nothing about this number tidies up: the square root of pi is about one point seven seven, not pi, so its cosine is about minus zero point two and the product does not simplify.

Why this beat exists: Going here unprompted reads as showing off; going here when invited, and labelling it beyond the question, reads as depth with judgement.

Where the interviewer pushes next

“What changes if both limits move: d/dx of ∫ from x to x² of cos√t dt?”
What you say, out loud

Same rule, both terms alive. The upper limit contributes cosine of the square root of x squared, times 2x, which collapses to 2 x cosine x as before; the lower limit now rises too, contributing minus cosine of the square root of x, times the rate one.

So the derivative is 2 x cosine x minus cosine square root x. I keep the x greater than zero caveat, because the second term samples the integrand at the lower limit x itself, and the square root there wants a non-negative argument; the domain of the answer is not the domain of the original f.

ddx∫xx2cos⁡tdt=2xcos⁡x−cos⁡x(x>0)
“Where does f attain its maximum and what is the exact maximum value?”
What you say, out loud

From f prime equals 2x cosine x, the stationary points are x equals zero and the zeros of cosine, the first being plus and minus pi over two. The drawing settles which is which: the integrand turns negative past t equals pi squared over four, and that crossing lands exactly where x squared hits pi squared over four, so pi over two is a genuine peak.

Because f is even, minus pi over two is an identical peak, and x equals zero is a minimum with f equal zero. The closed form from the cross-check route gives the height exactly: two of pi over two times one, plus zero, minus one. The maximum is pi minus two, about 1.1416.

And the second derivative test agrees for free: f double prime at pi over two is minus pi, comfortably negative.

f′(x)=0 ⟺ x=0 or cos⁡x=0 ⇒ x=±π2 maxima,x=0 minimum
f(π2)=π−2≈1.1416,f′′(π2)=−π<0
“Give me f''(√π). What does it say about the tangent there?”
What you say, out loud

Differentiate 2x cosine x by the product rule: f double prime is 2 cosine x minus 2x sine x. At square root of pi the first term is 2 cosine of square root pi, about minus 0.4006; the second term is minus 2 square root pi sine square root pi, about minus 3.4731, and the sum is about minus 3.8737.

Two readings: the tangent is falling, slope minus 0.71; and it is falling harder as x grows, since the negative second derivative says f is concave down there. Consistent with sitting just past the peak at pi over two.

f′′(x)=2cos⁡x−2xsin⁡x,f′′(π)≈−0.4006−3.4731=−3.8737
“Was sqrt(x²) = |x| a real issue or just ceremony? Give an example where it bites.”
What you say, out loud

It is a real rule that was harmless here only by accident: cosine is even, so cosine of the modulus of x equals cosine of x and the absolute value folded away without changing the answer.

Change the integrand to square root t and it bites. The rule returns 2 x times the square root of x squared, which is 2 x times the modulus of x. Integrating the raw square root directly: the integral is two thirds of the modulus of x cubed, whose derivative is indeed 2 x modulus of x, while the naive answer 2 x squared is wrong for negative x.

So the discipline is: write the modulus, then check whether the outer function erases it. Never erase it yourself before looking.

∫0x2tdt=23|x|3 ⇒ ddx=2x|x|,naively 2x2 fails for x<0

Traps on this question

  • Dropping the inner derivative: writing f'(x) = cos√(x²) as though the upper limit were x. The Leibniz rule is integrand-at-top times derivative-of-top — the 2x is not decoration.
  • Confusing x with the upper limit: sampling the integrand at t = √π instead of t = (√π)² = π gives cos(π^{1/4})·2√π ≈ +0.84 — it even flips the sign of the answer.
  • Simplifying √(x²) to x without the absolute value. Harmless in this problem only because cos is even; the same step is genuinely wrong for an odd or monotone outer integrand such as √t.
  • Feeling obliged to integrate first. A closed form exists here (substitute t = u², then integrate by parts) but it costs minutes the Leibniz route gives back — and quoting the Leibniz rule without checking continuity of the integrand at the moving top is bare assertion.
  • Polishing the number into something it is not: √π ≈ 1.7725 is not π, so cos√π ≈ −0.2003 does not become cos π = −1. The exact value is 2√π cos√π; the decimal −0.710022 is evidence, not the answer.

What gets written on the assessor’s form

  • Decomposed f as G∘(x²) and stated the general Leibniz rule before specialising — named the composition before computing.
  • Flagged √(x²) = |x| explicitly and justified why cos being even makes the reduction to 2x cos x legal for all real x.
  • Predicted the sign of f'(√π) from the integrand drawing (zero at t = π²/4, upper limit π beyond it) before doing the arithmetic.
  • Did not trust the first answer: ran central differences on the raw integral, read off the O(h²) error decay, then cross-checked by integrating explicitly and differentiating the closed form.
  • Generalised to the x^n family, identified both failure boundaries (odd n and the continuity hypothesis), and kept exact and decimal values separate.