Anda di halaman 1dari 6

SHES 2303 MATHEMATICS IN BIOLOGY

1 Functions of Several Variables

For more complex cases, we often want to consider functions of more than a single
variable. For example, we may want to determine whether a person is considered over
or underweight by measuring his or her height (x), in addition to weight (y). The body
mass index (BMI) is defined as
y
f (x, y) = 2 .
x
Accordingly, WHO classifies normal weight as values of f (x, y) between 18.5 and 24.9.
This corresponds to particular values on the vertical (z) axis, which can be projected onto
a particular region on the x-y plane (Figure 1). Although a graphical representation is
no longer possible when the number of variables is large, nevertheless the mathematics
of calculus is still valid, and require only simple modifications in some cases.

40

30
BMI

20

10
1.5 100
1.6 80
1.7
1.8 60 Y
X
1.9 40
2.0

Figure 1. BMI as a plane in a 3-dimensional space.

1
For a function with two variables, its domain is given by a region on the x-y plane, and
its range is given by the z-axis. Contrast this with the case of a single variable, where
the domain is just some interval on the x-axis, and the range is the corresponding values
on the y-axis. For example, the function
p
f (x, y) = y − x2 ,
has domain given by y ≥ x2 , and range given by [0, ∞). The concept of limit in the
multivariable case remains similar to the case of single variable functions. For a two-
variable function, the limit of the function f (x, y) (if it exists) as (x, y) approaches (x0 , y0 )
is given by
lim f (x, y) = L,
(x,y)→(x0 ,y0 )

where L is the limit value.

EXAMPLE 1. Calculating a limit:


x−y 0−1
lim 2 2
= .
(x,y)→(0,1) x + y 0+1

This looks rather familiar since we just substitute (0, 1) into f (x, y). ♣

In some cases, the limit of f (x, y) does not exist. For the single variable case, this
can be checked by considering the direction of approach, that is, the limit exists if and
only if
lim+ f (x) = lim− f (x).
x→x0 x→x0

For two variables, the limit exists if and only if it is independent of the path of approach.

EXAMPLE 2. The limit of the function


xy
f (x, y) = ,
x4 + y 2

as (x, y) approaches (0, 0) does not exist (Figure 2). To see this, we consider f (x, y) along
the curve y = kx2 , where x 6= 0, which is

xy x2 (kx2 )

k
f (x, y)|y=kx2 = 4 2
= 4 2 2
= .
x + y y=kx2 x + (kx )
1 + k2

Therefore, along the path y = kx2 ,


k k
lim f (x, y) = lim = ,
(x,y)→(0,0) (x,y)→(0,0) 1 + k 2 1 + k2

which is completely determined by k. Since this leads to nonunique limit values, the
limit does not exist.
2
0.4

0.2
f(x,y)
0.0
10
−0.2
5
−0.4

−10
0

Y
−5

0 −5
X
5

−10
10

Figure 2. The function f (x, y) = xy/(x2 + y 2 ).

2 Partial Derivatives

The derivative of a function of two or more variables with respect to one of the variables
is called a partial derivative. For example, consider the function

f (x, y) = −x2 − y 2 .

The partial derivative of f with respect to x is


∂f
= −2x,
∂x
by treating y as a constant. Similarly, we have
∂f
= −2y.
∂y
To find the maximum or minimum of f , we set
∂f ∂f
=0 ; = 0.
∂x ∂y
3
In this case, we have x = 0 and y = 0. Analogous to the second derivative test for
maximum or minimum, we check the determinant of the matrix of second order partial
derivatives  
fxx fxy
M= .
fyx fyy
If det M > 0 and fxx < 0, then the point is maximum ; if det M < 0 and fxx > 0, then
it is minimum. For the above example, we have
 
−2 0
M= ,
0 −2

so det M = 4 > 0 together with fxx < 0 implies that (x, y) = (0, 0) is a maximum (Figure
3). If det M < 0, then (x, y) is a saddle point. The surrounding domain around a saddle
point (a, b) can result in f (x, y) > f (a, b) or f (x, y) < f (a, b) (Figure 4).

−10

−20
f(x,y)

−30
−40
−50

−4

−2

0 4
X

2
2
0
Y
−2
4
−4

Figure 3. The function f (x, y) = −x2 − y 2 , with maximum at x = 0, y = 0.

4
20

10

f(x,y)
0

−10
−20

−4 4

−2 2

0 0
X Y
2 −2

4 −4

Figure 4. The function f (x, y) = y 2 − x2 , with saddle point at x = 0, y = 0.

3 Lagrange Multipliers

Occasionally, we may want to maximise or minimise a function of several variables under


some particular constraint. For example consider the trinomial probability mass function

L(p1 , p2 , p3 ) = Cpx1 1 px2 2 px3 3 ,

where C is the normalising constant, x1 + x2 + x + 3 = n and p1 + p2 + p3 = 1. It is easier


to maximise P by considering its logarithm,

log L = x1 log p1 + x2 log p2 + x3 log p3 + C ′ ,

where C ′ is a constant that is not important in the maximisation step. Since the variables
p1 , p2 , p3 are not independent, we need to modify log L using the method of Lagrange
Multipliers. This is done as follows. First, introduce an auxilliary parameter λ, and
write
log L = x1 log p1 + x2 log p2 + x3 log p3 + λ(1 − p1 − p2 − p3 ).

5
Take partial derivative of log L with respect to the three variables:
∂ log L x1
= − λ = 0;
∂p1 p1
∂ log L x2
= − λ = 0;
∂p2 p2
∂ log L x3
= − λ = 0;
∂p3 p3

Solving these three equations simultaneously yields pi = xi /n, for i = 1, 2, 3.

EXAMPLE 3. The Simpson Index


s
X
H =1− p2i ,
i=1

is used in ecological work to assess biodiversity level. The parameters pi are the relative
frequencies of the species of a particular genus at a site. Show that H is maximum when
all pi are equal.

SOLUTION. The constraint is given by p1 + p2 + · · · + ps = 1, so we will augment H as


s
X
H =1− p2i + λ(1 − p1 − p2 − · · · − ps ).
i=1

This leads to
∂H
= −2pi − λ = 0,
∂pi
for i = 1, 2, . . . s. Solving all s equations simultaneously, we have p1 = p2 = · · · ps . This
implies that pi = 1/s. ♣

Anda mungkin juga menyukai