8.3 Calculus 2 problem set: integration techniques, the Gaussian, series, Taylor, polar, and ODEs
The code in this chapter leans on second-semester calculus in three places. Taylor series, remainder bounds, and range reduction computes and from Taylor polynomials and checks them against a Lagrange remainder bound, and Polynomial approximation and range reduction: expf in C later puts the same polynomial in C. Series convergence, the EMA as a geometric series, and bias correction treats the exponential moving average as a geometric series and derives from its partial sum the bias correction that Adam and AdamW relies on. And Random variables, expectation, variance, and normal draws by Box-Muller and Variance propagation and initialization draw normal random numbers and pick initialization scales from integrals of the normal density, which exist only because converges to .
Concepts from other sections (32)
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.
- Taylor polynomial: the degree- polynomial whose value and first derivatives at a point match those of . Read more: 8.1 Taylor series, remainder bounds, and range reduction
- Lagrange remainder: the exact error of a Taylor polynomial, for some unknown between and . Read more: 8.1 Taylor series, remainder bounds, and range reduction
- Exponential moving average (EMA): the recursion , a weighted sum with geometric weights. Read more: 8.2 Series convergence, the EMA as a geometric series, and bias correction
- Geometric series: , with partial sum and limit for . Read more: 8.2 Series convergence, the EMA as a geometric series, and bias correction
- Bias correction: dividing by its weight total so the zero start no longer pulls the average toward 0. Read more: 8.2 Series convergence, the EMA as a geometric series, and bias correction
- Integration by parts: , the product rule in reverse; it integrates products of two kinds of function, such as , and LIATE is a heuristic for choosing . Read more: Chapter 8: Calculus 2
- Partial fractions: decomposing a rational function with into a sum of simpler fractions over the factors of , each of which integrates to a logarithm or an arctangent. Read more: Chapter 8: Calculus 2
- Trigonometric substitution: replacing by , , or to remove a square root of the form , , or from an integrand. Read more: Chapter 8: Calculus 2
- Alternating series test: if decreases to 0, the series converges, even when does not. Read more: Chapter 8: Calculus 2
- Range reduction: rewriting so the polynomial only ever sees a small argument . Read more: 8.1 Taylor series, remainder bounds, and range reduction
- Ordinary differential equation (ODE): an equation relating a function of one variable to its derivatives, such as ; it models how a system changes, and gradient descent is Euler’s method applied to one. Read more: Chapter 8: Calculus 2
- Standard normal: the distribution with density . Read more: 13.1 Random variables, expectation, variance, and normal draws by Box-Muller
- Power series: a series in powers of ; it converges for less than its radius of convergence and can diverge beyond it. Read more: Chapter 8: Calculus 2
- Polar coordinates: describing a point by its distance from the origin and angle , with and ; a polar curve sweeps area . Read more: Chapter 8: Calculus 2
- Chain rule: . Read more: 10.2 Jacobians, the multivariable chain rule, and numeric JVP/VJP
- Product rule / quotient rule: and , the rules for differentiating a product or a ratio of two functions. Read more: Chapter 7: Calculus 1
- Arc length: the length of a curve, for , or for a parametric curve: the integral of speed. Read more: Chapter 8: Calculus 2
- Integrating factor: the multiplier that turns the first-order linear ODE into , which can be integrated directly. Read more: Chapter 8: Calculus 2
- sigmoid: , mapping the real line into , with . Read more: 7.3 Activation Functions and Their Derivatives
- fundamental theorem of calculus: if , then . Read more: 7.4 Definite Integrals: Trapezoid and Simpson
- Second moment (,
exp_avg_sq): the EMA of the elementwise squared gradient. Read more: 16.3 Adam and AdamW: bias correction and decoupled weight decay - Kaiming (He) initialization: weight variance (or ), compensating for ReLU zeroing half its inputs. Read more: 13.4 Variance propagation and initialization
- First moment (,
exp_avg): the EMA of the gradient. Read more: 16.3 Adam and AdamW: bias correction and decoupled weight decay - Jacobian: the matrix of partial derivatives of a function . Read more: 10.2 Jacobians, the multivariable chain rule, and numeric JVP/VJP
- Determinant: a single number for a square matrix: the factor by which scales signed volume. It is zero exactly when squashes space flat and so cannot be inverted, and . Read more: Chapter 9: Linear Algebra
- Integral test: if is positive, continuous, and decreasing with , then and converge or diverge together. Read more: Chapter 8: Calculus 2
- p-series / harmonic series: , which converges if and only if ; the harmonic series is the case and diverges, growing like , which is why it appears in hashing and coupon-collector analyses. Read more: Chapter 8: Calculus 2
- Ratio test: if successive term ratios eventually stay below some , the series converges. Read more: 8.2 Series convergence, the EMA as a geometric series, and bias correction
- GELU: , the input weighted by the standard normal CDF; its tanh approximation is a different function. Read more: 7.3 Activation Functions and Their Derivatives
- Unit circle: the circle of radius 1 about the origin; the point at angle is . Read more: 6.2 Trigonometry, rotations, complex numbers, and Euler’s formula
- Box-Muller: the transform , that turns two uniforms into two independent standard normals. Read more: 13.9 Probability problem set, part a: axioms, Bayes, random variables, Box-Muller
- Change of variables (multiple integrals): for a substitution , , where is the Jacobian determinant of ; it measures how stretches area, and it gives the in polar and the in spherical coordinates. Read more: Chapter 10: Calculus 3
This problem set practises the hand techniques behind those sections: integrating by parts and by substitution, improper integrals and the Gaussian, convergence of series, Taylor remainders, parametric and polar curves, and the simplest differential equations. It is pen-and-paper work with no code. It is best taken after the two sections of this chapter, and it assumes the derivatives, antiderivatives, and fundamental theorem practised in the Calculus 1 problem set.
The set has 52 problems: 48 with exact answers and 4 proofs (Problems 12, 18, 30, and 40). Every problem is followed by a collapsed worked answer with the final result, the derivation, and the common wrong answers and why they are wrong. Model proofs are also kept in course/solutions/solve/S-M02/. Try each problem before opening its answer.
Learning objectives
- Choose and carry out substitution, integration by parts, partial fractions, or a trigonometric substitution for a given integral.
- Decide whether an improper integral converges, and evaluate the Gaussian integral and simple Gaussian moments.
- Apply the geometric, -series, integral, ratio, and alternating series tests, including at the endpoints of an interval of convergence.
- Write Taylor polynomials, bound their error with the Lagrange remainder, and perform range reduction for .
- Solve separable, linear, and logistic first-order ODEs, and connect Euler’s method to gradient descent.
The tools in brief
Section titled “The tools in brief”The problems use the following notation:
| Symbol | Meaning | Type / shape |
|---|---|---|
| functions in integration by parts | functions | |
| improper integral, | real or divergent | |
| standard normal density, | function | |
| , | a series and its partial sum | real |
| radius of convergence of a power series | nonnegative real | |
| degree Taylor polynomial at 0, | polynomial | |
| remainder | real | |
| polar coordinates: , | reals | |
| , | an unknown function of time and its derivative | function |
| the step size of Euler’s method | positive real |
Integration techniques
Section titled “Integration techniques”Substitution reverses the chain rule: with , and you change the limits with it. Integration by parts reverses the product rule: ; pick to be the factor that gets simpler when differentiated (, ). Partial fractions split a rational function into simple pieces: . Trigonometric identities such as and substitutions such as remove squares and square roots.
Improper integrals and the Gaussian
Section titled “Improper integrals and the Gaussian”An integral over an infinite range, or of a function that blows up at an endpoint, is defined as a limit, and it converges when the limit is finite: but , and although the integrand is unbounded.
The Gaussian integral has no elementary antiderivative. The trick is that is a double integral over the plane, and in polar coordinates () it becomes . Substituting gives , the constant of the normal density. By symmetry, is half of .
Series and convergence
Section titled “Series and convergence”A series converges to when its partial sums . The standard tests are these: a geometric series for ; the -series converges exactly for (compare with , the integral test); the ratio test gives convergence when ; and an alternating series with terms decreasing to 0 converges. A power series converges for and diverges for , and each endpoint needs its own test.
Taylor polynomials and the remainder
Section titled “Taylor polynomials and the remainder”matches and its first derivatives at 0. Lagrange’s form of the remainder says for some between 0 and , so a bound on bounds the error. The error grows like , so implementations shrink first: range reduction writes with and computes , where a degree 6 polynomial in already reaches float32 precision.
Parametric curves and polar coordinates
Section titled “Parametric curves and polar coordinates”A curve has slope and arc length . In polar coordinates the area swept by is , and multiplying an equation by converts it to Cartesian form with , , .
First-order differential equations
Section titled “First-order differential equations”has the solution (separate variables: ). A linear equation is solved with the integrating factor . The logistic equation separates by partial fractions and gives the sigmoid. Euler’s method steps . Gradient descent with learning rate is exactly Euler’s method on the gradient flow , and The Optimizer protocol: SGD, momentum, Nesterov, weight decay shows that momentum is Euler’s method on the heavy-ball equation.
Two examples worked by hand
Section titled “Two examples worked by hand”Before the set itself, here are two warm-ups. They are siblings of Problems 1 and 17, not problems of the set.
First, integration by parts applied twice. Compute . Take , , so , : the integral is . Apply parts again with : . The total is . Keep it exact as ; the decimal is only an approximation.
Second, a Gaussian moment. For a standard normal , . Substitute , : . So .
The problems
Section titled “The problems”Answers are exact (for example , not 0.2027). The tag after each problem says what kind of answer is expected: [number], [expr in x], [interval], [bool], [proof], and so on. The problems are grouped by topic and run in the same order as the review above.
Integration techniques
Section titled “Integration techniques”Problem 1. (by parts). [number]
Answer
. By parts with , : . A common mistake is , which keeps only and drops the boundary term .
Problem 2. . [number]
Answer
. By parts with , : . Answering forgets to subtract .
Problem 3. . [number]
Answer
. By parts with , : , since . A common mistake is , from taking the antiderivative of as .
Problem 4. (substitution). [number]
Answer
. With , , so and the limits become 1 and 2: . Answering loses the from .
Problem 5. . [number]
Answer
. Use : . Answering forgets the halving in the identity.
Problem 6. (partial fractions). [number]
Answer
. Partial fractions: . Then . Common mistakes: (the of the decomposition lost) and (an evaluation slip at the limits).
Problem 7. Give the antiderivative of with . [expr in x]
Answer
. By parts twice: . The condition gives . A common mistake is to stop at , which has ; treats as a constant.
Problem 8. . [number]
Answer
. With , : (the sign of is absorbed by swapping the limits ). Answering loses the .
Problem 9. . [number]
Answer
. By parts with , : . Answering 0 drops the boundary term .
Problem 10. . [number]
Answer
. With , , write . Then . Answering 1 loses the .
Problem 11. (substitute ). [number]
Answer
. With , and , so the integrand becomes . The limits are and . Answering uses for the upper limit.
Problem 12. Derive the integration by parts formula from the product rule and the fundamental theorem of calculus. [proof]
Answer
Claim. If and are differentiable on with and continuous (hence integrable) there, then .
Proof. By the product rule, on . Integrate both sides from to . The left side is the integral of the derivative of , so by the fundamental theorem of calculus it equals . The right side splits by linearity: , both of which exist by the continuity assumption. So , and subtracting gives the claim.
A complete proof states the product rule, applies the fundamental theorem to the left side, uses linearity to split the right side, and names the integrability assumption. Model proof also in q12.md.
Improper integrals and the Gaussian
Section titled “Improper integrals and the Gaussian”Problem 13. . [number]
Answer
. . It converges because ; answering confuses it with .
Problem 14. . [number]
Answer
. . Answering 2 multiplies by the rate instead of dividing.
Problem 15. (improper at 0). [number]
Answer
. as . The integrand is unbounded at 0, but the integral converges ( near 0). Calling it is the common mistake.
Problem 16. . [number]
Answer
. This is the Gaussian integral from the review above, proved in Problem 18: . It matters because the normalizer of the normal density in Random variables, expectation, variance, and normal draws by Box-Muller is this integral rescaled. Common mistakes: , which is , and , which is .
Problem 17. is a standard normal with density . Give , the second moment of a ReLU of a standard normal. [number]
Answer
. is even, so the half-line integral is half of the full one, and . So . This is the factor Kaiming initialization (Variance propagation and initialization) undoes with gain : a ReLU keeps half the second moment. Common mistakes: 1 (the full second moment) and (the value , a first moment).
Problem 18. Prove by squaring the integral and changing to polar coordinates. [proof]
Answer
Claim. .
Proof. First, converges: for all (since ), and is finite. Because the integral converges absolutely, the product of two copies is a double integral over the plane (Fubini): Change to polar coordinates , . The Jacobian determinant is , so , and : The inner integral, with , , is . The outer integral of over is . So , and since the integrand is positive, and .
The steps a proof must contain: the double integral (with convergence), the area element , the evaluation of both integrals, and the sign argument for taking the positive root. Model proof also in q18.md.
Series and convergence tests
Section titled “Series and convergence tests”Problem 19. Does converge? [bool]
Answer
Yes. It is a -series with ; by the integral test it is bounded by . (Its sum is .)
Problem 20. Does converge? [bool]
Answer
No. The harmonic series diverges (proof in Problem 30), even though its terms go to 0. Terms tending to 0 is necessary for convergence, not sufficient.
Problem 21. . [number]
Answer
. Geometric with , starting at : . Answering 2 starts the sum at (that sum is ). The EMA of Series convergence, the EMA as a geometric series, and bias correction is a truncated series of this kind.
Problem 22. (telescoping). [number]
Answer
. , so the partial sum telescopes to . Answering stops at the first term.
Problem 23. . [number]
Answer
. Differentiate and multiply by : . At : . Answering 1 sums instead.
Problem 24. Does converge? (Ratio test.) [bool]
Answer
Yes. Ratio test: .
Problem 25. Does the alternating series converge? [bool]
Answer
Yes. By the alternating series test: the terms decrease to 0, so the partial sums converge (conditionally; the absolute series is harmonic).
Problem 26. Give the sum . [number]
Answer
. The series is at , which is allowed because the series converges there (Problem 25) and Abel’s theorem carries the value to the endpoint. Common mistakes: (sign of the first term) and 1 (the first term alone).
Problem 27. Give the radius of convergence of . [number]
Answer
. Ratio test on : , so the series converges for and diverges for . The does not change the radius; is the radius of .
Problem 28. Give the interval of convergence of , endpoints included or not. [interval]
Answer
. The radius is 1 (Problem 27). At the series is harmonic and diverges; at it is , which converges by the alternating series test. Common mistakes: , which drops the convergent left endpoint, and , which keeps the divergent right one.
Problem 29. Give the set of real for which converges. [interval]
Answer
. The integral test compares with , finite exactly when . Including (answering ) includes the harmonic series.
Problem 30. Prove that diverges. [proof]
Answer
Claim. diverges.
Proof (grouping). Let . Group the terms after the first into blocks for . Block has terms, and each satisfies , so . Hence each block sums to at least . For , The partial sums increase (all terms are positive) and , so they are unbounded and have no finite limit. The series diverges, even though .
The integral test is an equally good route: , since . Either proof needs a lower bound that grows without limit, a justification of each inequality, and the conclusion that unbounded partial sums mean divergence. Model proof also in q30.md.
Taylor series and remainders
Section titled “Taylor series and remainders”Problem 31. Give the degree 3 Taylor polynomial of at 0. [expr in x]
Answer
. Every derivative of at 0 is 1, so the coefficients are . Common mistakes: (factorials forgotten) and stopping at degree 2.
Problem 32. Give the Maclaurin series of through the term. [expr in x]
Answer
. Integrate term by term from 0. Answering loses the alternating signs (that is ).
Problem 33. Give the coefficient of in the Maclaurin series of . [number]
Answer
. , and the signs alternate starting with , so the term is . Common mistakes: (sign) and (dividing by 5 instead of ).
Problem 34. Give the degree 4 Taylor polynomial of at 0. [expr in x]
Answer
. The derivatives of at 0 cycle , divided by . Answering divides by 4 instead of .
Problem 35. With the Lagrange remainder, bound for , where is the degree 3 Taylor polynomial at 0. Use for the unknown point and give the bound. [number]
Answer
. The Lagrange remainder of degree 3 is with between 0 and . For , and , so . The exp polynomial of Taylor series, remainder bounds, and range reduction is checked against exactly this kind of bound. Common mistakes: a remainder of the wrong degree (such as ), and , which drops the factor and is too optimistic.
Problem 36. Give the smallest with . [number]
Answer
. , so (too big), while gives . So and . Answering 10 reports .
Problem 37. Give the degree 3 Taylor polynomial of at 0. [expr in x]
Answer
. The geometric series ; every derivative at 0 is , so every coefficient is 1. Answering gives the series of .
Problem 38. Range reduction writes with the integer nearest to , so that with . For , give . [number]
Answer
. , so the nearest integer is and , within . The exp_range_reduced of Taylor series, remainder bounds, and range reduction and the C tl_expf of Polynomial approximation and range reduction: expf in C use exactly this reduction. Common mistakes: (rounding up, so ) and (the remainder in units of , not in ).
Problem 39. . Give the first three nonzero terms of its Maclaurin series. [expr in x]
Answer
. Expand and integrate from 0 to : , then multiply by . The erf_series of Taylor series, remainder bounds, and range reduction feeds the exact GELU of Activation Functions and Their Derivatives. Common mistakes: (the of lost) and dropping the .
Problem 40. Prove that for every real . [proof]
Answer
Claim. For every real , .
Proof. Let . Its derivatives at 0 are for orders 0 to 4, so the degree 4 Taylor polynomial is (the coefficient is 0, so it equals the degree 3 polynomial). Taylor’s theorem with the Lagrange remainder gives, for each , a point between 0 and with Since and , . At both sides are 0. So the inequality holds for every real .
The key step is using the degree 4 remainder: treating as only a degree 3 polynomial gives the weaker bound . Model proof also in q40.md.
Parametric curves and polar coordinates
Section titled “Parametric curves and polar coordinates”Problem 41. The curve , . Give at . [number]
Answer
. , which is at . Answering computes .
Problem 42. Give the arc length of , for . [number]
Answer
. The speed is , so the length is the parameter range, a quarter of the unit circle. Answering 1 gives the radius, not the length of the arc.
Problem 43. Give the arc length of , for . [number]
Answer
. The speed is . With , : . Answering drops the lower limit .
Problem 44. Give the area enclosed by the polar curve , . [number]
Answer
. . Check: is the circle of radius 1. Answering forgets the in .
Problem 45. Rewrite the polar curve as an equation in and . [equation in x, y]
Answer
. Multiply by : , then substitute and . It is the circle of radius 1 centred at . Answering converts instead.
Problem 46. Give the area enclosed by the cardioid , . [number]
Answer
. . Answering forgets the .
First-order differential equations
Section titled “First-order differential equations”Problem 47. Solve with . [expr in t]
Answer
. Separating, , and fixes . Answering ignores the initial condition.
Problem 48. Solve the logistic equation with . [expr in t]
Answer
. Separate with partial fractions: , so . gives , and solving gives the sigmoid, the same function as in The op library and gradcheck_all (in AI Engineering) and Activation Functions and Their Derivatives. Common mistakes: (solving ) and (a sign slip, which decreases instead of increasing).
Problem 49. Solve with . [expr in t]
Answer
. The integrating factor is : , so and . gives . Answering keeps only the particular solution and misses .
Problem 50. A quantity decays by and halves every 10 time units. Give . [number]
Answer
. , so . Common mistakes: (treating halving as linear decay) and (inverting the relation).
Problem 51. Euler’s method on , , with step : give the approximation of after two steps. [number]
Answer
. Each Euler step on multiplies by : , . The exact value is not the Euler approximation; 2 is one step of size 1.
Problem 52. Gradient flow on is . Starting from , give the time at which . [number]
Answer
. The solution is , and gives . Answering 3 assumes constant speed 1; the speed shrinks as approaches the minimum, which is why gradient descent slows near it.
Most wrong answers in this set come from a handful of recurring slips, and each has a habit that prevents it.
The most frequent is losing the constant from , which leaves a substitution answer off by a factor of 2; writing out in full before substituting avoids it (Problems 4, 6, and 10). A close second is treating an unbounded integrand as a divergent integral, reporting as infinite; take the limit before deciding (Problem 15). Confusing the normalizers of and puts normal densities off by ; keep the exponent’s scale in view: , (Problem 16).
With series, the classic error is concluding convergence from terms that go to 0, which calls the harmonic series convergent; bound the partial sums from below instead (Problems 20 and 30). Testing only the interior of an interval of convergence includes or drops an endpoint wrongly; test each endpoint with its own series test (Problems 28 and 29).
With Taylor polynomials, using the remainder of the wrong degree, or dropping its derivative factor, produces an error bound that is too optimistic; use the degree derivative and keep the bound (Problem 35). Rounding the range-reduction quotient the wrong way gives , and the polynomial loses accuracy; round to the nearest integer (Problem 38). Finally, ignoring the initial condition of an ODE leaves a family of solutions instead of one; apply to fix the constant (Problems 47 and 49).
Where this leads
Section titled “Where this leads”The set looks backward to the Calculus 1 problem set for derivatives, antiderivatives, and the fundamental theorem, and forward to several sections that use its results directly:
- Taylor series, remainder bounds, and range reduction builds Taylor polynomials with range reduction for
expanderf, tested against the Lagrange bound of Problem 35. - Series convergence, the EMA as a geometric series, and bias correction treats the EMA as a truncated geometric series (Problem 21) and derives its bias correction.
- Random variables, expectation, variance, and normal draws by Box-Muller uses the normal density’s constant (Problem 16) behind Box-Muller normals.
- Variance propagation and initialization uses the ReLU second moment of Problem 17 to set Kaiming’s gain .
- The Optimizer protocol: SGD, momentum, Nesterov, weight decay uses Euler’s method and gradient flow (Problems 51 and 52) to explain momentum.
- The Calculus 3 problem set develops the multiple integrals and the change of variables behind Problem 18.
Further reading
Section titled “Further reading”- OpenStax, Calculus Volume 2 (free), chapters 3 to 7.
- Trefethen, Approximation Theory and Approximation Practice, chapters 1 to 3, for why a few Taylor terms after range reduction are enough.
Summary
Section titled “Summary”- Integration by parts is the product rule integrated; substitution is the chain rule integrated (Problems 1 to 12).
- The Gaussian integral gives the normal density its constant, and half the second moment of a standard normal sits on each side of 0, which is the ReLU factor in Kaiming initialization (Problems 16 and 17).
- A series converges when its partial sums do; terms going to 0 is necessary, not sufficient (Problems 20 and 30).
- A Taylor polynomial plus a Lagrange remainder is an approximation with a guarantee; range reduction keeps the remainder small (Problems 35 and 38).
- A first-order ODE describes a rate; the logistic equation’s solution is the sigmoid, and Euler’s method is one step of gradient descent on gradient flow (Problems 48, 51, and 52).