- In a **scalar field**, each point in space is assigned a number. For example, topography or altitude maps are scalar fields.
- A **level curve** is a slice of a three-dimensional graph by setting to a general variable $f(x, y)=k$. It is effectively a series of contour plots set in a three-dimensional plane.
- A **contour plot** is a graph obtained by substituting a constant for $k$ in a level curve.
In practice, this means that if any two paths result in different limits, the limit is undefined. Substituting $x|y=0$ or $y=mx$ or $x=my$ are common solutions.
!!! example
For the function $\lim_{(x, y)\to (0,0)}\frac{x^2}{x^2+y^2}$:
The order of the variables matter: $f_{xy}$ is the derivative of f wrt. x *and then* wrt. y.
**Clairaut's theorem** states that if $f_x, f_y$, and $f_{xy}$ all exist near $(a, b)$ and $f_{yx}$ is continuous **at** $(a,b)$, $f_{yx}(a,b)=f_{x,y}(a,b)$ and exists.
!!! warning
In multivariable calculus, **differentiability does not imply continuity**.
Therefore, the general expression of a plane is equivalent to:
$$
z=C+A(x-a)+B(x-b) \\
\boxed{z=f(a,b)+f_x(a,b)(x-a)+f_y(a,b)(y-b)}
$$
??? tip "Proof"
The general formula for a plane is $c_1(x-a)+c_2(y-b)+c_3(z-c)=0$.
If $y$ is constant such that $y=b$:
$$z=C+A(x-a)$$
which must represent in the x-direction as an equation in the form $y=b+mx$. It follows that $A=f_x(a,b)$. A similar concept exists for $f_y(a,b)$.
If both $x=a$ and $y=b$ are constant:
$$z=C$$
where $C$ must be the $z$-point.
Usually, functions can be approximated via the **tangent at $x=a$.**
$$f(x)\simeq L(x)$$
!!! warning
Approximations are less accurate the stronger the curve and the farther the point is away from $f(a,b)$. A greater $|f''(a)|$ indicates a stronger curve.
!!! example
Given the function $f(x,y)=\ln(\sqrt[3]{x}+\sqrt[4]{y}-1)$, $f(1.03, 0.98)$ can be linearly approximated.
Linear approximations can be used with the help of differentials. Please see [MATH 117#Differentials](/1a/math117/#differentials) for more information.
$\Delta f$ can be assumed to be equivalent to $df$.
$$\Delta f=f_x(a,b)\Delta x+f_y(a,b)\Delta y$$
Alternatively, it can be expanded in Leibniz notation in the form of a **total differential**:
If the function only depends on one variable, $\frac{d}{dx}$ is used. Multivariable functions must use $\frac{\partial}{\partial x}$ to treat the other variables as constant.
This allows for the the following replacements to appear more like single-variable calculus. Where $\vec r=(x,y)$ is a desired point, $\vec a=(a,b)$ is the initial point, and all vector multiplications are dot products:
A **directional derivative** is any of the infinite derivatives at a certain point with the length of a unit vector. Specifically, in the unit vector direction $\vec u$ at point $\vec a=(a,b)$:
**Local maxima / minima** exist at points where all points in a disk-like area around it do not pass that point. Practically, they must have $\nabla f=0$.
**Critical points** are any point at which $\nabla f=0|undef$. A critical point that is not a local extrema is a **saddle point**.
Local maxima tend to be **concave down** while local minima are **concave up**. This can be determined via the second derivative test. For the critical point $P_0$ of $f(x,y)$:
1. Calculate $D(x,y)= f_{xx}f_{yy}-(f_{xy})^2$
2. If it greater than zero, the point is an extremum
a. If $f_{xx}(P_0)<0$,thepointisamaximum—otherwiseitisaminimum
3. If it is less than zero, it is a saddle point — otherwise the test is inconclusive and you must use your eyeballs
If there is a limitation in optimising for $f(x,y)$ in the form $g(x,y)=K$, new critical points can be found by setting them equal to each other, where $\lambda$ is the **Lagrange multiplier** that determines the rate of increase of $f$ with respect to $g$:
The largest/smallest values of $f(x,y)$ from the critical points return the maxima/minima. If possible, $\nabla g=\vec 0, g(x,y)=K$ should also be tested **afterward**.
This applies equally to higher dimensions and constraints by adding a new term for each constraint. Given $f(x,y,z)$ with constraints $g(x,y,z)=K$ and $h(x,y,z)=M$:
$$\nabla f=\lambda_1\nabla g + \lambda_2\nabla h$$
### Absolute extrema
- If end points exist, those should be added
- If no endpoints exist and the limits go to $\pm\infty$, there are no absolute extrema
Where $r$ is the direct distance from the point to the origin, $\phi$ is the angle to the x-axis in the xy-plane ($[0,2\pi]$), and $\theta$ is the angle to the z-axis, top to bottom ($[0,\pi]$):
$$
z=r\cos\theta \\
x=r\sin\theta\cos\phi \\
y=r\sin\theta\sin\phi
$$
The Jacobian is $r^2\sin\theta$.
!!! example
The mass inside the sphere $x^2+y^2+z^2=9$ with density $z=\sqrt{\frac{x^2+y^2}{3}}$:
It is clear that $\tan\theta=\sqrt 3\implies\theta=\frac\pi 3,r=3$. Thus:
**Maclaurin's theorem** states that if some function $P^{(k)}(x_0)=f^{(k)}(x_0)$ for all $k=0,...n$:
$$P(x)=P_{n,x_0}(x)$$
!!! example
If $P(x)=1+x^3+\frac{x^6}{2}$ and $f(x)=e^{x^5}}$, ... TODO
The desired function $P(x)$ being the $n$th degree Maclaurin polynomial implies that $P(kx^m)$ is the $(mn)$th degree polynomial for $f(kx^m)$.
Therefore, if you have the Maclaurin polynomial $P(x)$ where $P$ is the $n$th order Taylor polynomial:
- $P'(x)=P_{n-1,x_0}(x)$ for $f'(x)$
- $\int P(x)dx=P_{n+1,x_0}(x)$ for $\int f(x)dx$
The integration constant $C$ can be found by substituting $x_0$ as $x$ and solving.
For $m\in\mathbb Z\geq 0$, where $P(x)$ is the Maclaurin polynomial for $f(x)$ of order $n$, $x^mP(x)$ is the $(m+n)$th order polynomial for $x^mf(x)$.
### Taylor inequalities
The **triangle inequality** for integrals applies itself many times over the infinite sum.
The **Taylor remainder** is the error between a Taylor polynomial and its actual value. Where $k$ is an arbitrary value chosen as the **upper bound** of the difference of the first derivative between $x_0$ and $x$: $k\geq |f^{(n+1)}(z)|$
$$|R_n(x)|\leq\frac{k|x-x_0|^{n+1}}{(n+1)!}$$
An approximation correct to $n$ decimal places requires that $|R_n(x)|<10^{-n}$.
!!! warning
$k$ should be as small as possible. When rounding, round down for the lower bound, and round up for the upper bound.
### Integral approximation
The upper and lower bounds of a Taylor polynomial are clearly $P(x)\pm R(x)$. Integrating them separately reveals creates bounds for the integral.