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 and , treating as a function of , then solving for ; it gives slopes of curves such as that are not written as . Read more: Chapter 7: Calculus 1
- sigmoid: , mapping the real line into , with . Read more: 7.3 Activation Functions and Their Derivatives
- softplus: , a smooth relu whose derivative is . Read more: 7.3 Activation Functions and Their Derivatives
- SiLU (swish): , the gate inside SwiGLU. Read more: 7.3 Activation Functions and Their Derivatives
- definite integral: the limit of Riemann sums, the signed area between and the 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: , the derivative of a power, and with linearity the derivative of any polynomial. Read more: Chapter 7: Calculus 1
- Cross-entropy: , the average surprise when data from are predicted with . Read more: 17.1 Entropy, cross-entropy, KL, JS, and the k3 estimator
- One-sided limit: or , the limit as approaches 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: and , the rules for differentiating a product or a ratio of two functions. Read more: Chapter 7: Calculus 1
- Change of base: the identity , which makes every logarithm a natural log divided by a constant. Read more: 6.1 Exponents, logarithms, and units of information
- Riemann sum: , the sum of thin rectangles under . 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 near and , then ; it settles limits such as that substitution cannot. Read more: Chapter 7: Calculus 1
- Jacobian: the matrix of partial derivatives of a function . 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 . 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.
The rules you will use
Section titled “The rules you will use”This review collects the definitions and rules the problems rely on, in the order the problems use them.
Limits
Section titled “Limits”means that gets arbitrarily close to as gets close to . Precisely: for every there is a such that implies . The value plays no part, which is why has a limit at 2 even though it is undefined there: for it equals . Limits add, multiply, and divide (when the denominator’s limit is not 0).
Three standard limits do most of the work: as , as , and, for rational functions at infinity, only the highest powers matter. A one-sided limit restricts to one side of . Forms like , , , , , and are indeterminate: they say the problem needs rewriting (factor, multiply by a conjugate, take logarithms), not what the answer is.
Derivative rules
Section titled “Derivative rules”The derivative is the limit of the difference quotient, , and the second derivative is the derivative of . From that definition follow the rules you use instead of it: linearity; the power rule for a constant ; , , , ; the product rule ; the quotient rule ; and the chain rule, : 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 , needs first; the power rule does not apply. Several problems use the sigmoid, .
Implicit differentiation and related rates
Section titled “Implicit differentiation and related rates”When is defined by an equation such as , differentiate both sides with respect to , treating as a function of (so ), and solve for . Related rates apply the same idea with time : if two quantities are tied by an equation and both change with , differentiating the equation in ties their rates.
Optimization
Section titled “Optimization”At an interior minimum or maximum of a differentiable , ; 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: is a local minimum, a local maximum. Gradient descent, in Gradient descent and line search, finds the same points numerically when solving by hand is impossible.
Integrals and the fundamental theorem
Section titled “Integrals and the fundamental theorem”The definite integral , the signed area under from to , is the limit of Riemann sums over finer and finer partitions. The fundamental theorem of calculus (FTC) connects it to derivatives in two ways: if is an antiderivative of (), then ; and for continuous . With a variable upper limit , the chain rule adds a factor: . The average value of on is .
L’Hôpital’s rule
Section titled “L’Hôpital’s rule”If and (or both ) as , and exists, then equals it. It may need several applications ( takes two). Products become quotients, and powers or become products after taking the logarithm. When the limit of does not exist, the rule says nothing, and the original limit may still exist (Problem 57).
Two worked examples
Section titled “Two worked examples”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 . The outer function is with derivative ; the inner is with derivative (the chain rule again, with inner function ). So . Multiply top and bottom by : . This is the derivative of the binary cross-entropy for a positive label, written in terms of the logit. Both and are the same answer written two ways; , the sigmoid itself, is not (it has the wrong sign and the wrong argument).
An optimization. Maximize for , the volume of an open box folded from a sheet. . The critical points are (a zero-volume box) and . Compare candidates: , , . The maximizer is .
Now the problems. Numbers are exact (, , , not decimals), and an expression answer may take any equivalent form. The tag after each problem says what kind of answer it wants.
Problems on limits
Section titled “Problems on limits”Problem 1. . [number]
Answer
4. Substituting gives , a signal to rewrite. Factor: for , and the limit never looks at , so it is . A common mistake is 0, from substituting into the numerator only.
Problem 2. . [number]
Answer
3. Write and use with . A common mistake is 1, applying the standard limit without matching its argument, which drops the factor 3.
Problem 3. . [number]
Answer
3/5. Divide top and bottom by : . 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. . (Which derivative is this?) [number]
Answer
3. It is the difference quotient of at , so the limit is . Directly: , and dividing by gives . The finite differences of Derivatives and finite differences approximate exactly this limit with a fixed . A common mistake is 1.
Problem 5. . [number]
Answer
1/2. Multiply top and bottom by : . (Or L’Hôpital twice: .) A common mistake is 0, reading as the whole answer.
Problem 6. . [number]
Answer
. The standard limit with . To see it, take logs: , a form whose limit is 2 (L’Hôpital, or ), so the limit is . Two common mistakes: 1, reading as 1 (it is indeterminate), and , dropping the 2.
Problem 7. . [number]
Answer
0. A form. Rewrite as , an form, and apply L’Hôpital: . The factor goes to 0 faster than goes to . A common mistake is .
Problem 8. . [number]
Answer
1/2. An form. Multiply by the conjugate: . A common mistake is 0, reading as 0.
Problem 9. (from the left). [number]
Answer
. For , , so the quotient is 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 : for every , give a such that implies . [proof]
Answer
Proof (direct). Let be given. For every real , . Choose , which is positive. If , then . Since was arbitrary, the definition of the limit holds, so .
A complete proof states the goal, rewrites the distance as , names explicitly (any positive works), and shows that this works for every such .
Problems on derivative rules and the chain rule
Section titled “Problems on derivative rules and the chain rule”Problem 11. . [expr in x]
Answer
. Product rule, , with and . A common mistake is : differentiating each factor and multiplying, which is not a rule.
Problem 12. . [expr in x]
Answer
, which is . Quotient rule: , then factor out . Common mistakes: in the numerator (the quotient rule’s minus sign flipped), and (differentiating top and bottom separately).
Problem 13. The sigmoid is . Give . [expr in z]
Answer
, equal to . Chain rule on : the outer derivative is , the inner derivative is , 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 itself.
Problem 14. Softplus is . Give . [expr in x]
Answer
, which is . Chain rule: . A common mistake is , which forgets the inner derivative and is .
Problem 15. . Give in terms of exponentials. [expr in x]
Answer
. Quotient rule: the numerator’s derivative is and the denominator’s is , so . The difference of squares is . This equals . Common mistakes: (the 4 lost), and (the square lost).
Problem 16. . [expr in x]
Answer
. Chain rule: outer evaluated at the inner , times the inner derivative . Common mistakes: (the inner derivative forgotten) and (the outer derivative evaluated at instead of at ).
Problem 17. . [expr in x]
Answer
. , times the inner derivative : . A common mistake is , without the inner derivative.
Problem 18. for . [expr in x]
Answer
, that is . Chain rule: . A common mistake is , without the inner derivative.
Problem 19. for . (Write .) [expr in x]
Answer
. . A common mistake is : the power rule, which holds only for a constant exponent.
Problem 20. , the shape of the normal density. [expr in x]
Answer
. Chain rule: with and . This is the that the Gaussian integrals of the Calculus 2 problem set use. Common mistakes: (no inner derivative) and (the exponent multiplied in instead of its derivative).
Problem 21. SiLU (swish) is . Give its derivative. [expr in x]
Answer
, that is . Product rule on , using Problem 13 for . This is the backward of SwiGLU’s gate in Gated MLPs: SwiGLU and GeGLU. A common mistake is to keep only the second term, , forgetting that itself also changes.
Problem 22. . [expr in x]
Answer
. First derivative by the product rule: . Again: . A common mistake is , which is only the first derivative.
Problem 23. . Give . [number]
Answer
160. , so . A common mistake is 80, which drops the inner derivative .
Problem 24. for . [expr in x]
Answer
. Change of base: , and is a constant. Common mistakes: (the derivative of , not ) and (the constant inverted).
Problem 25. Prove from the limit definition that the derivative of is . [proof]
Answer
Proof (direct, from the definition). Fix a real . By definition, when this limit exists. For , Cancelling is allowed because the limit as only looks at , so the difference quotient equals at every point the limit uses. is a polynomial in , hence continuous, so . Therefore , for every real .
The step most often skipped is the justification for cancelling : it is exactly the fact that a limit ignores the point itself (see the review of limits above).
Problems on implicit differentiation and related rates
Section titled “Problems on implicit differentiation and related rates”Problem 26. The circle passes through . Give the slope there. [number]
Answer
. Differentiate in : , so . A common mistake is , which is .
Problem 27. defines implicitly near . Give as a formula in and . [expr in x, y]
Answer
. Differentiate in : the product rule on gives , and the chain rule on gives . So and ; at the slope is . Common mistakes: (differentiating as alone, dropping the term of the product rule) and (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
. , so by the chain rule through time . A common mistake is , which forgets .
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
. With foot distance and top height , ; at , . Differentiate in : , so . Common mistakes: (the sign dropped: the top falls) and (the ratio inverted).
Problem 30. A sphere’s volume grows at 100 cm³/s. Give (cm/s) when the radius is 5 cm. [number]
Answer
. , so . At : , so . A common wrong answer is , an arithmetic slip in evaluating .
Problem 31. for . Differentiate implicitly and give as a formula in alone. [expr in x]
Answer
. , so . This is the derivative of (since ), derived from that of . A common mistake is , which inverts the relation.
Problems on optimization
Section titled “Problems on optimization”Problem 32. . Give the that minimizes . [number]
Answer
3. at , and makes it a minimum. Gradient descent, in Gradient descent and line search, finds the same point numerically. A common mistake is , a sign slip solving .
Problem 33. Give the minimum value of the of Problem 32. [number]
Answer
2. (or complete the square: ). A common mistake is 11, which is .
Problem 34. A rectangle has perimeter 20. Give its largest possible area. [number]
Answer
25. Sides and , area , at : the square, with area 25. The endpoints and give 0. A common mistake is 100, a square, whose perimeter is 40, not 20.
Problem 35. Give the set of critical points of . [set]
Answer
. gives . Common mistakes: , which are the zeros of , not of , and , which misses the negative root.
Problem 36. Give the maximum of over . [number]
Answer
. at . Candidates: , , and as , so the maximum is . A common mistake is 1, which is the argmax (where the maximum occurs), not the maximum value.
Problem 37. Give the that minimizes , a one-parameter least-squares fit. [number]
Answer
3. at , the mean of . 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 sheet by cutting a square of side from each corner. Give the that maximizes the volume. [number]
Answer
2. on . As in the worked box example, , zero at and . Candidates: and , so . Common mistakes: 6, the other root of , a box of zero volume, and 3.
Problem 39. Give the shortest distance from the point to the parabola . [number]
Answer
. Minimize the squared distance (same minimizer, simpler algebra): . , zero at and . and at , so the distance is . Common mistakes: 2, the distance to the vertex (a critical point, but a local maximum of ), and , the squared distance.
Problems on integration and the fundamental theorem
Section titled “Problems on integration and the fundamental theorem”Problem 40. . [number]
Answer
1/3. . A common mistake is , the integral of .
Problem 41. . [number]
Answer
2. An antiderivative of is : . A common mistake is 0, a sign slip in (it is 0 over a full period , not over ).
Problem 42. . [number]
Answer
1. . A common mistake is , integrating as if the integrand were 1.
Problem 43. . [number]
Answer
6. . A common wrong answer is 10, from mishandling the term (dropping it gives ).
Problem 44. Give the antiderivative of with . [expr in x]
Answer
. The integrand is the chain rule result of Problem 16 run backwards: , and fixes the constant at 0. Common mistakes: (keeping the inner factor) and (the wrong constant, with ).
Problem 45. . [number]
Answer
. An antiderivative is (check: its derivative is ). . A common mistake is , which forgets the that undoes the inner derivative 2.
Problem 46. for . [expr in x]
Answer
. 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 , subtracting the integrand’s value at the lower limit as if evaluating .
Problem 47. . [expr in x]
Answer
. FTC with a variable upper limit : . Check: the integral is , whose derivative is the same. A common mistake is , forgetting the chain rule through the upper limit.
Problem 48. Give the average value of over . [number]
Answer
. Average value , using Problem 41. Common mistakes: 2 (the integral, not divided by the length ) and 0.
Problem 49. Give the area between and for . [number]
Answer
1/6. On , , so the area is . A common mistake is , subtracting the curves the wrong way round; an area between curves is the upper minus the lower.
Problem 50. . [number]
Answer
. . A common mistake is , the integrand’s value at an endpoint.
Problem 51. Give the left Riemann sum of on with equal pieces. [number]
Answer
3/8. Width , left endpoints : . Common mistakes: (the right sum, endpoints ) and (the exact integral). The trapezoid rule of Definite integrals: trapezoid and Simpson averages the two sums, , exact on this line.
Problems on L’Hôpital’s rule
Section titled “Problems on L’Hôpital’s rule”Problem 52. . [number]
Answer
1/2. ; differentiate: , still ; again: . (Taylor: .) A common mistake is 1, stopping after one application and evaluating instead.
Problem 53. . [number]
Answer
0. Write it as , an form. Twice: , then . Any power is eventually beaten by the exponential. A common mistake is .
Problem 54. . [number]
Answer
. three times: . (Taylor: .) A common mistake is , a sign slip.
Problem 55. . [number]
Answer
1. A form: take the logarithm. (Problem 7), so . A common mistake is 0, reading as 0.
Problem 56. . [number]
Answer
1. ; differentiate: . It is also the derivative of at 1 written as a difference quotient. A common mistake is 0.
Problem 57. Show that , and explain why L’Hôpital’s rule cannot be used to get it. [proof]
Answer
Proof (squeeze). For , . Since , we have , and as . By the squeeze theorem (), , so the limit is .
Why L’Hôpital does not apply. The quotient has the form , so one might differentiate: . This oscillates between 0 and 2 and has no limit as . L’Hôpital’s rule says that if exists then equals it; its hypothesis fails here, so it gives no information, even though exists and equals 1, as proved above.
Common mistakes
Section titled “Common mistakes”The worked answers keep returning to the same handful of errors. This table collects them with the problems where each one appears:
| Pitfall | Symptom | How the worked answers avoid it |
|---|---|---|
| Substituting into a form instead of simplifying first | a removable singularity “evaluated” as 0 or undefined | factor or multiply by the conjugate first (Problems 1, 8) |
| Treating as 1 | compound growth and disappear | take the logarithm and find the limit of the exponent (Problem 6) |
| Differentiating a product factor by factor | given as | the product rule, both terms (Problems 11, 21) |
| Forgetting the inner derivative of the chain rule | backward passes off by the inner Jacobian; gradcheck fails | every chain rule answer writes the inner derivative explicitly (Problems 13, 16, 23, 45, 47) |
| Using the power rule on a variable exponent | differentiated as | rewrite as first (Problem 19) |
| Reporting the argmax instead of the max, or keeping a degenerate critical point | the wrong number answered, or a zero-volume box chosen | list every candidate with its value and compare (Problems 36, 38) |
| Dropping the sign of a related rate | a falling ladder reported as rising | keep the sign from (Problem 29) |
| Applying L’Hôpital once too few times, or where has no limit | a wrong finite limit, or no answer to a limit that exists | re-check the form after each application (Problem 52); check that 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.
Where this leads
Section titled “Where this leads”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.
Further reading
Section titled “Further reading”- OpenStax, Calculus Volume 1 (free), chapters 2 to 5.
- 3Blue1Brown, Essence of Calculus, episodes 1 to 9.
Key terms
Section titled “Key terms”- limit: the value that approaches as approaches , defined by and .
- indeterminate form: an expression such as or that signals a limit must be rewritten.
- chain rule: .
- critical point: a point where , a candidate for an interior optimum.
- related rates: rates of change tied together by differentiating a constraint in time.
- fundamental theorem of calculus: for , and .
- L’Hôpital’s rule: for or forms, when the latter exists.
Summary
Section titled “Summary”- A limit describes what approaches, not itself; and 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 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 (Problems 46, 47).
- L’Hôpital’s rule turns and into a limit of derivatives, and applies only when that limit exists (Problem 57).