Section 14-3 (6th edition)

Example 1 & 7. Find the first partial derivatives of f(x,y) = x^3 + x^2*y^3 - 2*y^2 at (2,1)

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

limit((f(x+h,y)-f(x,y))/h,h,0);

f_x: diff(f(x,y), x);

f_x, x=2, y=1;

limit((f(x,y+h)-f(x,y))/h,h,0);

f_y: diff(f(x,y),y);

f_y, x=2, y=1;

Find the second partial derivatives.

f_xx: diff(f(x,y), x, 2);

f_xy: diff(f(x,y), x, 1, y, 1);

f_yx: diff(f(x,y), y, 1, x, 1);

f_yy: diff(f(x,y), y, 2);

Example 3. Find the first partial derivatives of f(x,y) = 4 - x^2 - 2*y^2 at (1,1)

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

f_x: diff(f(x,y), x);

a: f_x, x=1, y=1;

draw3d(xlabel="X", ylabel="Y",
    color=blue, explicit(f(x,y),x,0,2,y,0,2),
    color=green, mesh([[0,1,-6], [2,1,-6]],[[0,1,6], [2,1,6]]),
    color=red, line_width=2, parametric(1+t,1,f(1,1)+a*t,t,-1,1),
    point_type=7, points([1],[1],[f(1,1)]),
    surface_hide = true);

f_y: diff(f(x,y), y);

b: f_y, x=1, y=1;

draw3d(xlabel="X", ylabel="Y",
    color=blue, explicit(f(x,y),x,0,2,y,0,2),
    color=green, mesh([[0,1,-6], [2,1,-6]],[[0,1,6], [2,1,6]]),
    color=yellow, mesh([[1,0,-6], [1,2,-6]],[[1,0,6], [1,2,6]]),
    color=red, line_width=2, parametric(1+t,1,f(1,1)+a*t,t,-1,1),
    color=red, line_width=2, parametric(1,1+t,f(1,1)+b*t,t,-1,1),
    point_type=7, points([1],[1],[f(1,1)]),
    surface_hide = true);

*Exercise 20: Find the first partial derivatives of tan(x*y)

diff(tan(x*y), x); diff(tan(x*y), y);

*Exercise 22: Find the first partial derivatives of x^y

diff(x^y, x); diff(x^y, y);

*Exercise 52: Find the second partial derivatives of sin(m*x+n*y)^2

diff(sin(m*x+n*y)^2, x, 2); diff(sin(m*x+n*y)^2, y, 2);

diff(sin(m*x+n*y)^2, x, 1, y, 1);

*Exercise 54: Find the second partial derivatives of x*y/(x-y)

f_xx: diff(x*y/(x-y), x, 2); f_yy: diff(x*y/(x-y), y, 2);

We can simplify them, and factor the denominator.

factor(ratsimp(f_xx)); factor(ratsimp(f_yy));

f_xy: diff(x*y/(x-y), x, 1, y, 1);

factor(ratsimp(f_xy));

*Exercise 56: Find the second partial derivatives of exp(x*exp(y))

diff(exp(x*exp(y)), x, 2); diff(exp(x*exp(y)), y, 2);

diff(exp(x*exp(y)), x, 1, y, 1);