**Example I: The functional depends on the whole domain.**
Consider the functional

(47) |

which depends on the domain as well as on a function , which depends on that domain too. For the moment we do not specify exactly the dependence of this function on the domain. Later on this function will be a solution of a PDE defined in , and will change as we change the domain .

We need to calculate the variation of this functional with respect to .
To do this we assume that the function is defined in a
slightly larger domain that includes .
We examine
where
is a small perturbation of ,
parameterized by a small number .
The perturbation of the shape is done following Pironneau [13].
The boundary of is perturbed
in the direction of the outward normal to by
, where is a parameterization of the
boundary, is the outward normal and is an arbitrary
function defined on the boundary. We use the short notation,
and
.
We have

(48) |

For small these integrals can be approximated as follows

(49) | |||

(50) | |||

(51) |

where

(52) |

and and . We conclude that,

(53) |

This formula is useful when we have functionals defined on the interior of the domain up to the boundary. Recall that in order to construct the necessary conditions, or to calculate gradients, we need to consider this type of expression.

**Example II: Boundary Functionals.**
Consider next the functional

(54) |

where , is an area element, and is part of the boundary of a domain . The function depends on the domain in a way which we do not prescribe at the moment. Again we are interested in perturbations of the domain, and as a result of it perturbations of . It is convenient to use the same type of perturbation as before. The new boundary will be denoted by and we want to calculate

(55) |

for small . This case is slightly more complicated since we have to consider the change of the area element as well. Consider a line element , where the radius of curvature is given by . Note that this line element can be written as where is the radius of curvature and represent an infinitesimal angle. A change in the boundary by changes the line element to . Thus, we obtain a formula, for the two dimensional case, for the new line element

(56) |

For problem in three dimension we consider two orthogonal
tangential coordinates and in
each direction a similar result hold for the line element. The area
element being the product of the two line elements has the formula (56) but
now with

(57) |

where and are the radiuses of curvature in two orthogonal directions on the surface. Note that the quantity does not depends on the choice of coordinate system since it is the trace of the matrix of second derivatives of the surface describing the boundary.

In order to obtain a simple expression for the variation of the functional as a function of the boundary we have to express in terms of an integral and quantities on .

Consider a point and the corresponding shift of it to
given by
.
The integral depends on which is a function of , and

(58) |

(59) |

For simplicity, we assume that does not depends explicitly on , although this can be handled as well. Using the last two formulas we have

(60) |

Using this together with the formula for the line (area) element (56) we get

(61) |

Substituting (61) into (55) we have

(62) |