# Exercici 10.6

## Apartat a)

kill(all)$

Designarem f1 , f2 les expressions analitiques de la funcio en el seu respectiu domini

f1(x,y):=x^2/(2*y);     
f2(x,y):=0;

define (Dxf1(x,y) ,  diff(f1(x,y), x) );        
define (Dyf1(x,y) ,  diff(f1(x,y), y) );

'Dxf1(x0,y0)=Dxf1(x0,y0);     
'Dyf1(x0,y0)=Dyf1(x0,y0);

F1(t):=(f2(0+t, 0) - f2(0,0))/(t);

'Dxf(0,0) = limit( F1(t) , t, 0);

F2(t):=(f1(0, 0+t) - f2(0,0))/(t);

'Dyf(0,0) = limit(F2(t),t,0);

## Apartat b)

kill(all)$

f1(x,y):=x^2+y^2;   
f2(x,y):=sqrt(x^2+y^2);
f(x,y):=if x<0 then f2(x,y) else f1(x,y);

define (Dxf1(x,y) ,  diff(f1(x,y), x) );        
define (Dyf1(x,y) ,  diff(f1(x,y), y) );

define (Dxf2(x,y) ,  diff(f2(x,y), x) );        
define (Dyf2(x,y) ,  diff(f2(x,y), y) );

F11(t):=(f1(0+t, 0) - f1(0,0))/(t);

limit( F11(t) , t, 0, plus);

F12(t):=(f2(0-t, 0) - f1(0,0))/(-t);

limit( F12(t) , t, 0, minus);

Conclusio: Dxf(0,0) no existeix

F2(t):=(f1(0, 0+t) - f1(0,0))/(t);

'Dyf(0,0) = limit(F2(t), t, 0);

## Apartat c)

kill(all)$

f1(x,y):=(3*y+1)*x;         
f2(x,y):=x-x^2-y^2;
f(x,y):=if y<0 then f2(x,y) else f1(x,y);

define (Dxf1(x,y) ,  diff(f1(x,y), x) );        
define (Dyf1(x,y) ,  diff(f1(x,y), y) );

define (Dxf2(x,y) ,  diff(f2(x,y), x) );        
define (Dyf2(x,y) ,  diff(f2(x,y), y) );

'Dxf1(x0,y0)=Dxf1(x0,y0);     'Dxf2(x0,y0)=Dxf2(x0,y0);        'Dyf1(x0,y0)=Dyf1(x0,y0);   'Dyf2(x0,y0)=Dyf2(x0,y0);

'Dxf1(0,0)=Dxf1(0,0);     'Dxf1(0,0)=Dxf1(0,0); 'Dyf1(0,0)=Dyf1(0,0); 'Dyf2(0,0)=Dyf2(0,0);

## Apartat d)

kill(all)$

f1(x,y):=(1/x)*sin(x*y);
f2(x,y):=x;

define (Dxf1(x,y) ,  diff(f1(x,y), x) );        
define (Dyf2(x,y) ,  diff(f2(x,y), y) );

F1(t):=(f2(t,0)-f2(0,0))/t;

L1=limit( F1(t) , t, 0);

F2(t):=(f2(0,t)-f2(0,0))/t;

L2=limit( F2(t) , t, 0);