why-calculus-works
  • Introduction
  • Real Analysis
    • The World of Real Numbers
    • Limits and Derivatives
    • Integration
  • Measure Theory
  • Complex Analysis
  • Goodies
    • Calculus Computations
Powered by GitBook
On this page
  • Calculus Computations
  • Derivatives
  • Differentiability in R^n
  • Convexity
  • Convex Optimization and Lagrange Multipliers
  • Line (path) Integrals
  • Green's Theorem
  • Divergence
  • Curl
  • Resources
  1. Goodies

Calculus Computations

Calculus Computations

Derivatives

d ln(x)dx=1x\frac{d\ ln(x)}{d x} = \frac{1}{ x}dxd ln(x)​=x1​

why? We know eln⁡(x)e^{\ln(x)}eln(x) = x, so d eln(x)dx=d xdx=1\frac{d\ e^{ln(x)}}{dx} = \frac{d\ x}{dx} = 1dxd eln(x)​=dxd x​=1.

This with the chain rule gives us

deln⁡(x)dx=eln⁡(x)d ln⁡(x)dx=1\frac{d e^{\ln(x)}}{dx} = e^{\ln(x)} \frac{d\ \ln(x)}{dx} = 1dxdeln(x)​=eln(x)dxd ln(x)​=1 , implying d ln⁡(x)dx=1/x\frac{d\ \ln(x)}{dx} = 1/xdxd ln(x)​=1/x

Differentiability in R^n

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

lim⁡x→x0∣∣F(x)−F(x0)−A(x−x0)∣∣∣∣x−x0∣∣=0\lim_{x \rightarrow x_0} \frac{|| F(x) - F(x_0) - A(x - x_0) || }{||x - x_0||} = 0limx→x0​​∣∣x−x0​∣∣∣∣F(x)−F(x0​)−A(x−x0​)∣∣​=0

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

 For all a,b∈S,λa+(1−λ)b∈S\text{ For all } a, b \in S, \lambda a + (1 - \lambda) b \in S For all a,b∈S,λa+(1−λ)b∈S

where 0≤λ≤10 \leq \lambda \leq 10≤λ≤1

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

Functions

A function is convex if the line connecting any two points is above the function. This can be defined formally using a parameter λ\lambdaλsimilar to the definition for sets.

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

f(x1,x2)=x12−2x2, subject to x12+x22=1.f(x_1, x_2) = x_1^2 - 2x_2, \text{ subject to } x_1^2 + x_2^2 = 1.f(x1​,x2​)=x12​−2x2​, subject to x12​+x22​=1.

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:

∇f(x⃗)=λ∇g(x⃗) and g(x⃗)=k\nabla f(\vec{x}) = \lambda \nabla g(\vec{x}) \text{ and } g(\vec{x}) = k∇f(x)=λ∇g(x) and g(x)=k

where g defines the constraint and λ\lambdaλ is a constant used to solve the equations. The solutions to this system provide the set of possible critical points at which a minimum or maximum can occur.

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:

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:

∫cf(x,y,z)ds=∫ab\int_c f(x, y, z) ds = \int_a^b∫c​f(x,y,z)ds=∫ab​ f(c(t)) • c'(t) dt

or alternatively

∫cf(x,y)ds=∫abf(x(t),y(t))∣∣c′(t)∣∣dt\int_c f(x, y) ds = \int_a^b f(x(t), y(t)) || c'(t) || dt∫c​f(x,y)ds=∫ab​f(x(t),y(t))∣∣c′(t)∣∣dt
=∫abf(x(t),y(t))(dxdt)2+(dydt)2dt= \int_a^b f(x(t), y(t)) \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2} dt=∫ab​f(x(t),y(t))(dtdx​)2+(dtdy​)2​dt

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,

∫cPdx+∫cQdy=∫∫DdQ/dx−dP/dydA\int_c P dx + \int_c Q dy = \int \int_D d Q / dx - dP / dy dA∫c​Pdx+∫c​Qdy=∫∫D​dQ/dx−dP/dydA

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,

div(F) = ∇⋅F=dP/dx+dQ/dy\nabla \cdot F = dP/dx + dQ/dy∇⋅F=dP/dx+dQ/dy

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

div(F)=∇×Fdiv(F) = \nabla \times Fdiv(F)=∇×F$$ $$

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

PreviousGoodies

Last updated 6 years ago

(picture from )

In words it's the change in output * change in input (along the line):

a list of important counter-examples. such as a function that's continuous at only a single point:

Quora
http://www.math.tamu.edu/~tom.vogel/gallery/gallery.html