Calculus#
A quick reference for single-variable and multivariable calculus.
About this chapter
A quick reference. The Taylor expansion comes first because so much else rests on it: the series for \(e^x\), \(\sin x\) and \(\cos x\) further down are Taylor series around 0, and Newton’s method in the optimization chapter comes from the 2nd-order term.
The single-variable section lists derivatives, integrals and rules (L’Hospital, integration by parts). The multivariable section ends with Lagrange multipliers, which turn “minimize \(f\) subject to \(g = c\)” into solving \(\nabla L = 0\).
Taylor expansion#
Near \(x_0\) a smooth function looks like a polynomial in \((x - x_0)\), with coefficients set by its derivatives at \(x_0\). Each extra term matches one more derivative, so the fit improves near \(x_0\) first.
taylor expansion: \(f(x) \approx \cblue{f(x_0)} + \corange{\frac{f'(x_0)}{1!}(x-x_0)} + \cgreen{\frac{f''(x_0)}{2!}(x-x_0)^2} + ...\)
0th-order + 1st-order + 2nd-order terms
Single-variable calculus#
Reference tables: derivatives and integrals of the trig, exponential and log functions, L’Hospital’s rule for indeterminate forms, integration by parts, and the series for \(e^x\), \(\sin x\) and \(\cos x\) that come from Taylor expansions around 0.
Derivatives:
\(\frac{d}{dx}x^n = nx^{n-1}\)
\(\frac{d}{dx}a^x = a^{x}\ln(a)\)
\(\frac{d}{dx}\ln(x) = 1/x\)
\(\frac{d}{dx}\tan(x)= sec^2(x)\)
\(\frac{d}{dx}cot(x)= -csc^2(x)\)
\(\frac{d}{dx}sec(x)= sec(x)\tan(x)\)
\(\frac{d}{dx}csc(x)= -csc(x)cot(x)\)
\(\int \tan = \ln\vert sec\vert\)
\(\int cot = \ln\vert \sin\vert\)
\(\int sec = \ln\vert sec+\tan\vert\)
\(\int csc = \ln\vert csc-cot\vert\)
\(\int \frac{du}{\sqrt{a^2-u^2}} = \sin^{-1}(\frac{u}{a})\)
\(\int \frac{du}{u\sqrt{u^2-a^2}} = \frac{1}{a}sec^{-1}(\frac{u}{a})\)
\(\int \frac{du}{a^2+u^2} = \frac{1}{a} \tan^{-1}(\frac{u}{a})\)
Continuous: left limit = right limit = value
Differentiable: continuous and no sharp points / asymptotes
L’Hospital’s - for indeterminate forms: \((\frac{f(x)}{g(x)})' = \frac{f'(x)}{g'(x)}\)
Integration by parts: \(\int{udv}=uv-\int{duv}\), LIATE
Expansions:
\(e^x = \sum{\frac{x^n}{n!}}\)
\(\sin(x) = \sum_0^\infty{\frac{(-1)^n x^{2n+1}}{(2n+1)!}}\)
\(\cos(x) = \sum_0^\infty{\frac{(-1)^n x^{2n}}{(2n)!}}\)
Geometric Sum: \(a_{1st}\frac{1-r^{n+1}}{1-r}\)
Multivariable calculus#
To minimize \(f\) on the curve \(g = c\), look for points where the two gradients are parallel. The Lagrangian packs that condition and the constraint into one equation, \(\nabla L = 0\).
Polar: r,\(\theta\),z
Spherical: \(\rho,\theta,\phi\)
Clairut’s Thm: Conservative function \(f_{xy}=f_{yx}\)
Lagrangian - solves minimize f subject to g = c
solution will always be tangent to f
\(\cblue{\nabla f} = \corange{\lambda \nabla g}\) - gives us n constraints
remember g = c is a constraint too
to do this efficiently, define the Lagrangian \(L(x, \lambda) = \cblue{f} - \corange{\lambda \cdot g}\)
taking deriv wrt \(\lambda\) and setting = 0 enforces g = c
taking deriv wrt other variables and setting = 0 enforces other conditions
therefore final eq just becomes \(\nabla L = 0\)
Key ideas
A Taylor expansion approximates \(f\) near \(x_0\) by a polynomial whose coefficients are the derivatives at \(x_0\) divided by factorials.
The series for \(e^x\), \(\sin x\) and \(\cos x\) are Taylor expansions around 0.
L’Hospital’s rule handles an indeterminate ratio by comparing derivatives, \(f'(x)/g'(x)\).
Integration by parts, \(\int u\,dv = uv - \int v\,du\), trades one integral for an easier one.
At a minimum of \(f\) subject to \(g = c\) the gradients are parallel, \(\nabla f = \lambda \nabla g\), and the Lagrangian \(L = f - \lambda g\) packs this and the constraint into \(\nabla L = 0\).