# Multivariable Calculus

Multivariable calculus is the study of problems and solutions of continuous functions of more than a single variable. It extends to Vector Analysis and has applications in a wide variety of fields, most notably physics, but also extends to include statistics and finance, biology, and a many other subjects.

## Partial Derivatives

If f is a function of more than a single variable we can allow one variable to vary and hold the rest stationary. Differentiating with respect to the one free variable we obtain a partial derivative.

### Examples

Given a function
$\,\!f(x,y)=x^{2}y^{2}+4xy+y^{2}$
${\frac {\partial f}{\partial x}}=2xy^{2}+4y$
This is the partial derivative of f with respect to x. In each term we hold any variable other than x constant, and differentiate with respect with x.
$\,\!f(x,y)=x^{2}y^{2}+4xy+y^{2}$ ${\frac {\partial f}{\partial y}}=2x^{2}y+4x+2y$

### Geometry of Partial Derivatives

if f(x,y) is a surface in $E^{3}$, then ${\frac {\partial f}{\partial x}}(a,b)$ is the slope of the tangent line (or rate of change_ of the curve traced by the intersection of the plane y=b, and the surface f, in the direction parallel to the x-axis, at the point (a,b).
the function ${\frac {\partial f}{\partial x}}(x,y)$ represents the rate of change of the family of curves traced by the intersection of the planes generated over the domain of y, and the surface f, at the point x.

### Symmetry

It is important to notice and provided without proof, that mixed partial second derivatives of a function are symmetric, given the function has continuous second partial derivatives on the disk that contains the region the function is differentiated over. For a function of 2 variable this means: $f_{ij}=f_{ji}$
From this further symmetry relations of higher order functions and their derivatives can be derived. For example, f is a function of 3 variables:

### Extrema of Functions

Given a point $(a,b)$ that satisfies
$f_{x}(a,b)=f_{y}(a,b)=0$
$(a,b)$ is called a critical point of $f$. We define the quantity $D(a,b)$ as
$\,\!D(a,b)=f_{xx}(a,b)f_{yy}(a,b)-\left(f_{xy}(a,b)\right)^{2}$
If $D>0$ and $f_{xx}>0$, there is a local minimum at $(a,b)$.
If $D>0$ and $f_{xx}<0$, there is a local maximum at $(a,b)$.
If $D<0$, $(a,b)$ is a saddle point.
If $D=0$, further analysis is needed to determine if $(a,b)$ is a local minimum, a local maximum, or a saddle point.

## Motivating Examples
### Optimization

We study the following function of $x$ and $y$ to determine its critical points and their nature:
$f(x,y)=x^{2}+2xy-y+y^{3}.$
To locate the critical points of $f$, we begin by calculating its first partial derivatives and setting them equal to $0$:
(1) $f_{x}=2x+2y=0,$
(2) $f_{y}=2x-1+3y^{2}=0.$
This is a nonlinear system of equations, but it's fairly easy to solve, as solving for $x$ in (1) and plugging into (2) yields the following quadratic equation in $y$:
(3) $y^{2}-{\frac {2}{3}}y-{\frac {1}{3}}=0.$
The solutions of (3) are $y=1$ and $y=-1/3$, and since we know that $x=-y$ from (1), the two critical points of the function turn out to be $(-1,1)$ and $(1/3,-1/3)$. It is now time to determine the nature of these two critical points. We begin by calculating $D(x,y)$:
$f_{xx}=2,$
$f_{yy}=6y,$
$f_{xy}=2,$
$D(x,y)=f_{xx}f_{yy}-\left(f_{xy}\right)^{2}=2\times 6y-2^{2}=12y-4.$
For our first critical point $(-1,1)$, we have:
$f_{xx}(-1,1)=2>0,$
$D(-1,1)=12\cdot 1-4=8>0,$
and thus we conclude that there is a local minimum at $(-1,1)$.
For the point $(1/3,-1/3)$,
$f_{xx}(1/3,-1/3)=2>0,$
$D(1/3,-1/3)=12\cdot (-1/3)-4=-8<0,$
and since now $D(1/3,-1/3)<0$, we conclude that $(1/3,-1/3)$ is a saddle point of $f$.
We now analyze an economics example that uses the method of Lagrange multipliers to optimize a given cost function subject to a production constraint.
In particular, let $C(K,L)=rK+wL$ be our cost function subject to the production constraint $K^{1/2}L^{1/2}=Q$, where $Q$ is the number of units being manufactured, and we wish to know what values of $K$ (amount of physical capital) and $L$ (quantity of labor used) minimize the cost.
We set up the Lagrange function $f$ with Lagrange multiplier $\lambda$ as follows:
$f(K,L,\lambda )=rK+wL-\lambda (K^{1/2}L^{1/2}-Q),$
and now we set the gradient of $f$ equal to zero to find its critical points.
$f_{K}=r-{\frac {1}{2}}\lambda K^{-1/2}L^{1/2}=0,$
$f_{L}=w-{\frac {1}{2}}\lambda K^{1/2}L^{-1/2}=0,$
$f_{\lambda }=Q-K^{1/2}L^{1/2}=0.$
From the third equation, we get the two (equivalent) equations
$K^{1/2}=QL^{-1/2}\Rightarrow K^{-1/2}={\frac {L^{1/2}}{Q}}$
and now we plug these two equations into our first two equations for $f_{K}=0$ and $f_{L}=0$ to yield two equations with two unknowns, $L$ and $\lambda$. Upon solving them (it is not hard), we obtain
$L={\frac {r^{1/2}Q}{w^{1/2}}}$
and
$K={\frac {w^{1/2}Q}{r^{1/2}}}.$
The minimum cost is thus
$C\left({\frac {w^{1/2}Q}{r^{1/2}}},{\frac {r^{1/2}Q}{w^{1/2}}}\right)=r{\frac {w^{1/2}Q}{r^{1/2}}}+w{\frac {r^{1/2}Q}{w^{1/2}}}=(rw)^{1/2}Q+(rw)^{1/2}Q=2Q(rw)^{1/2}.$