Calculus Computations

Calculus Computations

Derivatives

This with the chain rule gives us

Differentiability in R^n

F from R^m to R^n is differentiable at x_0 if there exists a matrix A such that

It turns out if A exists, it must be the Jacobian (first order partial derivatives)!

Convexity

Sets

A set is convex if the line between any two points is in the set. Formally, this means

Circles, triangles are all convex sets. Pacman isn't, because you can draw with a part outside the set.

Functions

Who cares? Convex function have a single global minimum, so algorithms such as gradient descent work well, because they don't get stuck in global optima.

We can test for convexity using the second derivative test as well! If f'' > 0, then f is convex.

Convex Optimization and Lagrange Multipliers

Lagrange multipliers is a technique for finding the minimum or maximum of a function subject to a an equality constraint.

For example, finding the minimum of

More generally, we want to find the min or max of f subject to g = constant.

The method of Lagrange Multipliers states that we can solve this optimization problem by solving:

Why does this work? We know gradients point in the steepest direction. We need both the function and the constraint to point in the same steepest direction. This is because if f is at a min or max at a point say c, then the gradient of f at c must be parallel to the gradient of g at c.

Here's a picture to illustrate. Imagine this is the curve at the intersection of f and g:

(picture from Quora)

Therefore, the gradients must point in the same direction.

Line (path) Integrals

A line integral means the same thing as a path, contour (typically line integral in the complex plane), or curve integrals.

Curves: can be described parametrically, as c(t) = (x(t), y(t), z(t)) for a parameter t.

a circle is described as x^2 + y^2 = r^2, can also be parametrized as x = rcos(t), y = r sin(t)

The path integral of a function f along the curve is defined as:

or alternatively

Green's Theorem

In the context of F a vector field, meaning a function that maps a point to a vector, such as F(x, y) = ( P(x, y), Q(x, y) ),

for c a closed curve and D the region inside,

In essence, Green's theorem relates line integrals to the double integral over a region.

Divergence

Also in the context of a vector field F,

This generalizes to arbitrary dimensions. The divergence theorem relates integrals along the boundary of a region to the triple integral of div(F) over the region.

Curl

Only for vector fields in R^3. It's the cross product of

Since cross product is only defined in R^3, curl is also restricted to R^3. Stoke's theorem relates curl to the integral of F along a closed curve.

Resources

Last updated