Lab3 (1)
Lab3 (1)
Formulae:
f
1) Differentiate f w.r.t x by treating all other independent variables as constant
x
𝜕𝑢 𝜕𝑢
𝜕(𝑢,𝑣) 𝜕𝑥 𝜕𝑦
2) Jacobian of (u,v) w.r.t (x,y) is 𝐽 = 𝜕(𝑥,𝑦) = [𝜕𝑣 𝜕𝑣
]
𝜕𝑥 𝜕𝑦
f
2
f2
Note : 1) and are called mixed derivatives and are equal.
x y y x
2) Jacobian is a consequence of geometric distortion due to transformation
If expr is a symbolic vector or matrix, this function simplifies each element of expr
if expression
statements
ELSEIF expression
statements
ELSE
statements
END
fimplicit3 Plot implicit surface
fimplicit3(FUN) plots the surface where FUN(X,Y,Z)==0 between the axes limits,
with a default range of [-5 5].
jacobian(f,x) computes the Jacobian of the scalar or vector f with respect to the vector x.
Activities
1. Find all possible partial derivatives up to second order for the function f(x,y)=xy
2. Find all possible partial derivatives up to second order for f(x,y,z)=xyz
3. If then show that .
Assignment
Compute the Jacobian using built-in function and vice versa for the problem Nos.7 to 10.
Find all possible partial derivatives up to second order for the function f(x,y)=xy
clear
syms x y f
f=x*y
dfx=diff(f)
dfy=diff(f,y)
dfxx=diff(f,2) % dfxx=diff(diff(f),x)
dfxy=diff(dfx,y)
dfyx=diff(dfy,x)
dfyy=diff(dfy,y)
clear
syms x y z f(x,y,z)
f=x*y*z
dfx=diff(f)
dfy=diff(f,y)
dfz=diff(f,z)
dfxx=diff(f,2) % dfxx=diff(diff(f),x)
dfxy=diff(dfx,y)
dfxz=diff(dfx,z)
dfyx=diff(dfy,x)
dfyy=diff(dfy,y)
dfyz=diff(dfy,z)
dfzx=diff(dfz,x)
dfzy=diff(dfz,y)
dfzz=diff(dfz,z)
clear
syms x y u
u=x^2*atan(y/x)-y^2*atan(x/y)
dux=diff(u);
dfxyL=diff(dux,y);
dfxy=simplify(dfxyL)
u =
dfxy =
clear
syms x y u
u=x^y
dux=diff(u);
dfxy=diff(dux,y);
dfxyL=simplify(dfxy)
duy=diff(u,y);
dfyx=diff(duy,x);
dfxyR=simplify(dfyx)
if (dfxyL==dfxyR)
disp('Mixed Derivatives are Equal')
end
u =
dfxyL = dfxyR =
clear
syms x y z u
u=log(tan(x)+tan(y)+tan(z))
ux=diff(u,x)
uy=diff(u,y)
uz=diff(u,z)
LHS=sin(2*x)*ux+sin(2*y)*uy+sin(2*z)*uz
simplify(LHS)
u =
ux = uy = uz =
LHS =
ans =2
clear
syms x y Z
Z=(x^2+y^2)/(x+y)
ux=diff(Z)
uy=diff(Z,y)
LHS=(ux-uy)^2
RHS=4*(1-ux-uy)
LHS1=simplify(LHS)
RHS1=simplify(RHS)
if (LHS1==RHS1)
disp('Given relation is true')
end
Z =
ux = uy =
LHS = RHS =
LHS1 = RHS1 =
syms x y r th
x=r*cos(th);
y=r*sin(th);
J=[diff(x,r) diff(x,th);diff(y,r) diff(y,th)];
J1=simplify(det(J));
fimplicit3(x)
fimplicit3(y)
fimplicit3(J)
J1 = r
Find the Jacobian of and
clear
syms x y u v
u=x*sin(y);
v=y*sin(x);
J=[diff(u,x) diff(u,y);diff(v,x) diff(v,y)];
J1=simplify(det(J))
fimplicit3(x)
fimplicit3(y)
fimplicit3(J)
J1 =
Find the Jacobian of and
clear
syms x y u v
x=u^2-v^2;
y=2*u*v;
J=[diff(x,u) diff(x,v);diff(y,u) diff(y,v)];
J1=simplify(det(J))
fimplicit3(x)
fimplicit3(y)
fimplicit3(J)
J1 =
Find the Jacobian of , and
clear
syms x y z u v w
u=5*y;
v=4*x^2-2*sin(y*z);
w=y*z;
fimplicit3(u)
fimplicit3(v)
fimplicit3(w)
J=jacobian([u;v;w],[x y z])
fimplicit3(J)
J =