# Exercici 11.12

kill(all)$

F(x,y,z):=x*sin(%pi/y) - y*z^2 + 1;

Eq1 : F(x,y,z) = 0;

## Apartat a)

F(1,2,-1);

diff(F(x,y,z), z);

DzF(x,y,z):=-2*y*z;

DzF(1,2,-1);

## Apartat b)

depends ( [z], [x,y]) ;

diff (Eq1, x);      diff (Eq1, y);

Eq2a :  sin(%pi/y)-2*y*z*Dxz =0
;
Eq2b : -2*y*z*Dyz - z^2 - (%pi*x*cos(%pi/y))/y^2=0
;

subst ([x=1, y=2, z=-1], Eq2a);
subst ([x=1, y=2, z=-1], Eq2b);

DxzP : -1/4;        DyzP : 1/4;

EqPT :  z - (-1) = (-1/4)*(x-1) + (1/4)*(y - 2);

EqPT2:  x - y + 4*z + 5 = 0;

EqRN_1 :  x = 1 + %lambda;
EqRN_2 :  y = 2 - %lambda;
EqRN_3 :  z = -1 + 4*%lambda;

## Apartat c)

T1(x,y) :=  -1 + DxzP*(x-1) + DyzP*(y-2);

'T1(x,y) = T1(x,y);

expand(%);

## Apartat d)

kill(all)$

z(x,y) := - sqrt( (x/y)*sin(%pi/y) + 1/y ) ;

taylor (z(x,y), [x,y], [1,2], [2,2]);

expand(%);