Suppose now that **f(x, y)**
is a function of two variables. An example would be
**f(x, y) = x**^{2} + y^{2}.
It turns out that near any particular 2D point
**(x**_{0}, y_{0}) the function
is approximately an affine function. In other words, there exist constants
**A** and **B** such that for small values of
and

**f(x**_{0} + , y_{0} + )
~ f(x_{0}, y_{0})
+ A
+ B
For example

**(x**_{0} + )^{2} + (y_{0} + )^{2}
= x_{0}^{2} + y_{0}^{2}
+ 2 x_{0} + 2 y_{0}
+ ^{2} + ^{2}

~ x_{0}^{2} + y_{0}^{2}
+ 2 x_{0} + 2 y_{0}
so that here **A = 2 x**_{0}
and **B = 2 y**_{0}.
This example suggests how to compute the coefficients **A**
and **B**. To see what **A** is,
fix **y** temporarily to
be constant,
and view **F(x, y)**
as a function of **x** alone.
The coefficient **A** is then the derivative
with respect to **x** of this function. It is called
the **partial derivative** of **f(x, y)**
with respect to **x** Similarly for **B**:
fix **x**
and take the derivative with respect to
**y**. There are symbols for the partial derivatives:

f_{x} = and
f_{y} =
For example, if **f(x, y) = (x**^{2}+y)^{2}
then
the partial derivatives are
**4x(x**^{2} + y)
and
**2(x**^{2}+ y).

These linear approximations can be seen in
a plot of level lines
**f(x, y) = ***const*.
If we look only near a fixed point **(x**_{0}, y_{0})
then the level lines look very much like the level lines of an affine function - they
are close to being straight,
and they are evenly spaced. Here is what happens for the function
**f(x, y) = x**^{4} + y^{4} as we zoom in.

#### Gradients

If **f(x, y)** is a function of two variables, in the neightbourhood
of any point **(x**_{0}, y_{0}) it
is approximated by an affine function

**
f(x**_{0}, y_{0}) + A (x - x_{0}) + B (y - y_{0})
where **A** and **B** are the partial derivatives of **f**.
As a consequence, in small
regions its level lines are very nearly the same
as the level lines of this affine function. Now the level lines of the
affine function **AX+By+C** are straight lines, and they
are perpendicular to the vector
**[A, B]**. Therefore:

#### For 2D to 2D

A 2D-to-2D transformation is a transformation from 2D points **(x, y)** to
other 2D points **(u(x, y), v(x, y))**. We shall see examples later on,
in the analysis of lens systems. But here I just wwant to derive
a linear approximation formula.
Here, too, there is a linear approximation formula, and it follows from
the previous one. Here's how it goes:
**
f(x**_{0} + , y_{0} + )
=
( u(x_{0} + , y_{0} + ),
v(x_{0} + , y_{0} + ) )

~
( u(x_{0}, y_{0})
+ ( )
+ ( ) ,
v(x_{0}, y_{0})
+ ( )
+ ( ) )

= f(x_{0}, y_{0})
+

In other words, in small regions of the plane
such a transformation is
approximated by an **affine transformation**,
one obtained from a linear transformation by a translation.