ee_lec2

Embed Size (px)

Citation preview

  • 8/13/2019 ee_lec2

    1/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    MATHEMATICS FOR ELECTRICAL

    ENGINEERING I

    Dr. G.A. Pavliotis

    Department of Mathematics Imperial College London

    Spring term 2007/08

  • 8/13/2019 ee_lec2

    2/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    We consider functions of two variables

    u=u(x, y).

    The theory that we will develop also applies to functions of more

    variables. We want to define the rate of change of the function

    u(x, y)with respect to the variablesxandy. The definition ofthe derivative for a function of a single variableu=u(x)is

    du

    dx = lim

    h0

    u(x+ h) u(x)h

    .

    In the case of a function of two variables we can use a similar

    definition, but now we have to consider derivatives with respect

    to eitherxory. We define thepartial derivativesthrough theformulas

    u

    x = lim

    h0

    u(x+ h, y) u(x, y)h

    and

    uy

    = limh0

    u(x, y+ h) u(x, y)h

    .

  • 8/13/2019 ee_lec2

    3/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    To calculate partial derivatives, we use the standard

    differentiation rules while keeping the other variable fixed.

    Example

    Calculate the partial derivatives of

    u(x, y) =x2 sin(y) + y3. (1)

    We have

    ux

    =2xsin(y), uy

    =x2 cos(x) + 3y2.

  • 8/13/2019 ee_lec2

    4/67

  • 8/13/2019 ee_lec2

    5/67

    P i l Diff i i T l i f f i f i bl S i i E Fi O d ODE

  • 8/13/2019 ee_lec2

    6/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Example

    Calculate the first and second order partial derivatives of

    u(x, y) =x2y4.

    We calculate

    ux =2xy4, uy=4x

    2y3,

    uxx=2y4, uyy=12x

    2y2,

    uxy =8xy3, uyx=8xy

    3.

    P ti l Diff ti ti T l i f f ti f 2 i bl St ti i t E t Fi t O d ODE

  • 8/13/2019 ee_lec2

    7/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Example

    Calculate the first and second order derivatives of

    u(x, y) =ex2+2xy+3y2 .

    The first derivatives are

    ux=ex2+2xy+3y2 (2x+ 2y), uy=ex2+2xy+3y2 (2x+ 6y).

    The second derivatives are

    uxx =ex2+2xy+3y2

    (2x+2y)2+2, uyy=e

    x2+2xy+3y2

    (2x+6y)2+6The mixed derivatives are

    uxy =ex2+2xy+3y2

    (2x+ 2y)(2x+ 6y) + 2

    ,

    uyx=ex2+2xy+3y2(2x+ 6y)(2x+ 2y) + 2.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    8/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Theorem

    Let u(x, y) C2(R2). Then2u

    xy =

    2u

    yx.

    We can also define higher order partial derivatives:

    3u

    x3,

    3u

    x2y,

    3u

    xy2,

    3u

    y3.

    We have similar symmetry properties between higher orderpartial derivatives:

    uxxy =uxyx=uyxx, uyyx=uyxy=uxyy,

    and similarly for higher order derivatives.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    9/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    the matrix of second order derivatives of a functionu(x, y)iscalled theHessian matrixofu:

    D2u=

    uxx uxyuyx uyy

    . (2)

    Sinceuxy =uyx, the Hessian is a symmetric matrix. The

    determinantof the Hessian is

    det(D2u) =uxxuyy (uxy)2.

    We can also consider partial derivatives of functions of several

    variables,f =f(x1, x2, . . . , xn). The partial derivatives satisfy:

    2f

    xixj=

    2f

    xjxi, i,j=1, . . . n.

    In this case the HessianD2f is ann nsymmetric matrix.

  • 8/13/2019 ee_lec2

    10/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    11/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    We use now the fact thatht=

    cto calculate:

    u

    t =

    df

    dh

    h

    t =f(h(x, t))(c),

    and2u

    t2 =

    t f(h(x, t))(c)=c2f(h(x, t)).Consequently,

    uxx 1c2

    utt=f f =0.

    Thus, the functionu(x, t) =f(x ct)is a solution of thewaveequation

    2u

    x2 =

    1

    c22u

    t2.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    12/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    The wave equation is an example of apartial differentialequation (PDE). PDEs are used as models for most

    phenomena in physics and engineering. The wave equation is

    one of the most important PDEs. It governs the evolution of

    waves, and electromagnetic waves in particular (Maxwells

    equations). The constantcis thewave speed.

    Exercise

    Show that the function u(x, t) =h(x+ ct)where h is anarbitrary function is a solution of the wave equation

    uxx= 1

    c2utt.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    13/67

    y y p

    Proposition

    The solution of the wave equation

    2u

    x2 =

    1

    c22u

    t2 (3)

    isu(x, t) =f(x ct) + h(x+ ct), (4)

    where f and h are arbitrary functions. These functions are

    determined from the initial conditions

    u(x, 0) =u0(x), ut(x, 0) =v(x).

    The solution (4) represents two waves, one propagating to the

    left and one to the right with speed c.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    14/67

    y y p

    The four most important PDEs are:

    Thewave equation

    2u

    x2 =

    1

    c22u

    t2.

    Shrdingers equation

    iu

    t =

    2

    2m

    2u

    x2+ V(x)u.

    Laplaces equation

    2ux2

    + 2u

    y2 =0.

    Theheat equationu

    t =

    2u

    x2 .

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    15/67

    Example

    The function u(x, y) =tan1 yx

    solves Laplaces equation.

    We use the chain rule to calculate the partial derivatives of

    u(x, y) =tan1(f(x, y)), f =y/x:

    ux = d

    df

    tan1 f

    fx=

    1

    1 + f2

    y

    x2

    = y

    x2 + y2,

    uy =

    x

    x2 + y2 , uxx=

    2xy

    (x2 + y2)2 , uyy = 2xy

    (x2 + y2)2 .

    Consequently

    uxx+ uyy= 2xy

    (x2

    + y2

    )2

    2xy

    (x2

    + y2

    )2

    =0.

  • 8/13/2019 ee_lec2

    16/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    17/67

    Example

    The functionu(x, t) =

    1t

    ex2

    4t

    solves the heat equation.

    We calculate

    ut = 12

    t3e

    x2

    4t +

    x2

    4t2

    1

    te

    x2

    4t,

    ux = 1

    tx

    2t e

    x2

    4t,

    uxx = 1

    t

    1

    2t

    e

    x2

    4t + 1

    t

    x2

    4t2

    e

    x2

    4t

    =

    1

    2t3

    ex2

    4t + x2

    4t2

    1

    te

    x2

    4t.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    18/67

    Exercise

    Find the solution of the heat equation

    ut=Duxx,

    where D>0is a positive constant.

    Theinitial value problemfor the heat equation is

    ut=Duxx, u(x, 0) =f(x).

    Fourier developed the method of Fourier series in his attempt to

    solve the heat equation in 1822.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    19/67

    We can also define the partial derivatives of functions of several

    variables. For example, letu=u(x, y, t). The partial derivatives

    are calculated through ordinary differentiation while keeping theother variables fixed:

    u

    x =

    du

    dx

    y=const,t=const

    and similarly for the other derivatives.

    Example

    The function

    u= 1

    2x2 +

    1

    2y2 + 2t

    is a solution of the heat equation in 2 dimensions.

    ut=2, ux=x, uy=y, uxx=1, uyy =1.

    Consequently, 2= ut=uxx+ u =2.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    20/67

    Exercise

    Show that the function

    u=1

    te

    x2+y2

    4t

    solves the heat equation

    ut=uxx+ uyy.

    in2dimensions.

    We introduceLaplaces operator

    = 2

    x2+

    2

    y2.

    Laplaces equation and the heat equation in 2dcan be written

    as

    u=0, ut= u.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    21/67

    Differentials

    Consider a function of two variablesu=u(x, y). Assume thatxchanges by an amountxandyby an amounty,

    x x+x, y y+y. What is the resulting change inu(assuming thatxandyare small)?We have:

    u = u(x+x, y+y) u(x, y)= u(x+x, y+y) u(x+x, y) + u(x+x, y) u(x, y)=

    u(x+x, y+y) u(x+x, y)y

    y

    +

    u(x+x, y)

    u(x+x, y)

    x x

    uy

    (x+x, y)y+u

    x(x, y)x

    u

    y

    (x, y)y+u

    x

    (x, y)x.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    22/67

    Differentials

    We take the limitsx, y

    0. We calculate thedifferentialof

    u(x, y):

    du=u

    xdx+

    u

    ydy. (5)

    Similarly, we can calculate the differential of a function

    u=u(x, y, z)of 3 variables:

    du=u

    xdx+

    u

    ydy+

    u

    zdz.

    Notice the difference with the 1dcase:

    du=du

    dxdx.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    23/67

    Differentials

    Example

    Calculate the differential of

    u(x, y) =xy2 + cos(y).

    We calculate the partial derivatives:

    ux=y2, uy=2xy sin(y).

    The differential is

    du=y2 dx+ (2xy sin(y)) dx.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    24/67

    Differentials

    Area of a rectangle

    Example

    Consider the area of a rectangle of length xandy. Find the

    change in the area when the length of the sides changes by xandy.

    The area is given byA= xy. We have that

    dA=Axdx+ Aydy=y dx+ x dy.

    Alternatively:

    A = (x+x)(y+y) xy=yx+ xy+xy yx+ xy,

    byneglecting higher order terms(asymptotic analysis).

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    25/67

    The chain rule

    Consider the functionu=f(x)wherex=h(t). uis a functionof the variablet,u=f(h(t)). We can calculate the derivative of

    uwith respect totby using thechain rule:du

    dt =

    du

    dx

    dx

    dt =f(h(t))h.

    Consider now the functionu(t) =u(x(t), y(y)). We use thechain rule to calculate du

    dtdu

    dt =

    u

    x

    dx

    dt +

    u

    y

    dy

    dt =uxx+ uyy.

    To prove this, note that

    u uxx+ uyy,where

    x xt, y yt u ux(xt) + uy(yt) u

    tu

    x

    x+ uy

    y

    u=ux

    x+ uy

    y.

  • 8/13/2019 ee_lec2

    26/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    27/67

    The chain rule

    Proof

    Newtons equation can be written as a system of two first order

    differential equations

    x=y, my= V.

    We use the chain rule to calculate the rate of change of the

    total energy:

    dE

    dt

    = E

    x

    x+E

    y

    y

    = dV

    dxy+ myy=

    dV

    dxydV

    dxy

    = 0.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    28/67

    The chain rule

    Example

    The damped harmonic oscillator

    x+ 2x+2x=0

    dissipates energy.

    The equation of motion can be written as a system of first orderordinary differential equations:

    x=y, y= 2y 2x.The energy is

    E(t) = 12

    y2 + 12

    2x2.

    The rate of change is

    dE

    dt =

    E

    xx+

    E

    yy=2xy+ y(2x 2y) = 2y2

    0.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    29/67

    The chain rule

    The chain rule applies to functions of 3 or more variables: if wehave a functionu=u(x(t), y(t), z(t), t)thetotal derivativewithrespect tot is

    du

    dt =

    u

    t +

    u

    x

    dx

    dt +

    u

    y

    dy

    dt +

    u

    z

    dz

    dt.

    Suppose the functionsx, y, zare functions of two variablesr, s: x=x(r, s), y=y(r, s), z=z(r, s). Then

    ur = uxxr+ uyyr+ uzzr,ur = uxxs+ uyys+ uzzs.

  • 8/13/2019 ee_lec2

    30/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    31/67

    The chain rule

    Example

    Calculate the derivatives with respect to s, tof the function

    u=x2y withx=st, y=s+ t.

    First method:

    us = uxxs+ uyys=2x(s, t)y(s, t)xs+ (x(s, t))2ys

    = 2st(s+ t)t+ s2t2 =3s2t2 + 2s2t2 =3s2t2 + 2st3,

    ut = uxxt+ uyyt=2s2t2 + 2s3t.

    Second method:

    u(t, s) = (st)2(s+ t) =s3t2 + s2t3 us=3s

    2t2 + 2st3, ut=2s3t+ 3s2t2.

  • 8/13/2019 ee_lec2

    32/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    I li i F i

  • 8/13/2019 ee_lec2

    33/67

    Implicit Functions

    In order to calculate the derivatives of a function defined

    implicitly we note that from (6) it follows that

    F =0 F =Fxx+ Fyy+ Fzz=0.

    Or, by taking differentials,

    Fxdx+ Fydy+ Fzdz=0.

    In order to calculate the partial derivative of zwith respect tox,

    say, we notice that in this casey is held fixed and consequently

    we havedy=0. Consequently:

    Fxdx+ Fzdz

    y=const=0 z

    x =

    dz

    dx

    y=const

    = FxFz

    .

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    I li it F ti

  • 8/13/2019 ee_lec2

    34/67

    Implicit Functions

    Similarly:

    z

    y = Fy

    Fz,

    x

    y = Fy

    Fx,

    x

    z = Fz

    Fx,

    y

    z = Fz

    Fy,

    y

    x = Fx

    Fy.

    Notice thatx

    y =

    1yx

    .

    This is because whenzis kept fixed then the relation betweenxandyis that of a single variable, i.e., for fixed zthe equation

    F(x, y, z) =0 defines a function of single variabley=y(x)orx=x(y)and dy/dx=1/(dx/dy).

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Implicit Functions

  • 8/13/2019 ee_lec2

    35/67

    Implicit Functions

    LetF(x, y, z) =0. We have

    yx zy xz = FxFyFyFzFzFx= 1. (8)Equation (8)is very useful in thermodynamics.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Implicit Functions

  • 8/13/2019 ee_lec2

    36/67

    Implicit Functions

    Example

    Equation of state for an ideal gas The equation of state for an

    ideal gas is

    PV =NkBT, (9)

    whereP is the pressure,V is the volume, Nis the number of

    particles,T is the absolute temperature andkBis Boltzmannsconstant. The equation is of the form (6):

    F(P, V, T) =PV NkBT =0.

    We use (8) to obtain the very important formulaP

    V

    T

    T

    P

    V

    V

    T

    = 1.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Change of Coordinates

  • 8/13/2019 ee_lec2

    37/67

    Change of Coordinates

    Quite often it is useful to change coordinates, i.e. to go from the

    cartesiancoordinatesx, y zto new coordinatesr, s, t.

    Example

    Plane Polar Coordinates Thepolar coordinateson the plane

    are defined through the transformation

    x=rcos(), y=rsin(). (10)

    We also have

    r=

    x2 + y2, =tan1

    y

    x. (11)

    The equation of a circle or radius ain cartesian coordinates is

    x2 + y2 =a2.

    In polar coordinates it becomes

    r=a.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Change of Coordinates

  • 8/13/2019 ee_lec2

    38/67

    Change of Coordinates

    We can calculate the partial derivatives ofx, ywith respect tor, and of, wrtx, y. From (10) we have

    xr =cos(), x = rsin(),yr =sin(), y =rcos().

    On the other hand, from(11) we obtain

    rx= xx2 + y2

    =x

    r =cos(), ry=sin(),

    x= 1

    1 + y2/x2 y

    x2= y

    r2 = sin()

    r , y =

    cos()

    r .

    Notice that

    xr= 1rx

    , x= 1x

    , yr= 1ry

    , y= 1y

    .

    WHY?

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Change of Coordinates

  • 8/13/2019 ee_lec2

    39/67

    C a ge o Coo d ates

    Notice thatx, yare written as functions ofr, ,x=x(r, ), y=y(r, ). Similarly, we have that

    r=r(x, y), =(x, y). When we calculatexr, we considerxas a function ofrand and we keepfixed, whereas when wecalculaterxwe considerras a function of xandyand we keep

    yfixed:x

    r =

    dx

    dr =const = r

    x =

    dr

    dxy=const.Let nowu=u(r, ) =u(r(x, y), (x, y))). We want to calculateux, uyin terms ofur, u. We have:

    u

    x

    =urrx+ ux =cos()ur

    sin()

    r

    u.

    u

    y =urry+ uy =sin()ur+

    cos()

    r u.

    Notice that we can write

    x =cos()

    rsin()

    r

    ,

    y =sin()

    r +

    cos()

    r

    .

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Change of Coordinates

  • 8/13/2019 ee_lec2

    40/67

    g

    Example

    Calculate the partial derivatives wrtxandyof the function

    u(r, ) =r2 cos(2),

    wherer, are the planar polar coordinates.

    First method. We have

    ux = cos()ur sin()r

    u

    = cos()2rcos(2)

    sin()

    r

    (

    2r2 sin(2))

    = 2r

    cos() cos(2) + sin() sin(2)

    = 2r

    cos()

    cos2() sin2() + 2cos() sin2()= 2rcos()cos2() + sin2()=2rcos().

  • 8/13/2019 ee_lec2

    41/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Change of Coordinates

  • 8/13/2019 ee_lec2

    42/67

    Exercise

    Let u=u(x, y) =u(x(r, ), y(r, )). Show that

    u2x+ u2y =u

    2r +

    1

    r2u2 .

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Change of Coordinates

  • 8/13/2019 ee_lec2

    43/67

    ExerciseThe Laplacian is polar coordinates Let

    u=u(x, y) =u(x(r, ), y(r, )). Show that

    u=uxx+ uyy=1

    r

    rrur+ 1r2 2u

    2.

    In particular,for functions that depend only on the distance from

    the origin, i.e. u=u(r), the Laplacian becomes

    u(r) = 1r

    ddrrdu

    dr . (12)

    Functions that depend only onrare calledradially symmetric.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Change of Coordinates

  • 8/13/2019 ee_lec2

    44/67

    Example

    Show that the function

    u(x, y) =1

    2ln(y2 + x2) (13)

    is a solution of Laplaces equation in 2d.

    We use polar coordinates:

    u(r) =1

    2ln(r2) =ln(r).

    From(12)we get

    ln(r) = 1

    r

    d

    dr

    r

    1

    r

    =

    1

    r

    d

    dr (1) =0.

    The functionu(r) =ln(r)is called thefundamentalsolution of

    Laplaces equation in 2d.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Change of Coordinates

  • 8/13/2019 ee_lec2

    45/67

    There are many different coordinate frames that we can use in

    2dand 3d. We choose the one that is more convenient for our

    problem. When studying radially symmetric problems, then

    polar coordinates are a good choice.For other problems it might be more convenient to use

    x=rcosh(), y=rsinh().

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    46/67

    Consider a function of a single variable u=u(x). We can wecan expand it into a Taylor series at the point x0:

    u(x) = u(x0) + (x x0) dudx

    (x0) + 12!

    (x x0)2 d2udx2

    (x0)

    +1

    3!(x x0)2

    d3u

    dx3(x0) +. . .

    =

    n=0

    u(n)(x0)n! (x x0)n.

    By settingx x0 =hwe can rewrite this in the form

    u(x0+ h) =

    n=0u(n)(x0)

    n! h

    n

    .

    Consider the case of a function of 2 variables. We have a

    similar expansion. To obtain this expansion, we first do a Taylor

    series expansion inxwill keepingyfixed and we then do an

    expansion inywhile keepingxfixed.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    47/67

    u(x0+ h, y0+ k) = u(x0, y0+ k) + hux(x0, y0+ k)

    +h2

    2uxx(x0, y0+ k) +. . .

    = u(x0, y0) +

    hux(x0, y0) + ku0(x0, y0)

    +1

    2h2uxx(x0, y0) + 2hkuxy(x0, y0)+k2uyy(x0, y0)

    +. . .

    We introduce the differential operatorD=h x + k y.We have

    that

    D2f = D(Df) =

    h

    x + k

    y

    h

    f

    x + k

    f

    y

    = h2fxx+ 2hkfxy+ k

    2fyy.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    48/67

    We can calculateD3, D4 etc in a similar fashion. Using thisnotation we can write the Taylor series expansion for a function

    of 2 variables in the form

    u(x0+ h, y0+ h) =

    n=0

    Dnu(x0, y0)

    n! . (14)

    Let nowu=u(x, y, z)be a function of 3 variables. Using thenotation

    D=h

    x + k

    y +

    z,

    we can write the Taylor series expansion foru(x, y, z)at

    (x0, y0, z0)in the form

    u(x0+ h, y0+ h, z0+) =

    n=0

    Dnu(x0, y0, z0)

    n! .

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    49/67

    Exercise

    Let

    D=h

    x + k

    y +

    z,

    Show that

    D2 = h2 2

    x2+ k2

    2

    y2+2

    2

    z2

    +2hk

    2

    xy + 2h

    2

    xz + 2k

    2

    xz

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    50/67

    Example

    Calculate the first three terms in the Taylor series expansion of

    u(x, y) =e2xy at (x0, y0) = (0, 0).

    We have

    u(0, 0) =1, ux =2e2xy

    ux(0, 0) =2.

    uy= e2xy uy(0, 0) = 1uxx=4e

    2xy uxx(0, 0) =4,uxy = 2e2xy uxy(0, 0) = 2,uyy =e

    2xy

    uyy(0, 0) =1.

    Consequently

    u(h, k) 1 + 2h k+ 12

    4h2 4kh+ k2

    1 + (2h k) +

    12h k2 = (2h k)n.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    51/67

    Letu=u(x)be a function of a single variable. Astationarypointis defined as a point x

    0where the first derivative vanishes:

    du

    dx(x0) =0.

    It is amaximumwhenu(x0)< 0 and aminimumwhen

    u

    (x0)>0.Our goal is to develop a similar classification for functions of

    several variables.

    Definition

    Letu=u(x, y)be a function of 2 variables. We will call(x0, y0)a critical point ofuprovided that

    ux(x0, y0) =uy(x0, y0) =0.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    52/67

    We want to determine whether a critical point is a maximum, a

    minimum or a saddle. For this, we will use the Taylor series

    expansion. We will use the notation

    A= uxx(x0, y0), B=uxy(x0, y0), C=uyy(x0, y0). Let(x0, y0)be

    a critical point (and consequently the first derivatives vanish).The Taylor series expansion about(x0, y0)is

    u(x0+ h, y0+ k) =u(x0, y0) +1

    2Ah2 + 2Bkh+ Ck2

    +. . . .

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    53/67

    The change inu, when we changexbyhandybyk, is

    u=u(x0+h, y0+k)u(x0, y0) =1

    2

    Ah2 + 2Bhk+ Ck2

    (15)

    Ifu>0 for allh, ksufficiently small, then

    u(x0+ h, y0+ k)>u(x0, y0) (x0, y0) is a minimum.

    Ifu

  • 8/13/2019 ee_lec2

    54/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Procedure for finding and characterizing critical points

  • 8/13/2019 ee_lec2

    55/67

    Procedure for finding and characterizing critical points

    1 Find all critical points by solving the equations

    ux=0, uy=0.

    2 At each critical point calculate

    A= uxx(x0, y0), B=uxy(x0, y0), C=uyy(x0, y0).3 CalculateAC B2 at each stationary point.

    AC B2 0, A> 0 MINIMUMAC B2 >0, A< 0 MAXIMUM

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    56/67

    Exercise

    Find and characterize the critical points of

    u(x, y) = (x y)(x2 + y2 1) =x3 + xy2 x yx2 y3 + y.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    57/67

    Quite often we need to find the maxima and minima of a

    function subject to constraints.

    ExerciseMaximize the volume of a rectangular box subject to the

    constraint that the surface area is given.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    58/67

    We want to find the maximum of the function (volume)

    V(x, y, z) =xyz (16)

    subject to the constraint (surface area is given)

    A(x, y, z) =2(xy+ xz+ yz) =A. (17)

    Of course, we also have the "constraint"

    x, y, z>0. (18)

    We solve equation (17) forzand substitute into(16). This will

    give us a function of two variables x, y. We then maximize thisfunction.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    From (17) we obtain

  • 8/13/2019 ee_lec2

    59/67

    From(17)we obtain

    z= A 2xy2(x+ y)

    .

    Equation (16) becomes

    V(x, y, z) =(A 2xy)xy

    2(x+ y) .

    To calculate the critical points we need to solve the equations

    Vx(x0, y0) =Vy(x0, y0) =0.

    We have:

    Vx = 1

    2

    (Ay 4xy2)(y+ x) (Axy 2x2y2)(y+ x)2

    ,

    Vy = 1

    2

    (Ax 4x2y)(y+ x) (Axy 2x2y2)(y+ x)2

    ,

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    We obtain the equations

  • 8/13/2019 ee_lec2

    60/67

    We obtain the equations

    x2(A

    2y2

    4xy) = 0,

    y2(A 2x2 4xy) = 0.

    The solution that satisfies (18) is

    x=y= A61/2 .We can check that this leads to a maximum. From this we

    calculate

    z= A61/2and

    Vmax=

    A

    63/2

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    Lagrange Multipliers

  • 8/13/2019 ee_lec2

    61/67

    Lagrange Multipliers

    Suppose we want to find the extremum of V(x, y, z)subject tothe constraint ofF(x, y, z) =0. We form the function

    V(x, y, z) =V(x, y, z) F(x, y, z),whereis called aLagrange multiplier. We calculate theextrema of the new functionV(x, y, z).

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    62/67

    We can use partial derivatives in order to obtain the solution of

    a general class of first order ODEs, ofexact ODEs. Consider

    the ODE

    P(x, y) + Q(x, y)dy

    dx =0. (19)

    Assume that there exists a function F(x, y)so that

    dF

    dx =P(x, y) + Q(x, y)

    dy

    dx.

    Then the ODE (19) becomes

    dFdx

    =0,

    and the solution can be written implicitly asF(x, y(x)) =C.ODEs for which such a function exists are called exact.

  • 8/13/2019 ee_lec2

    63/67

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    64/67

    Criterion for an ODE to be exact

    The nonlinear first order differential equations

    P(x, y) + Q(x, y)dy

    dx =0

    is exact provided thatPy

    =Q

    x. (20)

    When condition (20) is satisfied, the solution of the ODE is

    defined implicitly through the formula

    F(x, y(x)) =C,

    whereF(x, y)is such that Fx=P, Fy=Q.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    65/67

    Exercise

    Find the solution of the equation

    (2xy+ cos(x) cos(y)) +dy

    dx(x2 sin(x) sin(y)) =0.

    Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

    A non-exact first order ODE can become an exact through

  • 8/13/2019 ee_lec2

    66/67

    g

    multiplication by an appropriate function. Consider the equation

    P(x, y) + Q(x, y) dydx

    =0.

    Assume thatPy=Qx. We multiply the equation by a function(x, y):

    (x, y)P(x, y) +(x, y)Q(x, y) dydx

    =0. (21)

    We choose the function(x, y)so that

    y(P) =

    x(Q) . (22)

    Hence, the modified equation (21) is exact. In order to find

    (x, y)we need to solve equation (22), which is a partialdifferential equation. Usually it is not possible to solve this

    equation Partial Differentiation Taylor series for functions of 2 variables Stationary points Exact First Order ODEs

  • 8/13/2019 ee_lec2

    67/67

    Exercise

    Find the solution of the equation

    (xy 1) dx+ (x2 xy) dy=0.