# Tema 10
10-4. Derivades parcials. Derivades direccionals.
          Derivades d'ordre superior.

## Funcions reals de dues variables

kill(all)$

Exemple 10.4.1

f(x,y):=4*x^2 + 3*y^2;

define (Dxf(x,y) , diff(f(x,y), x) );
define (Dyf(x,y) , diff(f(x,y), y) );

'Dxf(1,2)=Dxf(1,2);
'Dyf(1,2)=Dyf(1,2);

Exemple 10.4.2

kill(all)$

f(x,y):=(x^3 + y^3)/(x^2 + y^2);

define (Dxf(x,y) , diff(f(x,y), x) );
define (Dyf(x,y) , diff(f(x,y), y) );

'Dxf(x0,y0) = Dxf(x0,y0);       'Dyf(x0,y0) = Dyf(x0,y0);

'Dxf(0,0)=Dxf(0,0);     'Dyf(0,0)=Dyf(0,0);

'Dxf(0,0) = limit( (f(t,0) - 0)/(t) , t, 0);

'Dyf(0,0) =limit( (f(0,t) - 0)/(t) , t, 0);

Exemple 10.4.3

kill(all)$

'u=u:[1,1];     modul:sqrt(1^2+1^2);        'u[1]=u/modul;

f(x,y):=x+2*y;

'Duf(3,2) = limit(( f(3+t/sqrt(2),2+t/sqrt(2)) - f(3,2))/t, t, 0);

Exemple 10.4.4

kill(all)$

f(x,y):=2*x^3*y - x*y^2 + exp(x*y);

define (Dxf(x,y) , diff(f(x,y), x) );
define (Dyf(x,y) , diff(f(x,y), y) );

define (Dxxf(x,y) , diff(Dxf(x,y), x) );
define (Dxyf(x,y) , diff(Dxf(x,y), y) );

define (Dyxf(x,y) , diff(Dyf(x,y), x) );
define (Dyyf(x,y) , diff(Dyf(x,y), y) );

Hf(x,y) = matrix ( [Dxxf(x,y), Dxyf(x,y)] , [Dyxf(x,y), Dyyf(x,y)] ) ;

Hf(x,y) = Hf: hessian (f(x,y) , [x,y]) ;

'Hf(1,0) = Hf10:subst( [x=1, y=0] , Hf);

## Funcions reals de diverses variables

Exemple 10.4.5

kill(all)$

f(x,y,z):=4*x^2*y^2 + 3*x*exp(z^2);

define (Dxf(x,y,z) , diff(f(x,y,z), x) );
define (Dyf(x,y,z) , diff(f(x,y,z), y) );
define (Dzf(x,y,z) , diff(f(x,y,z), z) );

'Dxf(1,2,-1) = Dxf(1,2,-1);
'Dyf(1,2,-1) = Dyf(1,2,-1);
'Dzf(1,2,-1) = Dzf(1,2,-1);

define (Dxxf(x,y,z) , diff(Dxf(x,y,z), x) );
define (Dxyf(x,y,z) , diff(Dxf(x,y,z), y) );
define (Dxzf(x,y,z) , diff(Dxf(x,y,z), z) );

define (Dyxf(x,y,z) , diff(Dyf(x,y,z), x) );
define (Dyyf(x,y,z) , diff(Dyf(x,y,z), y) );
define (Dyzf(x,y,z) , diff(Dyf(x,y,z), z) );

define (Dzxf(x,y,z) , diff(Dzf(x,y,z), x) );
define (Dzyf(x,y,z) , diff(Dzf(x,y,z), y) );
define (Dzzf(x,y,z) , diff(Dzf(x,y,z), z) );

Hf(x,y,z) = matrix( [ Dxxf(x,y,z), Dxyf(x,y,z), Dxzf(x,y,z)]  ,
                           [ Dyxf(x,y,z), Dyyf(x,y,z), Dyzf(x,y,z)]  ,
                           [ Dzxf(x,y,z), Dzyf(x,y,z), Dzzf(x,y,z)]      );

Hf(x,y) = Hf: hessian (f(x,y,z) , [x,y,z]) ;

'Hf(1,2,-1) = Hf10:subst( [x=1, y=2, z=-1] , Hf);