Skip to content

9 min read

Calculus speedrun

Cram notes for single-variable calculus: differentiability, equivalent infinitesimals, Taylor remainders, integration technique, the Wallis integrals and product, ordinary differential equations, and curvature.

Exam-cram notes from February 2023, rebuilt and carefully checked afterwards.

Derivatives

Differentiability and the differential

A function ff is differentiable at x0x_0 when some constant kk satisfies

limΔx0f(x0+Δx)f(x0)kΔxΔx=0.\lim_{\Delta x\to 0}\frac{f(x_0+\Delta x)-f(x_0)-k\,\Delta x}{\Delta x}=0.

That kk is the derivative f(x0)f'(x_0). The definition says ff can be approximated near x0x_0 by an affine function whose error shrinks faster than Δx\Delta x does.

The derivative and the differential are different objects. The differential is the linear part, df=f(x0)dx\mathrm{d}f=f'(x_0)\,\mathrm{d}x, a function of dx\mathrm{d}x. In one variable the distinction buys little and the two get used interchangeably. In several variables it stops being optional.

Continuity and differentiability

Differentiable implies continuous, and the converse fails.

Take f(x)=xf(x)=|x| at x=0x=0. It is continuous there and not differentiable there: the left derivative is 1-1, the right derivative is +1+1, and a derivative exists exactly when the one-sided derivatives exist and agree.

The Weierstrass function is continuous on all of R\mathbb{R} and differentiable nowhere, so continuity constrains differentiability hardly at all.

The mean value theorem

If ff is continuous on [a,b][a,b] and differentiable on (a,b)(a,b), some c(a,b)c\in(a,b) has

f(c)=f(b)f(a)ba.f'(c)=\frac{f(b)-f(a)}{b-a}.

The average rate of change across the interval is attained as an instantaneous rate somewhere inside it. Rolle’s theorem is the case f(a)=f(b)f(a)=f(b), and each implies the other in a line.

Limits

Equivalent infinitesimals

Two infinitesimals α(x)\alpha(x) and β(x)\beta(x) as xx0x\to x_0 are equivalent, written αβ\alpha\sim\beta, when their ratio tends to one:

limxx0α(x)β(x)=1.\lim_{x\to x_0}\frac{\alpha(x)}{\beta(x)}=1.

Substituting equivalents is legitimate for factors of a product or quotient. Across a sum the leading terms can cancel, leaving the answer in the part that was discarded. With tanxx\tan x\sim x and sinxx\sin x\sim x as x0x\to 0, replacing both in

limx0tanxsinxx3\lim_{x\to 0}\frac{\tan x-\sin x}{x^3}

gives 00, while the limit is 12\tfrac12. Subtraction annihilates the linear terms and what survives is cubic.

L’Hôpital’s rule

The rule applies to 00\frac{0}{0} and \frac{\infty}{\infty}, given ff and gg differentiable near the point with g0g'\neq 0 there. Every other indeterminate form has to be pushed algebraically into one of those two shapes first.

It concludes only when limf/g\lim f'/g' exists or is infinite. Where that limit does not exist, the rule yields no information about f/gf/g, which may still be perfectly well behaved:

limxx+sinxx=1,\lim_{x\to\infty}\frac{x+\sin x}{x}=1,

whose ratio of derivatives is 1+cosx1+\cos x, oscillating in [0,2][0,2] forever.

Each application costs a differentiation, and on sinxx\frac{\sin x}{x} the rule argues in a circle, since the derivative of sin\sin is the thing being established.

Taylor expansion

For ff with enough derivatives at aa,

f(x)=k=0nf(k)(a)k!(xa)k+Rn(x).f(x)=\sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k+R_n(x).

Maclaurin’s expansion is this with a=0a=0.

The two standard remainders answer different questions. The Peano remainder is qualitative,

Rn(x)=o((xa)n)(xa),R_n(x)=o\big((x-a)^n\big)\quad (x\to a),

and needs only that ff be nn times differentiable at aa. It says the error is of smaller order than the last term kept, which is enough to compute a limit and gives no numerical bound anywhere.

The Lagrange remainder is quantitative,

Rn(x)=f(n+1)(ξ)(n+1)!(xa)n+1R_n(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}(x-a)^{n+1}

for some ξ\xi between aa and xx, and needs n+1n+1 derivatives across the interval. Both the derivative order and the power are n+1n+1.

Integration

The techniques

  1. Basic formulas. cosxdx=sinx+C\int\cos x\,\mathrm{d}x=\sin x+C, dxx=lnx+C\int\frac{\mathrm{d}x}{x}=\ln|x|+C, dxx2+a2=1aarctanxa+C\int\frac{\mathrm{d}x}{x^2+a^2}=\frac1a\arctan\frac{x}{a}+C, dxx2+a2=lnx+x2+a2+C\int\frac{\mathrm{d}x}{\sqrt{x^2+a^2}}=\ln\left|x+\sqrt{x^2+a^2}\right|+C.
  2. Substitution, running in either direction. You recognize du\mathrm{d}u inside the integrand and collapse it, or you introduce a new variable to clear a radical. Trigonometric substitution is the second direction: a2x2\sqrt{a^2-x^2} wants x=asintx=a\sin t, a2+x2\sqrt{a^2+x^2} wants x=atantx=a\tan t, and x2a2\sqrt{x^2-a^2} wants x=asectx=a\sec t.
  3. Integration by parts, udv=uvvdu\int u\,\mathrm{d}v=uv-\int v\,\mathrm{d}u. So xexdx=xexex+C\int xe^x\mathrm{d}x=xe^x-e^x+C and xcosxdx=xsinx+cosx+C\int x\cos x\,\mathrm{d}x=x\sin x+\cos x+C.
  4. Partial fractions for rational integrands. For x+2x2+x6\frac{x+2}{x^2+x-6} the denominator factors as (x+3)(x2)(x+3)(x-2), and solving for the coefficients gives 15(x+3)+45(x2)\frac{1}{5(x+3)}+\frac{4}{5(x-2)}.
  5. Trigonometric identities, to drop a power before integrating: sin2xdx=1cos2x2dx\int\sin^2 x\,\mathrm{d}x=\int\frac{1-\cos 2x}{2}\mathrm{d}x.
  6. Reduction formulas, derived by parts. On [0,π2][0,\frac{\pi}{2}], 0π/2cosnxdx=n1n0π/2cosn2xdx\int_0^{\pi/2}\cos^n x\,\mathrm{d}x =\frac{n-1}{n}\int_0^{\pi/2}\cos^{n-2}x\,\mathrm{d}x.
  7. Symmetry: an odd integrand over [a,a][-a,a] integrates to zero, an even one to twice the half-interval.

Worked examples

The denominator of sinxsinx+cosxdx\int\frac{\sin x}{\sin x+\cos x}\,\mathrm{d}x has derivative cosxsinx\cos x-\sin x, which surfaces once the integral is paired with its companion. Let

I=sinxsinx+cosxdx,J=cosxsinx+cosxdx.I=\int\frac{\sin x}{\sin x+\cos x}\mathrm{d}x,\qquad J=\int\frac{\cos x}{\sin x+\cos x}\mathrm{d}x.

Then I+J=dx=xI+J=\int\mathrm{d}x=x, while JIJ-I has numerator cosxsinx\cos x-\sin x, exactly the derivative of the denominator, so JI=lnsinx+cosxJ-I=\ln|\sin x+\cos x|. Subtracting,

I=x212lnsinx+cosx+C.I=\frac{x}{2}-\frac{1}{2}\ln|\sin x+\cos x|+C.

For x3(x2+1)2dx\int\frac{x^3}{(x^2+1)^2}\mathrm{d}x, put u=x2+1u=x^2+1, so xdx=12dux\,\mathrm{d}x=\tfrac12\mathrm{d}u and x2=u1x^2=u-1. The integral becomes 12u1u2du=12(1u1u2)du\frac12\int\frac{u-1}{u^2}\mathrm{d}u =\frac12\int\left(\frac1u-\frac1{u^2}\right)\mathrm{d}u, giving

12ln(x2+1)+12(x2+1)+C.\frac{1}{2}\ln(x^2+1)+\frac{1}{2(x^2+1)}+C.

For dx4x2\int\frac{\mathrm{d}x}{\sqrt{4-x^2}}, put x=2sintx=2\sin t with t[π2,π2]t\in[-\frac{\pi}{2},\frac{\pi}{2}], so dx=2costdt\mathrm{d}x=2\cos t\,\mathrm{d}t and 4x2=2cost\sqrt{4-x^2}=2\cos t, leaving dt=arcsinx2+C\int\mathrm{d}t=\arcsin\frac{x}{2}+C.

For x21dx\int\sqrt{x^2-1}\,\mathrm{d}x, put x=sectx=\sec t, so the differential is secttantdt\sec t\tan t\,\mathrm{d}t and the radical is tant|\tan t|, making the integrand secttan2t=sec3tsect\sec t\tan^2 t=\sec^3 t-\sec t. Integrating sec3t\sec^3 t by parts and substituting back,

x21dx=xx21212lnx+x21+C.\int\sqrt{x^2-1}\,\mathrm{d}x=\frac{x\sqrt{x^2-1}}{2}-\frac{1}{2}\ln\left|x+\sqrt{x^2-1}\right|+C.

Wallis integrals

The Wallis integrals are

Wn=0π/2sinnxdx=0π/2cosnxdx,W_n=\int_0^{\pi/2}\sin^n x\,\mathrm{d}x=\int_0^{\pi/2}\cos^n x\,\mathrm{d}x,

the two forms agreeing under xπ2xx\mapsto\frac{\pi}{2}-x. Integration by parts gives Wn=n1nWn2W_n=\frac{n-1}{n}W_{n-2} for n2n\geq 2, with W0=π2W_0=\frac{\pi}{2} and W1=1W_1=1, so

W2=π4,W3=23,W4=3π16.W_2=\frac{\pi}{4},\qquad W_3=\frac{2}{3},\qquad W_4=\frac{3\pi}{16}.

The sequence satisfies nWnWn1=π2nW_nW_{n-1}=\frac{\pi}{2} for every nn, and decays as Wnπ2nW_n\sim\sqrt{\frac{\pi}{2n}}. Even terms carry a π\pi and odd terms are rational, which is the asymmetry the product below is built out of.

Wallis’s product

π2=n=12n2n(2n1)(2n+1)=212343456567\frac{\pi}{2}=\prod_{n=1}^{\infty}\frac{2n\cdot 2n}{(2n-1)(2n+1)}=\frac{2}{1}\cdot\frac{2}{3}\cdot\frac{4}{3}\cdot\frac{4}{5}\cdot\frac{6}{5}\cdot\frac{6}{7}\cdots

John Wallis found this in 1655 and published it in Arithmetica Infinitorum the following year, the second infinite product for π\pi after Viète’s of 1593.

The proof runs entirely through the integrals above. The sequence WnW_n is positive and strictly decreasing, so W2n+1W2nW2n1W_{2n+1}\leq W_{2n}\leq W_{2n-1}; dividing through by W2n+1W_{2n+1} and applying the recurrence squeezes W2n/W2n+1W_{2n}/W_{2n+1} to 11, and writing that ratio out in closed form is the product.

Convergence is slow enough to rule the product out as a way of computing π\pi. A thousand factors give 3.140813.14081 against π=3.14159\pi=3.14159, with the error falling like 1/n1/n.

A related identity,

sinxx=cosx2cosx4cosx8,\frac{\sin x}{x}=\cos\frac{x}{2}\cos\frac{x}{4}\cos\frac{x}{8}\cdots,

yields Viète’s product: at x=π2x=\frac{\pi}{2} the left side is 2π\frac{2}{\pi}.

Improper integrals

Two kinds, split by where the infinity sits.

The first kind has an unbounded interval. Define af=limbabf\int_a^{\infty}f=\lim_{b\to\infty}\int_a^b f and call it convergent when that limit is finite.

The second kind has an unbounded integrand at a finite point. Approach the bad point with a parameter and take the limit the same way. Where ff stays bounded and the discontinuity is removable, the integral is proper and needs no limit.

Either kind is tested by comparison against a known integrand, by limit comparison on the ratio, or by absolute convergence, which implies convergence. The benchmarks are the pp-integrals, and they point in opposite directions: 1dxxp\int_1^{\infty}\frac{\mathrm{d}x}{x^p} converges exactly when p>1p>1, while 01dxxp\int_0^{1}\frac{\mathrm{d}x}{x^p} converges exactly when p<1p<1.

Differential equations

Separable equations

For y=f(x)g(y)y'=f(x)g(y),

dyg(y)=f(x)dx+C.\int\frac{\mathrm{d}y}{g(y)}=\int f(x)\,\mathrm{d}x+C.

Dividing by g(y)g(y) assumes it is nonzero. Each root of gg gives a constant solution, and those are read off separately.

Homogeneous equations

For y=f ⁣(yx)y'=f\!\left(\frac{y}{x}\right), substitute y=vxy=vx, so y=v+xvy'=v+xv' and

xdvdx=f(v)v,x\frac{\mathrm{d}v}{\mathrm{d}x}=f(v)-v,

which separates, the substitution having promoted a ratio to a variable.

First-order linear equations

For y+p(x)y=q(x)y'+p(x)y=q(x), the integrating factor is μ(x)=ep(x)dx\mu(x)=e^{\int p(x)\mathrm{d}x}. It comes from asking for a μ\mu that makes the left side a single derivative. Expanding,

(μy)=μy+μy,(\mu y)'=\mu y'+\mu' y,

which should equal μy+μpy\mu y'+\mu p y. Matching forces μ=μp\mu'=\mu p, itself separable, and μ=ep\mu=e^{\int p} follows.

Then (μy)=μq(\mu y)'=\mu q, so

y=1μ(x)(μ(x)q(x)dx+C)=ep(qepdx+C),y=\frac{1}{\mu(x)}\left(\int\mu(x)q(x)\,\mathrm{d}x+C\right)=e^{-\int p}\left(\int qe^{\int p}\mathrm{d}x+C\right),

with the outer epe^{-\int p} multiplying both terms inside. For constant p0p\neq 0 and constant qq this collapses to y=Aepx+qpy=Ae^{-px}+\frac{q}{p}.

Constant coefficients

For y+ay+by=0y''+ay'+by=0 with a,ba,b constant, substituting y=erxy=e^{rx} gives the characteristic equation r2+ar+b=0r^2+ar+b=0. Three cases:

  1. Distinct real roots r1r2r_1\neq r_2: y=c1er1x+c2er2xy=c_1e^{r_1x}+c_2e^{r_2x}.
  2. A repeated root rr: y=(c1+c2x)erxy=(c_1+c_2x)e^{rx}. The factor of xx supplies the second solution that a second-order equation needs.
  3. Complex roots α±βi\alpha\pm\beta i: y=eαx(c1cosβx+c2sinβx)y=e^{\alpha x}(c_1\cos\beta x+c_2\sin\beta x).

The characteristic equation exists because the coefficients are constants. An equation with variable coefficients admits no such polynomial in rr, since rr would have to depend on xx and erxe^{rx} would lose the derivatives the substitution assumed. Variable-coefficient second-order equations are genuinely harder and have no comparable general method.

Undetermined coefficients

For y+ay+by=f(x)y''+ay'+by=f(x) the general solution is y=yh+ypy=y_h+y_p, the homogeneous general solution plus any one particular solution.

Where ff has the form eαx(P(x)cosβx+Q(x)sinβx)e^{\alpha x}(P(x)\cos\beta x+Q(x)\sin\beta x) with P,QP,Q polynomial, guess a ypy_p of that same shape with undetermined coefficients, substitute, and match. A polynomial ff of degree mm calls for a general polynomial of degree mm, lower-order terms included.

Resonance decides whether the guess can work at all. A trial form that already solves the homogeneous equation cannot also produce a nonzero right-hand side, and substituting it returns 0=f(x)0=f(x). Multiply the trial form by xsx^s, where ss is the multiplicity of α+βi\alpha+\beta i as a root of the characteristic equation.

Variation of parameters

Let the constants in the homogeneous solution vary. For y+p(x)y=q(x)y'+p(x)y=q(x), write yp=u(x)epy_p=u(x)e^{-\int p}; substituting collapses the pp terms and leaves u=qepu'=qe^{\int p}, so yp=epqepdxy_p=e^{-\int p}\int qe^{\int p}\mathrm{d}x, agreeing with the integrating factor.

For y+ay+by=f(x)y''+ay'+by=f(x) with homogeneous solutions y1,y2y_1,y_2, the same move writes yp=u1y1+u2y2y_p=u_1y_1+u_2y_2, imposes u1y1+u2y2=0u_1'y_1+u_2'y_2=0, and solves the resulting pair for u1u_1' and u2u_2':

yp=y1y2fWdx+y2y1fWdx,W=y1y2y1y2.y_p=-y_1\int\frac{y_2f}{W}\,\mathrm{d}x+y_2\int\frac{y_1f}{W}\,\mathrm{d}x,\qquad W=y_1y_2'-y_1'y_2.

Variation of parameters asks only that ff be continuous, so it handles right-hand sides like tanx\tan x or 1x\frac1x that no trial form covers. Undetermined coefficients stays confined to exponentials, polynomials, sines and cosines.

Linear systems

A first-order system

dxdt=Ax+f(t)\frac{\mathrm{d}\mathbf{x}}{\mathrm{d}t}=A\mathbf{x}+\mathbf{f}(t)

with AA a constant matrix has homogeneous solution xh(t)=eAtc\mathbf{x}_h(t)=e^{At}\mathbf{c}, and variation of parameters gives

x(t)=eAt(c+0teAsf(s)ds).\mathbf{x}(t)=e^{At}\left(\mathbf{c}+\int_0^t e^{-As}\mathbf{f}(s)\,\mathrm{d}s\right).

Diagonalizing AA turns eAte^{At} into an exponential of each eigenvalue on its own and uncouples the system into independent scalar equations. A defective AA needs the Jordan form and produces polynomial factors in tt, the same phenomenon as the repeated root above.

Curvature

For a curve r(t)\mathbf{r}(t),

κ=r(t)×r(t)r(t)3.\kappa=\frac{|\mathbf{r}'(t)\times\mathbf{r}''(t)|}{|\mathbf{r}'(t)|^3}.

Parametrized by arc length instead, κ=dTds\kappa=\left|\frac{\mathrm{d}\mathbf{T}}{\mathrm{d}s}\right| with T\mathbf{T} the unit tangent, and no denominator is needed, since drds=1\left|\frac{\mathrm{d}\mathbf{r}}{\mathrm{d}s}\right|=1 is what arc-length parametrization means.

For an explicit curve y=f(x)y=f(x) at the point (x0,f(x0))(x_0,f(x_0)),

κ=f(x0)(1+f(x0)2)3/2.\kappa=\frac{|f''(x_0)|}{\left(1+f'(x_0)^2\right)^{3/2}}.

At a critical point, where f(x0)=0f'(x_0)=0, the denominator is 11 and κ=f(x0)\kappa=|f''(x_0)|. Large f|f'| drives κ\kappa down, and for twice-differentiable ff the curvature is finite everywhere.

A straight line has κ=0\kappa=0; a circle of radius rr has κ=1r\kappa=\frac1r at every point. The units follow: curvature is an inverse length, and 1κ\frac1\kappa is the radius of the circle that best fits the curve there.