Skip to content

7.5 Calculus 1 Problem Set

This problem set works through the pen-and-paper side of Calculus 1 that the code in this chapter depends on. Derivatives and finite differences approximates derivatives by stopping a limit early, Activation Functions and Their Derivatives writes the derivative of every activation, and Gradients and gradcheck turns those into gradcheck, the test that guards every backward pass in the autograd engine of AI Engineering. 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 Learning-rate schedules and gradient clipping and the area under an ROC curve in Logistic regression, ROC-AUC, and calibration are integrals.

Concepts from other sections (18)

This section uses these ideas. Each has a short definition and a link to the section that explains it in full. Tap a dotted term in the text to preview it.

  • Learning-rate schedule: a function from the step number to the learning rate. Read more: 16.4 Learning-rate schedules (cosine, WSD, Noam) and gradient clipping
  • ROC curve: the staircase of (FPR, TPR) pairs traced as the decision threshold falls through every distinct score. Read more: 13.8 Logistic regression (IRLS), ROC-AUC, calibration (ECE)
  • Implicit differentiation: differentiating both sides of an equation in xx and yy, treating yy as a function of xx, then solving for dy/dxdy/dx; it gives slopes of curves such as x2+y2=25x^2 + y^2 = 25 that are not written as y=f(x)y = f(x). Read more: Chapter 7: Calculus 1
  • sigmoid: σ(x)=11+e−x\sigma(x) = \frac{1}{1 + e^{-x}}, mapping the real line into (0,1)(0, 1), with σ′=σ(x)σ(−x)\sigma' = \sigma(x)\sigma(-x). Read more: 7.3 Activation Functions and Their Derivatives
  • softplus: ln⁡(1+ex)\ln(1 + e^x), a smooth relu whose derivative is σ\sigma. Read more: 7.3 Activation Functions and Their Derivatives
  • SiLU (swish): x σ(x)x\,\sigma(x), the gate inside SwiGLU. Read more: 7.3 Activation Functions and Their Derivatives
  • definite integral: the limit of Riemann sums, the signed area between ff and the xx axis. Read more: 7.4 Definite Integrals: Trapezoid and Simpson
  • Backpropagation: reverse-mode automatic differentiation that computes all parameter gradients in one backward pass. Read more: Chapter 2: Deep Learning in AI Engineering
  • Power rule: ddxxn=nxn−1\frac{d}{dx} x^n = n x^{n-1}, the derivative of a power, and with linearity the derivative of any polynomial. Read more: Chapter 7: Calculus 1
  • Cross-entropy: H(p,q)=−∑ipilog⁡qiH(p, q) = -\sum_i p_i \log q_i, the average surprise when data from pp are predicted with qq. Read more: 17.1 Entropy, cross-entropy, KL, JS, and the k3 estimator
  • One-sided limit: lim⁡x→a+f(x)\lim_{x \to a^+} f(x) or lim⁡x→a−f(x)\lim_{x \to a^-} f(x), the limit as xx approaches aa from the right or the left only; the two-sided limit exists exactly when both one-sided limits exist and agree. Read more: Chapter 7: Calculus 1
  • Product rule / quotient rule: (fg)′=f′g+fg′(fg)' = f'g + fg' and (f/g)′=(f′g−fg′)/g2(f/g)' = (f'g - fg')/g^2, the rules for differentiating a product or a ratio of two functions. Read more: Chapter 7: Calculus 1
  • Change of base: the identity log⁡bx=ln⁡x/ln⁡b\log_b x = \ln x / \ln b, which makes every logarithm a natural log divided by a constant. Read more: 6.1 Exponents, logarithms, and units of information
  • Riemann sum: ∑if(ξi) h\sum_i f(\xi_i)\, h, the sum of thin rectangles under ff. Read more: 7.4 Definite Integrals: Trapezoid and Simpson
  • trapezoid rule: joining neighboring points by straight lines; second order, exact on lines. Read more: 7.4 Definite Integrals: Trapezoid and Simpson
  • Squeeze theorem: if g(x)≤f(x)≤h(x)g(x) \le f(x) \le h(x) near aa and lim⁡g=lim⁡h=L\lim g = \lim h = L, then lim⁡f=L\lim f = L; it settles limits such as lim⁡x→0sin⁡x/x=1\lim_{x \to 0} \sin x / x = 1 that substitution cannot. Read more: Chapter 7: Calculus 1
  • Jacobian: the m×nm \times n matrix of partial derivatives Jij=∂fi/∂xjJ_{ij} = \partial f_i / \partial x_j of a function f:Rn→Rmf: \mathbb{R}^n \to \mathbb{R}^m. Read more: 10.2 Jacobians, the multivariable chain rule, and numeric JVP/VJP
  • Gradcheck: a comparison of a hand-written gradient against central differences of ∑f(x)⊙g\sum f(x) \odot g. Read more: 3.3 Oracles, golden and differential tests, gradcheck as a test in Software Engineering

The set has 57 problems in six groups: limits, derivative rules and the chain rule, implicit differentiation and related rates, optimization, integration and the fundamental theorem, and L’Hôpital’s rule. Fifty-four have exact answers, and three (Problems 10, 25, and 57) ask for a written proof. It is best taken after the first three sections of this chapter; Definite integrals: trapezoid and Simpson and the Calculus 2 problem set build on its integrals. The background it assumes, functions, exponentials, and logarithms, is covered in the precalculus solve set.

Each problem is followed by a collapsed worked answer: the result, the derivation, and, where there is one, the most common wrong answer and why it is wrong. Attempt each problem before opening its answer; the wrong answers are as instructive as the right ones.

Learning objectives

  • Evaluate limits by rewriting indeterminate forms rather than substituting into them.
  • Differentiate any formula the autograd needs with the product, quotient, and chain rules, including the sigmoid, softplus, tanh, and SiLU.
  • Solve implicit-differentiation, related-rates, and optimization problems, checking every candidate.
  • Evaluate definite integrals with the fundamental theorem, including derivatives of integrals with variable limits.
  • Apply L’Hôpital’s rule correctly and recognize when its hypothesis fails.

This review collects the definitions and rules the problems rely on, in the order the problems use them.

lim⁡x→af(x)=L\lim_{x \to a} f(x) = L means that f(x)f(x) gets arbitrarily close to LL as x≠ax \ne a gets close to aa. Precisely: 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 f′(x)=dfdxf'(x) = \frac{df}{dx} is the limit of the difference quotient, lim⁡h→0f(x+h)−f(x)h\lim_{h \to 0} \frac{f(x + h) - f(x)}{h}, and the second derivative f′′f'' is the derivative of f′f'. 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, as the chapter Matrix calculus and autodiff shows from Dual numbers and forward-mode autodiff through Matrix differentials and VJPs. A variable exponent, as in xxx^x, needs xx=exln⁡xx^x = e^{x \ln x} first; the power rule does not apply. Several problems use the sigmoid, σ(z)=1/(1+e−z)\sigma(z) = 1/(1 + e^{-z}).

Section titled “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 tt: 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, in Gradient descent and line search, 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, the signed area under ff from aa to bb, 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 FF is an antiderivative of ff (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 (Problem 57).

Before the problems, here are two siblings of Problems 13 and 38, worked in full. They are not part of the set.

A chain rule derivative. Differentiate f(x)=ln⁡(1+e−x)f(x) = \ln(1 + e^{-x}). The outer function is ln⁡u\ln u with derivative 1/u1/u; the inner is u=1+e−xu = 1 + e^{-x} with derivative −e−x-e^{-x} (the chain rule again, with inner function −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. Both −e−x1+e−x\frac{-e^{-x}}{1 + e^{-x}} and −1ex+1\frac{-1}{e^x + 1} are the same answer written two ways; 11+e−x\frac{1}{1 + e^{-x}}, the sigmoid itself, is not (it has the wrong sign and the wrong argument).

An optimization. Maximize g(s)=s(10−2s)2g(s) = s(10 - 2s)^2 for 0≤s≤50 \le s \le 5, the volume of an open box folded 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.

Now the problems. Numbers are exact (e2e^2, 2/π2/\pi, 7/2\sqrt 7/2, not decimals), and an expression answer may take any equivalent form. The tag after each problem says what kind of answer it wants.

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

Answer

4. Substituting gives 0/00/0, a signal to rewrite. Factor: (x−2)(x+2)x−2=x+2\frac{(x - 2)(x + 2)}{x - 2} = x + 2 for x≠2x \ne 2, and the limit never looks at x=2x = 2, so it is 2+2=42 + 2 = 4. A common mistake is 0, from substituting into the numerator only.

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

Answer

3. Write sin⁡3xx=3⋅sin⁡3x3x\frac{\sin 3x}{x} = 3 \cdot \frac{\sin 3x}{3x} and use sin⁡uu→1\frac{\sin u}{u} \to 1 with u=3x→0u = 3x \to 0. A common mistake is 1, applying the standard limit without matching its argument, which drops the factor 3.

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

Answer

3/5. Divide top and bottom by x2x^2: 3+2/x5−1/x2→35\frac{3 + 2/x}{5 - 1/x^2} \to \frac{3}{5}. For rational functions at infinity only the highest powers matter. A common mistake is 0, treating the denominator as “winning” when the degrees are equal.

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

Answer

3. It is the difference quotient of f(x)=x3f(x) = x^3 at x=1x = 1, so the limit is f′(1)=3⋅12=3f'(1) = 3 \cdot 1^2 = 3. Directly: (1+h)3−1=3h+3h2+h3(1 + h)^3 - 1 = 3h + 3h^2 + h^3, and dividing by hh gives 3+3h+h2→33 + 3h + h^2 \to 3. The finite differences of Derivatives and finite differences approximate exactly this limit with a fixed hh. A common mistake is 1.

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

Answer

1/2. Multiply top and bottom by 1+cos⁡x1 + \cos x: 1−cos⁡2xx2(1+cos⁡x)=(sin⁡xx)2⋅11+cos⁡x→1⋅12\frac{1 - \cos^2 x}{x^2(1 + \cos x)} = \left(\frac{\sin x}{x}\right)^2 \cdot \frac{1}{1 + \cos x} \to 1 \cdot \frac12. (Or L’Hôpital twice: sin⁡x2x→12\frac{\sin x}{2x} \to \frac12.) A common mistake is 0, reading 1−cos⁡x→01 - \cos x \to 0 as the whole answer.

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

Answer

e2e^2. The standard limit (1+ax)x→ea(1 + \frac{a}{x})^x \to e^a with a=2a = 2. To see it, take logs: xln⁡(1+2/x)=ln⁡(1+2/x)1/xx \ln(1 + 2/x) = \frac{\ln(1 + 2/x)}{1/x}, a 0/00/0 form whose limit is 2 (L’Hôpital, or ln⁡(1+u)≈u\ln(1 + u) \approx u), so the limit is e2e^2. Two common mistakes: 1, reading 1∞1^\infty as 1 (it is indeterminate), and ee, dropping the 2.

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

Answer

0. A 0⋅(−∞)0 \cdot (-\infty) form. Rewrite as ln⁡x1/x\frac{\ln x}{1/x}, an ∞/∞\infty/\infty form, and apply L’Hôpital: 1/x−1/x2=−x→0\frac{1/x}{-1/x^2} = -x \to 0. The factor xx goes to 0 faster than ln⁡x\ln x goes to −∞-\infty. A common mistake is −1-1.

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

Answer

1/2. An ∞−∞\infty - \infty form. Multiply by the conjugate: (x2+x)−x2x2+x+x=xx2+x+x=11+1/x+1→12\frac{(x^2 + x) - x^2}{\sqrt{x^2 + x} + x} = \frac{x}{\sqrt{x^2 + x} + x} = \frac{1}{\sqrt{1 + 1/x} + 1} \to \frac{1}{2}. A common mistake is 0, reading ∞−∞\infty - \infty as 0.

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

Answer

−1-1. For x<0x < 0, ∣x∣=−x|x| = -x, so the quotient is −1-1 at every point the left-hand limit uses. A common mistake is 1, which is the right-hand limit; because the two one-sided limits differ, the two-sided limit does not exist.

Problem 10. 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]

Answer

Proof (direct). Let ε>0\varepsilon > 0 be given. For every real xx, ∣(2x+1)−7∣=∣2x−6∣=2∣x−3∣|(2x + 1) - 7| = |2x - 6| = 2|x - 3|. Choose δ=ε/2\delta = \varepsilon / 2, which is positive. If 0<∣x−3∣<δ0 < |x - 3| < \delta, then ∣(2x+1)−7∣=2∣x−3∣<2δ=ε|(2x + 1) - 7| = 2|x - 3| < 2\delta = \varepsilon. Since ε>0\varepsilon > 0 was arbitrary, the definition of the limit holds, so lim⁡x→3(2x+1)=7\lim_{x \to 3} (2x + 1) = 7.

A complete proof states the goal, rewrites the distance as 2∣x−3∣2|x - 3|, names δ\delta explicitly (any positive δ≤ε/2\delta \le \varepsilon/2 works), and shows that this δ\delta works for every such xx.

Problems on derivative rules and the chain rule

Section titled “Problems on derivative rules and the chain rule”

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

Answer

3x2sin⁡x+x3cos⁡x3x^2 \sin x + x^3 \cos x. Product rule, (fg)′=f′g+fg′(fg)' = f'g + fg', with f=x3f = x^3 and g=sin⁡xg = \sin x. A common mistake is 3x2cos⁡x3x^2 \cos x: differentiating each factor and multiplying, which is not a rule.

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

Answer

ex(1−2x+x2)(1+x2)2\dfrac{e^x (1 - 2x + x^2)}{(1 + x^2)^2}, which is ex(x−1)2(1+x2)2\dfrac{e^x (x - 1)^2}{(1 + x^2)^2}. Quotient rule: ex(1+x2)−ex⋅2x(1+x2)2\frac{e^x (1 + x^2) - e^x \cdot 2x}{(1 + x^2)^2}, then factor out exe^x. Common mistakes: +2x+2x in the numerator (the quotient rule’s minus sign flipped), and ex/(2x)e^x / (2x) (differentiating top and bottom separately).

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

Answer

e−z(1+e−z)2\dfrac{e^{-z}}{(1 + e^{-z})^2}, equal to σ(z)(1−σ(z))\sigma(z)(1 - \sigma(z)). Chain rule on (1+e−z)−1(1 + e^{-z})^{-1}: the outer derivative is −(1+e−z)−2-(1 + e^{-z})^{-2}, the inner derivative is −e−z-e^{-z}, and the two minus signs cancel. This is the sigmoid backward of The op library and gradcheck_all and Activation Functions and Their Derivatives. Common mistakes: a leading minus sign (the inner derivative’s sign lost), and σ(z)\sigma(z) itself.

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

Answer

ex1+ex\dfrac{e^x}{1 + e^x}, which is σ(x)\sigma(x). Chain rule: 11+ex⋅ex\frac{1}{1 + e^x} \cdot e^x. A common mistake is 11+ex\frac{1}{1 + e^x}, which forgets the inner derivative exe^x and is σ(−x)\sigma(-x).

Problem 15. 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]

Answer

4(ex+e−x)2\dfrac{4}{(e^x + e^{-x})^2}. Quotient rule: the numerator’s derivative is ex+e−xe^x + e^{-x} and the denominator’s is ex−e−xe^x - e^{-x}, so tanh⁡′x=(ex+e−x)2−(ex−e−x)2(ex+e−x)2\tanh' x = \frac{(e^x + e^{-x})^2 - (e^x - e^{-x})^2}{(e^x + e^{-x})^2}. The difference of squares is (a+b)2−(a−b)2=4ab=4exe−x=4(a + b)^2 - (a - b)^2 = 4ab = 4e^x e^{-x} = 4. This equals 1−tanh⁡2x1 - \tanh^2 x. Common mistakes: 1(ex+e−x)2\frac{1}{(e^x + e^{-x})^2} (the 4 lost), and 1−tanh⁡x1 - \tanh x (the square lost).

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

Answer

2xcos⁡(x2)2x \cos(x^2). Chain rule: outer cos⁡\cos evaluated at the inner x2x^2, times the inner derivative 2x2x. Common mistakes: cos⁡(x2)\cos(x^2) (the inner derivative forgotten) and 2xcos⁡x2x \cos x (the outer derivative evaluated at xx instead of at x2x^2).

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

Answer

2x31+x4\dfrac{2x^3}{\sqrt{1 + x^4}}. dduu=12u\frac{d}{du}\sqrt u = \frac{1}{2\sqrt u}, times the inner derivative 4x34x^3: 4x321+x4\frac{4x^3}{2\sqrt{1 + x^4}}. A common mistake is 121+x4\frac{1}{2\sqrt{1 + x^4}}, without the inner derivative.

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

Answer

−sin⁡xcos⁡x-\dfrac{\sin x}{\cos x}, that is −tan⁡x-\tan x. Chain rule: 1cos⁡x⋅(−sin⁡x)\frac{1}{\cos x} \cdot (-\sin x). A common mistake is 1cos⁡x\frac{1}{\cos x}, without the inner derivative.

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

Answer

xx(ln⁡x+1)x^x(\ln x + 1). ddxexln⁡x=exln⁡x⋅ddx(xln⁡x)=xx(ln⁡x+x⋅1x)\frac{d}{dx} e^{x \ln x} = e^{x \ln x} \cdot \frac{d}{dx}(x \ln x) = x^x \left(\ln x + x \cdot \frac1x\right). A common mistake is x⋅xx−1x \cdot x^{x - 1}: the power rule, which holds only for a constant exponent.

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

Answer

−x e−x2/2-x\, e^{-x^2/2}. Chain rule: eue^{u} with u=−x2/2u = -x^2/2 and u′=−xu' = -x. This is the φ′=−xφ\varphi' = -x\varphi that the Gaussian integrals of the Calculus 2 problem set use. Common mistakes: e−x2/2e^{-x^2/2} (no inner derivative) and −x22e−x2/2-\frac{x^2}{2} e^{-x^2/2} (the exponent multiplied in instead of its derivative).

Problem 21. 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]

Answer

11+e−x+x e−x(1+e−x)2\dfrac{1}{1 + e^{-x}} + \dfrac{x\, e^{-x}}{(1 + e^{-x})^2}, that is σ(x)+x σ(x)(1−σ(x))\sigma(x) + x\,\sigma(x)(1 - \sigma(x)). Product rule on x⋅σ(x)x \cdot \sigma(x), using Problem 13 for σ′\sigma'. This is the backward of SwiGLU’s gate in Gated MLPs: SwiGLU and GeGLU. A common mistake is to keep only the second term, xσ′(x)x\sigma'(x), forgetting that xx itself also changes.

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

Answer

(x−2) e−x(x - 2)\, e^{-x}. First derivative by the product rule: e−x−xe−x=(1−x)e−xe^{-x} - x e^{-x} = (1 - x)e^{-x}. Again: −e−x−(1−x)e−x=(x−2)e−x-e^{-x} - (1 - x)e^{-x} = (x - 2)e^{-x}. A common mistake is (1−x)e−x(1 - x)e^{-x}, which is only the first derivative.

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

Answer

160. f′(x)=5(x2+1)4⋅2xf'(x) = 5(x^2 + 1)^4 \cdot 2x, so f′(1)=5⋅24⋅2=160f'(1) = 5 \cdot 2^4 \cdot 2 = 160. A common mistake is 80, which drops the inner derivative 2x2x.

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

Answer

1xln⁡2\dfrac{1}{x \ln 2}. Change of base: log⁡2x=ln⁡xln⁡2\log_2 x = \frac{\ln x}{\ln 2}, and 1ln⁡2\frac{1}{\ln 2} is a constant. Common mistakes: 1x\frac1x (the derivative of ln⁡\ln, not log⁡2\log_2) and ln⁡2x\frac{\ln 2}{x} (the constant inverted).

Problem 25. 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]

Answer

Proof (direct, from the definition). Fix a real xx. By definition, f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h} when this limit exists. For h≠0h \ne 0, (x+h)2−x2h=x2+2xh+h2−x2h=h(2x+h)h=2x+h.\frac{(x + h)^2 - x^2}{h} = \frac{x^2 + 2xh + h^2 - x^2}{h} = \frac{h(2x + h)}{h} = 2x + h . Cancelling hh is allowed because the limit as h→0h \to 0 only looks at h≠0h \ne 0, so the difference quotient equals 2x+h2x + h at every point the limit uses. 2x+h2x + h is a polynomial in hh, hence continuous, so lim⁡h→0(2x+h)=2x\lim_{h \to 0} (2x + h) = 2x. Therefore f′(x)=2xf'(x) = 2x, for every real xx.

The step most often skipped is the justification for cancelling hh: it is exactly the fact that a limit ignores the point itself (see the review of limits above).

Section titled “Problems on implicit differentiation and related rates”

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

Answer

−3/4-3/4. Differentiate in xx: 2x+2y y′=02x + 2y\,y' = 0, so y′=−x/y=−3/4y' = -x/y = -3/4. A common mistake is −4/3-4/3, which is dx/dydx/dy.

Problem 27. 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]

Answer

−yx+3y2-\dfrac{y}{x + 3y^2}. Differentiate in xx: the product rule on xyxy gives y+xy′y + x y', and the chain rule on y3y^3 gives 3y2y′3y^2 y'. So y+(x+3y2)y′=0y + (x + 3y^2) y' = 0 and y′=−y/(x+3y2)y' = -y/(x + 3y^2); at (1,1)(1, 1) the slope is −1/4-1/4. Common mistakes: −y/(3y2)-y/(3y^2) (differentiating xyxy as yy alone, dropping the xy′x y' term of the product rule) and +y/(x+3y2)+y/(x + 3y^2) (a sign slip).

Problem 28. 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]

Answer

20π20\pi. A=πr2A = \pi r^2, so by the chain rule through time dAdt=2πrdrdt=2π⋅5⋅2=20π\frac{dA}{dt} = 2\pi r \frac{dr}{dt} = 2\pi \cdot 5 \cdot 2 = 20\pi. A common mistake is 10π10\pi, which forgets dr/dt=2dr/dt = 2.

Problem 29. 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]

Answer

−3/4-3/4. With foot distance xx and top height yy, x2+y2=100x^2 + y^2 = 100; at x=6x = 6, y=8y = 8. Differentiate in tt: 2xx˙+2yy˙=02x\dot x + 2y\dot y = 0, so y˙=−xx˙/y=−6⋅1/8=−3/4\dot y = -x\dot x / y = -6 \cdot 1 / 8 = -3/4. Common mistakes: 3/43/4 (the sign dropped: the top falls) and −4/3-4/3 (the ratio inverted).

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

Answer

1/π1/\pi. V=43πr3V = \frac43 \pi r^3, so dVdt=4πr2drdt\frac{dV}{dt} = 4\pi r^2 \frac{dr}{dt}. At r=5r = 5: 100=4π⋅25⋅drdt=100πdrdt100 = 4\pi \cdot 25 \cdot \frac{dr}{dt} = 100\pi \frac{dr}{dt}, so drdt=1π\frac{dr}{dt} = \frac{1}{\pi}. A common wrong answer is 14π\frac{1}{4\pi}, an arithmetic slip in evaluating 4πr24\pi r^2.

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

Answer

1x\dfrac{1}{x}. ey y′=1e^y\, y' = 1, so y′=e−y=1/xy' = e^{-y} = 1/x. This is the derivative of ln⁡x\ln x (since y=ln⁡xy = \ln x), derived from that of exe^x. A common mistake is xx, which inverts the relation.

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

Answer

3. f′(x)=2x−6=0f'(x) = 2x - 6 = 0 at x=3x = 3, and f′′=2>0f'' = 2 > 0 makes it a minimum. Gradient descent, in Gradient descent and line search, finds the same point numerically. A common mistake is −3-3, a sign slip solving 2x−6=02x - 6 = 0.

Problem 33. Give the minimum value of the ff of Problem 32. [number]

Answer

2. f(3)=9−18+11=2f(3) = 9 - 18 + 11 = 2 (or complete the square: f(x)=(x−3)2+2f(x) = (x - 3)^2 + 2). A common mistake is 11, which is f(0)f(0).

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

Answer

25. Sides aa and 10−a10 - a, area A(a)=a(10−a)A(a) = a(10 - a), A′(a)=10−2a=0A'(a) = 10 - 2a = 0 at a=5a = 5: the square, with area 25. The endpoints a=0a = 0 and a=10a = 10 give 0. A common mistake is 100, a 10×1010 \times 10 square, whose perimeter is 40, not 20.

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

Answer

{−1,1}\{-1, 1\}. f′(x)=3x2−3=0f'(x) = 3x^2 - 3 = 0 gives x=±1x = \pm 1. Common mistakes: {0,3,−3}\{0, \sqrt 3, -\sqrt 3\}, which are the zeros of ff, not of f′f', and {1}\{1\}, which misses the negative root.

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

Answer

e−1e^{-1}. f′(x)=(1−x)e−x=0f'(x) = (1 - x)e^{-x} = 0 at x=1x = 1. Candidates: f(0)=0f(0) = 0, f(1)=e−1f(1) = e^{-1}, and f(x)→0f(x) \to 0 as x→∞x \to \infty, so the maximum is e−1e^{-1}. A common mistake is 1, which is the argmax (where the maximum occurs), not the maximum value.

Problem 37. 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]

Answer

3. L′(c)=2(c−1)+2(c−2)+2(c−6)=6c−18=0L'(c) = 2(c - 1) + 2(c - 2) + 2(c - 6) = 6c - 18 = 0 at c=3c = 3, the mean of 1,2,61, 2, 6. In general the mean minimizes squared error, which is why a constant predictor trained with MSE learns the mean. A common mistake is 2, the median, which minimizes absolute error instead.

Problem 38. 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]

Answer

2. V(s)=s(12−2s)2V(s) = s(12 - 2s)^2 on 0≤s≤60 \le s \le 6. As in the worked box example, V′(s)=(12−2s)(12−6s)V'(s) = (12 - 2s)(12 - 6s), zero at s=6s = 6 and s=2s = 2. Candidates: V(0)=V(6)=0V(0) = V(6) = 0 and V(2)=2⋅82=128V(2) = 2 \cdot 8^2 = 128, so s=2s = 2. Common mistakes: 6, the other root of V′=0V' = 0, a box of zero volume, and 3.

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

Answer

7/2\sqrt 7 / 2. Minimize the squared distance (same minimizer, simpler algebra): D(x)=x2+(x2−2)2=x4−3x2+4D(x) = x^2 + (x^2 - 2)^2 = x^4 - 3x^2 + 4. D′(x)=4x3−6x=2x(2x2−3)D'(x) = 4x^3 - 6x = 2x(2x^2 - 3), zero at x=0x = 0 and x2=3/2x^2 = 3/2. D(0)=4D(0) = 4 and D=94−92+4=74D = \frac94 - \frac92 + 4 = \frac74 at x2=32x^2 = \frac32, so the distance is 7/4=7/2\sqrt{7/4} = \sqrt 7/2. Common mistakes: 2, the distance to the vertex (0,0)(0, 0) (a critical point, but a local maximum of DD), and 7/47/4, the squared distance.

Problems on integration and the fundamental theorem

Section titled “Problems on integration and the fundamental theorem”

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

Answer

1/3. [x33]01=13\left[\frac{x^3}{3}\right]_0^1 = \frac13. A common mistake is 12\frac12, the integral of xx.

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

Answer

2. An antiderivative of sin⁡\sin is −cos⁡-\cos: [−cos⁡x]0π=−(−1)−(−1)=2[-\cos x]_0^\pi = -(-1) - (-1) = 2. A common mistake is 0, a sign slip in −cos⁡-\cos (it is 0 over a full period [0,2π][0, 2\pi], not over [0,π][0, \pi]).

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

Answer

1. [ln⁡x]1e=1−0=1[\ln x]_1^e = 1 - 0 = 1. A common mistake is e−1e - 1, integrating as if the integrand were 1.

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

Answer

6. [x3−x2+x]02=8−4+2=6[x^3 - x^2 + x]_0^2 = 8 - 4 + 2 = 6. A common wrong answer is 10, from mishandling the −2x-2x term (dropping it gives 8+2=108 + 2 = 10).

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

Answer

sin⁡(x2)\sin(x^2). The integrand is the chain rule result of Problem 16 run backwards: ddxsin⁡(x2)=2xcos⁡(x2)\frac{d}{dx}\sin(x^2) = 2x\cos(x^2), and sin⁡(0)=0\sin(0) = 0 fixes the constant at 0. Common mistakes: 2xsin⁡(x2)2x \sin(x^2) (keeping the inner factor) and sin⁡(x2)+1\sin(x^2) + 1 (the wrong constant, with F(0)=1F(0) = 1).

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

Answer

e2−12\dfrac{e^2 - 1}{2}. An antiderivative is 12e2x\frac12 e^{2x} (check: its derivative is e2xe^{2x}). 12(e2−1)\frac12(e^2 - 1). A common mistake is e2−1e^2 - 1, which forgets the 12\frac12 that undoes the inner derivative 2.

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

Answer

1+x3\sqrt{1 + x^3}. FTC part 1: the derivative of an accumulated integral with respect to its upper limit is the integrand at that limit. No antiderivative is needed (and none exists in elementary terms). A common mistake is 1+x3−1\sqrt{1 + x^3} - 1, subtracting the integrand’s value at the lower limit as if evaluating F(x)−F(0)F(x) - F(0).

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

Answer

2xcos⁡(x2)2x \cos(x^2). FTC with a variable upper limit u(x)=x2u(x) = x^2: f(u(x)) u′(x)=cos⁡(x2)⋅2xf(u(x))\,u'(x) = \cos(x^2) \cdot 2x. Check: the integral is sin⁡(x2)\sin(x^2), whose derivative is the same. A common mistake is cos⁡(x2)\cos(x^2), forgetting the chain rule through the upper limit.

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

Answer

2/π2/\pi. Average value =1π−0∫0πsin⁡x dx=2π= \frac{1}{\pi - 0}\int_0^\pi \sin x\,dx = \frac{2}{\pi}, using Problem 41. Common mistakes: 2 (the integral, not divided by the length π\pi) and 0.

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

Answer

1/6. On [0,1][0, 1], x≥x2x \ge x^2, so the area is ∫01(x−x2) dx=12−13=16\int_0^1 (x - x^2)\,dx = \frac12 - \frac13 = \frac16. A common mistake is −16-\frac16, subtracting the curves the wrong way round; an area between curves is the upper minus the lower.

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

Answer

ln⁡2\ln 2. [ln⁡(1+x)]01=ln⁡2−ln⁡1=ln⁡2[\ln(1 + x)]_0^1 = \ln 2 - \ln 1 = \ln 2. A common mistake is 12\frac12, the integrand’s value at an endpoint.

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

Answer

3/8. Width 14\frac14, left endpoints 0,14,12,340, \frac14, \frac12, \frac34: 14(0+14+12+34)=14⋅32=38\frac14\left(0 + \frac14 + \frac12 + \frac34\right) = \frac14 \cdot \frac32 = \frac38. Common mistakes: 58\frac58 (the right sum, endpoints 14,…,1\frac14, \ldots, 1) and 12\frac12 (the exact integral). The trapezoid rule of Definite integrals: trapezoid and Simpson averages the two sums, 12(38+58)=12\frac12(\frac38 + \frac58) = \frac12, exact on this line.

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

Answer

1/2. 0/00/0; differentiate: ex−12x\frac{e^x - 1}{2x}, still 0/00/0; again: ex2→12\frac{e^x}{2} \to \frac12. (Taylor: ex−1−x=x22+⋯e^x - 1 - x = \frac{x^2}{2} + \cdots.) A common mistake is 1, stopping after one application and evaluating ex−1x\frac{e^x - 1}{x} instead.

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

Answer

0. Write it as x2ex\frac{x^2}{e^x}, an ∞/∞\infty/\infty form. Twice: 2xex\frac{2x}{e^x}, then 2ex→0\frac{2}{e^x} \to 0. Any power is eventually beaten by the exponential. A common mistake is ∞\infty.

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

Answer

−1/6-1/6. 0/00/0 three times: cos⁡x−13x2→−sin⁡x6x→−cos⁡x6→−16\frac{\cos x - 1}{3x^2} \to \frac{-\sin x}{6x} \to \frac{-\cos x}{6} \to -\frac16. (Taylor: sin⁡x−x=−x36+⋯\sin x - x = -\frac{x^3}{6} + \cdots.) A common mistake is +16+\frac16, a sign slip.

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

Answer

1. A 000^0 form: take the logarithm. ln⁡xx=xln⁡x→0\ln x^x = x \ln x \to 0 (Problem 7), so xx=exln⁡x→e0=1x^x = e^{x \ln x} \to e^0 = 1. A common mistake is 0, reading 000^0 as 0.

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

Answer

1. 0/00/0; differentiate: 1/x1→1\frac{1/x}{1} \to 1. It is also the derivative of ln⁡\ln at 1 written as a difference quotient. A common mistake is 0.

Problem 57. 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]

Answer

Proof (squeeze). For x>0x > 0, x+sin⁡xx=1+sin⁡xx\frac{x + \sin x}{x} = 1 + \frac{\sin x}{x}. Since ∣sin⁡x∣≤1|\sin x| \le 1, we have ∣sin⁡xx∣≤1x\left|\frac{\sin x}{x}\right| \le \frac{1}{x}, and 1x→0\frac{1}{x} \to 0 as x→∞x \to \infty. By the squeeze theorem (−1x≤sin⁡xx≤1x-\frac1x \le \frac{\sin x}{x} \le \frac1x), sin⁡xx→0\frac{\sin x}{x} \to 0, so the limit is 1+0=11 + 0 = 1.

Why L’Hôpital does not apply. The quotient has the form ∞/∞\infty/\infty, so one might differentiate: (x+sin⁡x)′(x)′=1+cos⁡x1=1+cos⁡x\frac{(x + \sin x)'}{(x)'} = \frac{1 + \cos x}{1} = 1 + \cos x. This oscillates between 0 and 2 and has no limit as x→∞x \to \infty. L’Hôpital’s rule says that if lim⁡f′/g′\lim f'/g' exists then lim⁡f/g\lim f/g equals it; its hypothesis fails here, so it gives no information, even though lim⁡f/g\lim f/g exists and equals 1, as proved above.

The worked answers keep returning to the same handful of errors. This table collects them with the problems where each one appears:

PitfallSymptomHow the worked answers avoid it
Substituting into a 0/00/0 form instead of simplifying firsta removable singularity “evaluated” as 0 or undefinedfactor or multiply by the conjugate first (Problems 1, 8)
Treating 1∞1^\infty as 1compound growth and ee disappeartake the logarithm and find the limit of the exponent (Problem 6)
Differentiating a product factor by factorddxx3sin⁡x\frac{d}{dx} x^3 \sin x given as 3x2cos⁡x3x^2 \cos xthe product rule, both terms (Problems 11, 21)
Forgetting the inner derivative of the chain rulebackward passes off by the inner Jacobian; gradcheck failsevery chain rule answer writes the inner derivative explicitly (Problems 13, 16, 23, 45, 47)
Using the power rule on a variable exponentxxx^x differentiated as x⋅xx−1x \cdot x^{x-1}rewrite as exln⁡xe^{x \ln x} first (Problem 19)
Reporting the argmax instead of the max, or keeping a degenerate critical pointthe wrong number answered, or a zero-volume box chosenlist every candidate with its value and compare (Problems 36, 38)
Dropping the sign of a related ratea falling ladder reported as risingkeep the sign from y˙=−xx˙/y\dot y = -x\dot x/y (Problem 29)
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 existsre-check the form after each application (Problem 52); check that lim⁡f′/g′\lim f'/g' exists before using it (Problem 57)

Warning: The forgotten inner derivative is the mistake that matters most in code. On paper it costs a point; in a backward pass it produces a gradient that is wrong by a factor and still trains, until gradcheck catches it.

These problems feed directly into code. The limit of Problem 4 is what the finite differences of Derivatives and finite differences approximate, trading truncation against rounding in the choice of step. The activation derivatives of Problems 13 to 15 and 21 appear in code, checked against PyTorch, in Activation Functions and Their Derivatives. Gradients and gradcheck compares an analytic derivative (the rules) with a numerical one (the limits). Gradient descent and line search finds the critical points of Problems 32 to 39 numerically. The Calculus 2 problem set continues with integration techniques, improper integrals, series, and differential equations.

  • OpenStax, Calculus Volume 1 (free), chapters 2 to 5.
  • 3Blue1Brown, Essence of Calculus, episodes 1 to 9.
  • limit: the value LL that f(x)f(x) approaches as x≠ax \ne a approaches aa, defined by ε\varepsilon and δ\delta.
  • indeterminate form: an expression such as 0/00/0 or 1∞1^\infty that signals a limit must be rewritten.
  • chain rule: ddxf(g(x))=f′(g(x)) g′(x)\frac{d}{dx} f(g(x)) = f'(g(x))\, g'(x).
  • critical point: a point where f′(x)=0f'(x) = 0, a candidate for an interior optimum.
  • related rates: rates of change tied together by differentiating a constraint in time.
  • fundamental theorem of calculus: ∫abf=F(b)−F(a)\int_a^b f = F(b) - F(a) for F′=fF' = f, and ddx∫axf=f(x)\frac{d}{dx}\int_a^x f = f(x).
  • L’Hôpital’s rule: for 0/00/0 or ∞/∞\infty/\infty forms, lim⁡f/g=lim⁡f′/g′\lim f/g = \lim f'/g' when the latter exists.
  • 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 (Problems 1, 8).
  • The product, quotient, and chain rules compute every derivative the autograd needs; the sigmoid, softplus, tanh, and SiLU derivatives are four lines each (Problems 13 to 15, 21).
  • An optimum of a smooth function sits where f′=0f' = 0 or on the boundary, and you still have to check which candidate wins (Problems 36, 38).
  • 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) (Problems 46, 47).
  • L’Hôpital’s rule turns 0/00/0 and ∞/∞\infty/\infty into a limit of derivatives, and applies only when that limit exists (Problem 57).