Skip to content

Calculus 1 problem set: limits, derivatives, rates, optimization, integrals, L'Hôpital

ModuleS-M01 · solve · none · Pass 2 · 6 to 8 h
You buildanswers in solve/S-M01.toml (54 checked by SymPy) and 3 proofs in solve/S-M01/q10.md, q25.md, q57.md (self-graded against their rubrics)
Contractnone: a pen and paper set
Testscourse/solve/S-M01/key.toml (hidden): typed answers plus reject canaries; the problems are in course/solve/S-M01/problems.md and in section 4
Needsno module. Reading: S-M00 (functions, exponentials, logarithms) and the Calculus 1 topic, sections 1 to 5
Used byno call site (a solve set). Take it after M01.1 (finite differences), M01.2 (Newton’s method), and M01.3 (activation derivatives) in Pass 2; M01.4 and S-M02 build on the integrals
MilestoneMS-P2 (the Pass 2 gate runs ol check on every solve part of the pass)
Optional depthOpenStax, Calculus Volume 1 (free), ch. 2 to 5; 3Blue1Brown, Essence of Calculus, episodes 1 to 9
  • A limit describes what f(x)f(x) approaches, not f(a)f(a) itself; 0/00/0 and ∞−∞\infty - \infty are signals to rewrite, never answers (q1, q8).
  • The product, quotient, and chain rules compute every derivative your autograd needs; the sigmoid, softplus, tanh, and SiLU derivatives are four lines each (q13 to q15, q21).
  • An optimum of a smooth function sits where f′=0f' = 0 or on the boundary, and you still have to check which candidate wins (q36, q38).
  • The fundamental theorem turns integrals into antiderivatives and makes ddx∫au(x)f=f(u(x)) u′(x)\frac{d}{dx}\int_a^{u(x)} f = f(u(x))\,u'(x) (q46, q47).
  • L’Hôpital’s rule turns 0/00/0 and ∞/∞\infty/\infty into a limit of derivatives, and only applies when that limit exists (q57).
Terminal window
ol start S-M01 # writes solve/S-M01.toml and the three proof files
ol check S-M01 # SymPy checks the answers, then asks each proof rubric (y/n)
ol check S-M01 --regrade # ask the rubrics again after you change a proof

In Pass 2 your system learns to learn. M01.1 approximates derivatives with finite differences, M01.3 writes the derivative of every activation function, and M04.1 turns those into gradcheck, the test that guards every backward pass in L0. All of it assumes you can differentiate a formula by hand and know what a limit is, because a derivative is a limit and a finite difference is that limit stopped early. Training picks the weights that minimize a loss, which is optimization; the learning-rate schedules of M10.4 and the area under an ROC curve (M07.7) are integrals. This set checks the pen and paper side of Calculus 1 before your code depends on it.

SymbolMeaningType / shape
lim⁡x→af(x)=L\lim_{x \to a} f(x) = Lf(x)f(x) gets arbitrarily close to LL as x≠ax \ne a gets close to aareal
ε,δ\varepsilon, \deltapositive tolerances in the definition of a limitpositive reals
f′(x)f'(x), dfdx\frac{df}{dx}the derivative, lim⁡h→0f(x+h)−f(x)h\lim_{h \to 0} \frac{f(x + h) - f(x)}{h}function
f′′(x)f''(x)the second derivative, the derivative of f′f'function
σ(z)\sigma(z)the sigmoid, 1/(1+e−z)1/(1 + e^{-z})function
FFan antiderivative of ff: F′=fF' = ffunction
∫abf(x) dx\int_a^b f(x)\,dxthe definite integral, the signed area under ff from aa to bbreal
tttime, in related-rate problemsreal

lim⁡x→af(x)=L\lim_{x \to a} f(x) = L means: for every ε>0\varepsilon > 0 there is a δ>0\delta > 0 such that 0<∣x−a∣<δ0 < |x - a| < \delta implies ∣f(x)−L∣<ε|f(x) - L| < \varepsilon. The value f(a)f(a) plays no part, which is why x2−4x−2\frac{x^2 - 4}{x - 2} has a limit at 2 even though it is undefined there: for x≠2x \ne 2 it equals x+2x + 2. Limits add, multiply, and divide (when the denominator’s limit is not 0). Three standard limits do most of the work: sin⁡uu→1\frac{\sin u}{u} \to 1 as u→0u \to 0, (1+ax)x→ea(1 + \frac{a}{x})^x \to e^a as x→∞x \to \infty, and for rational functions at infinity, only the highest powers matter. A one-sided limit restricts xx to one side of aa. Forms like 0/00/0, ∞/∞\infty/\infty, ∞−∞\infty - \infty, 0⋅∞0 \cdot \infty, 1∞1^\infty, and 000^0 are indeterminate: they say the problem needs rewriting (factor, multiply by a conjugate, take logarithms), not what the answer is.

The derivative is the limit of the difference quotient. From that definition follow the rules you use instead of it: linearity; the power rule ddxxn=nxn−1\frac{d}{dx} x^n = n x^{n-1} for a constant nn; ddxex=ex\frac{d}{dx} e^x = e^x, ddxln⁡x=1x\frac{d}{dx} \ln x = \frac{1}{x}, ddxsin⁡x=cos⁡x\frac{d}{dx} \sin x = \cos x, ddxcos⁡x=−sin⁡x\frac{d}{dx} \cos x = -\sin x; the product rule (fg)′=f′g+fg′(fg)' = f'g + fg'; the quotient rule (f/g)′=(f′g−fg′)/g2(f/g)' = (f'g - fg')/g^2; and the chain rule, ddxf(g(x))=f′(g(x)) g′(x)\frac{d}{dx} f(g(x)) = f'(g(x))\, g'(x): the outer derivative evaluated at the inner function, times the inner derivative. The chain rule is the whole of backpropagation (M08.1 to M08.3). A variable exponent, as in xxx^x, needs xx=exln⁡xx^x = e^{x \ln x} first; the power rule does not apply.

Section titled “2.3 Implicit differentiation and related rates”

When yy is defined by an equation such as x2+y2=25x^2 + y^2 = 25, differentiate both sides with respect to xx, treating yy as a function of xx (so ddxy2=2y y′\frac{d}{dx} y^2 = 2y\,y'), and solve for y′y'. Related rates apply the same idea with time: if two quantities are tied by an equation and both change with tt, differentiating the equation in tt ties their rates.

At an interior minimum or maximum of a differentiable ff, f′(x)=0f'(x) = 0; such points are critical points. A global optimum on an interval is a critical point or an endpoint (or a limit at an open end), so list the candidates and compare their values. The second derivative classifies a critical point: f′′>0f'' > 0 is a local minimum, f′′<0f'' < 0 a local maximum. Gradient descent (M10.1) finds the same points numerically when solving f′=0f' = 0 by hand is impossible.

The definite integral ∫abf(x) dx\int_a^b f(x)\,dx is the limit of Riemann sums ∑if(xi) Δx\sum_i f(x_i)\,\Delta x over finer and finer partitions. The fundamental theorem of calculus (FTC) connects it to derivatives in two ways: if F′=fF' = f then ∫abf=F(b)−F(a)\int_a^b f = F(b) - F(a); and ddx∫axf(t) dt=f(x)\frac{d}{dx} \int_a^x f(t)\,dt = f(x) for continuous ff. With a variable upper limit u(x)u(x), the chain rule adds a factor: ddx∫au(x)f(t) dt=f(u(x)) u′(x)\frac{d}{dx} \int_a^{u(x)} f(t)\,dt = f(u(x))\,u'(x). The average value of ff on [a,b][a, b] is 1b−a∫abf\frac{1}{b - a}\int_a^b f.

If f(x)→0f(x) \to 0 and g(x)→0g(x) \to 0 (or both →±∞\to \pm\infty) as x→ax \to a, and lim⁡f′(x)/g′(x)\lim f'(x)/g'(x) exists, then lim⁡f(x)/g(x)\lim f(x)/g(x) equals it. It may need several applications (ex−1−xx2\frac{e^x - 1 - x}{x^2} takes two). Products 0⋅∞0 \cdot \infty become quotients, and powers 000^0 or 1∞1^\infty become products after taking the logarithm. When the limit of f′/g′f'/g' does not exist, the rule says nothing, and the original limit may still exist (q57).

This is a sibling of q13 and q38, not one of the graded problems.

A chain rule derivative. Differentiate f(x)=ln⁡(1+e−x)f(x) = \ln(1 + e^{-x}). Outer function ln⁡u\ln u with derivative 1/u1/u; inner u=1+e−xu = 1 + e^{-x} with derivative −e−x-e^{-x} (chain rule again, inner −x-x). So f′(x)=−e−x1+e−xf'(x) = \frac{-e^{-x}}{1 + e^{-x}}. Multiply top and bottom by exe^{x}: f′(x)=−1ex+1=−σ(−x)f'(x) = \frac{-1}{e^x + 1} = -\sigma(-x). This is the derivative of the binary cross-entropy for a positive label, written in terms of the logit. In solve/ it would be answer = "-exp(-x)/(1 + exp(-x))"; answer = "-1/(exp(x) + 1)" passes too, because SymPy checks equivalence, and answer = "1/(1 + exp(-x))" fails.

An optimization. Maximize g(s)=s(10−2s)2g(s) = s(10 - 2s)^2 for 0≤s≤50 \le s \le 5 (an open box from a 10×1010 \times 10 sheet). g′(s)=(10−2s)2+s⋅2(10−2s)(−2)=(10−2s)(10−2s−4s)=(10−2s)(10−6s)g'(s) = (10 - 2s)^2 + s \cdot 2(10 - 2s)(-2) = (10 - 2s)(10 - 2s - 4s) = (10 - 2s)(10 - 6s). The critical points are s=5s = 5 (a zero-volume box) and s=5/3s = 5/3. Compare candidates: g(0)=0g(0) = 0, g(5)=0g(5) = 0, g(5/3)=53⋅(203)2=200027g(5/3) = \frac{5}{3} \cdot \left(\frac{20}{3}\right)^2 = \frac{2000}{27}. The maximizer is s=5/3s = 5/3.

Write each answer in solve/S-M01.toml:

[q1]
answer = "4"
[q13]
answer = "exp(-z)/(1 + exp(-z))^2"
[q35]
answer = "{-1, 1}"
[q10]
proof = "S-M01/q10.md"

Numbers are exact: exp(2), 2/pi, sqrt(7)/2; 0.5 fails where 1/2 is expected. An [expr] answer may take any equivalent form. Write ee as E or exp(1) and π\pi as pi.

q1. lim⁡x→2x2−4x−2\displaystyle\lim_{x \to 2} \frac{x^2 - 4}{x - 2}. [number]

q2. lim⁡x→0sin⁡3xx\displaystyle\lim_{x \to 0} \frac{\sin 3x}{x}. [number]

q3. lim⁡x→∞3x2+2x5x2−1\displaystyle\lim_{x \to \infty} \frac{3x^2 + 2x}{5x^2 - 1}. [number]

q4. lim⁡h→0(1+h)3−1h\displaystyle\lim_{h \to 0} \frac{(1 + h)^3 - 1}{h}. (Which derivative is this?) [number]

q5. lim⁡x→01−cos⁡xx2\displaystyle\lim_{x \to 0} \frac{1 - \cos x}{x^2}. [number]

q6. lim⁡x→∞(1+2x)x\displaystyle\lim_{x \to \infty} \left(1 + \frac{2}{x}\right)^{x}. [number]

q7. lim⁡x→0+xln⁡x\displaystyle\lim_{x \to 0^+} x \ln x. [number]

q8. lim⁡x→∞(x2+x−x)\displaystyle\lim_{x \to \infty} \left(\sqrt{x^2 + x} - x\right). [number]

q9. lim⁡x→0−∣x∣x\displaystyle\lim_{x \to 0^-} \frac{|x|}{x} (from the left). [number]

q10. Prove from the definition that lim⁡x→3(2x+1)=7\displaystyle\lim_{x \to 3} (2x + 1) = 7: for every ε>0\varepsilon > 0, give a δ>0\delta > 0 such that 0<∣x−3∣<δ0 < |x - 3| < \delta implies ∣(2x+1)−7∣<ε|(2x + 1) - 7| < \varepsilon. [proof]

q11. ddx x3sin⁡x\dfrac{d}{dx}\, x^3 \sin x. [expr in x]

q12. ddx ex1+x2\dfrac{d}{dx}\, \dfrac{e^x}{1 + x^2}. [expr in x]

q13. The sigmoid is σ(z)=11+e−z\sigma(z) = \dfrac{1}{1 + e^{-z}}. Give σ′(z)\sigma'(z). [expr in z]

q14. Softplus is s(x)=ln⁡(1+ex)s(x) = \ln(1 + e^x). Give s′(x)s'(x). [expr in x]

q15. tanh⁡x=ex−e−xex+e−x\tanh x = \dfrac{e^x - e^{-x}}{e^x + e^{-x}}. Give ddxtanh⁡x\dfrac{d}{dx} \tanh x in terms of exponentials. [expr in x]

q16. ddx sin⁡(x2)\dfrac{d}{dx}\, \sin(x^2). [expr in x]

q17. ddx 1+x4\dfrac{d}{dx}\, \sqrt{1 + x^4}. [expr in x]

q18. ddx ln⁡(cos⁡x)\dfrac{d}{dx}\, \ln(\cos x) for ∣x∣<π/2|x| < \pi/2. [expr in x]

q19. ddx xx\dfrac{d}{dx}\, x^x for x>0x > 0. (Write xx=exln⁡xx^x = e^{x \ln x}.) [expr in x]

q20. ddx e−x2/2\dfrac{d}{dx}\, e^{-x^2/2}, the shape of the normal density. [expr in x]

q21. SiLU (swish) is silu⁡(x)=x1+e−x=x σ(x)\operatorname{silu}(x) = \dfrac{x}{1 + e^{-x}} = x\,\sigma(x). Give its derivative. [expr in x]

q22. d2dx2 xe−x\dfrac{d^2}{dx^2}\, x e^{-x}. [expr in x]

q23. f(x)=(x2+1)5f(x) = (x^2 + 1)^5. Give f′(1)f'(1). [number]

q24. ddx log⁡2x\dfrac{d}{dx}\, \log_2 x for x>0x > 0. [expr in x]

q25. Prove from the limit definition f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h} that the derivative of f(x)=x2f(x) = x^2 is 2x2x. [proof]

Section titled “Implicit differentiation and related rates”

q26. The circle x2+y2=25x^2 + y^2 = 25 passes through (3,4)(3, 4). Give the slope dy/dxdy/dx there. [number]

q27. xy+y3=2x y + y^3 = 2 defines yy implicitly near (1,1)(1, 1). Give dy/dxdy/dx as a formula in xx and yy. [expr in x, y]

q28. A circle’s radius grows at 2 cm/s. How fast (in cm²/s) does its area grow when the radius is 5 cm? [number]

q29. A 10 m ladder leans on a wall. Its foot slides away from the wall at 1 m/s. When the foot is 6 m from the wall, give the rate (m/s) at which the top moves; a falling top has a negative rate. [number]

q30. A sphere’s volume grows at 100 cm³/s. Give dr/dtdr/dt (cm/s) when the radius is 5 cm. [number]

q31. ey=xe^y = x for x>0x > 0. Differentiate implicitly and give dy/dxdy/dx as a formula in xx alone. [expr in x]

q32. f(x)=x2−6x+11f(x) = x^2 - 6x + 11. Give the xx that minimizes ff. [number]

q33. Give the minimum value of the ff of q32. [number]

q34. A rectangle has perimeter 20. Give its largest possible area. [number]

q35. Give the set of critical points of f(x)=x3−3xf(x) = x^3 - 3x. [set]

q36. Give the maximum of f(x)=xe−xf(x) = x e^{-x} over x≥0x \ge 0. [number]

q37. Give the cc that minimizes L(c)=(c−1)2+(c−2)2+(c−6)2L(c) = (c - 1)^2 + (c - 2)^2 + (c - 6)^2, a one-parameter least-squares fit. [number]

q38. An open box is folded from a 12×1212 \times 12 sheet by cutting a square of side ss from each corner. Give the ss that maximizes the volume. [number]

q39. Give the shortest distance from the point (0,2)(0, 2) to the parabola y=x2y = x^2. [number]

q40. ∫01x2 dx\displaystyle\int_0^1 x^2\, dx. [number]

q41. ∫0πsin⁡x dx\displaystyle\int_0^\pi \sin x\, dx. [number]

q42. ∫1e1x dx\displaystyle\int_1^e \frac{1}{x}\, dx. [number]

q43. ∫02(3x2−2x+1) dx\displaystyle\int_0^2 (3x^2 - 2x + 1)\, dx. [number]

q44. Give the antiderivative FF of 2xcos⁡(x2)2x\cos(x^2) with F(0)=0F(0) = 0. [expr in x]

q45. ∫01e2x dx\displaystyle\int_0^1 e^{2x}\, dx. [number]

q46. ddx∫0x1+t3 dt\dfrac{d}{dx} \displaystyle\int_0^x \sqrt{1 + t^3}\, dt for x≥0x \ge 0. [expr in x]

q47. ddx∫0x2cos⁡t dt\dfrac{d}{dx} \displaystyle\int_0^{x^2} \cos t\, dt. [expr in x]

q48. Give the average value of sin⁡x\sin x over [0,π][0, \pi]. [number]

q49. Give the area between y=xy = x and y=x2y = x^2 for 0≤x≤10 \le x \le 1. [number]

q50. ∫0111+x dx\displaystyle\int_0^1 \frac{1}{1 + x}\, dx. [number]

q51. Give the left Riemann sum of f(x)=xf(x) = x on [0,1][0, 1] with n=4n = 4 equal pieces. [number]

q52. lim⁡x→0ex−1−xx2\displaystyle\lim_{x \to 0} \frac{e^x - 1 - x}{x^2}. [number]

q53. lim⁡x→∞x2e−x\displaystyle\lim_{x \to \infty} x^2 e^{-x}. [number]

q54. lim⁡x→0sin⁡x−xx3\displaystyle\lim_{x \to 0} \frac{\sin x - x}{x^3}. [number]

q55. lim⁡x→0+xx\displaystyle\lim_{x \to 0^+} x^x. [number]

q56. lim⁡x→1ln⁡xx−1\displaystyle\lim_{x \to 1} \frac{\ln x}{x - 1}. [number]

q57. Show that lim⁡x→∞x+sin⁡xx=1\displaystyle\lim_{x \to \infty} \frac{x + \sin x}{x} = 1, and explain why L’Hôpital’s rule cannot be used to get it. [proof]

PitfallSymptomCaught by
Substituting into a 0/00/0 form instead of simplifying firsta removable singularity “evaluated” as 0 or undefinedq1 (canary 0), q8 (canary 0)
Treating 1∞1^\infty as 1compound growth and ee disappearq6 (canary 1)
Differentiating a product factor by factorddxx3sin⁡x\frac{d}{dx} x^3 \sin x given as 3x2cos⁡x3x^2 \cos xq11, q21 (canaries)
Forgetting the inner derivative of the chain rulebackward passes off by the inner Jacobian; gradcheck failsq13, q16, q23, q45, q47 (canaries)
Using the power rule on a variable exponentxxx^x differentiated as x⋅xx−1x \cdot x^{x-1}q19 (canary)
Reporting the argmax instead of the max, or keeping a degenerate critical pointthe wrong number answered, or a zero-volume box chosenq36 (canary 1), q38 (canary 6)
Dropping the sign of a related ratea falling ladder reported as risingq29 (canary 3/4)
Applying L’Hôpital once too few times, or where f′/g′f'/g' has no limita wrong finite limit, or no answer to a limit that existsq52 (canary 1), q57 (proof)
DirectionModuleHow it uses this
BackS-M00functions, exponentials, logarithms, and the trigonometry these problems differentiate
ForwardM01.1finite differences approximate the limit of q4; the step size trades truncation against rounding
ForwardM01.3the activation derivatives of q13 to q15 and q21, in code, checked against torch
ForwardM04.1gradcheck compares an analytic derivative (your rules) with a numerical one (your limits)
ForwardM10.1gradient descent finds the critical points of q32 to q39 numerically
ForwardS-M02integration techniques, improper integrals, series, and ODEs