Problem

Evaluate fx(x,y) and fy(x,y) at the indicated point. \[f(x,y)=x^2y−x+2y+3\] at (1,2)

Solution

f = expression(x^2*y-x+2*y+3)
dx2x <- D(f,"x")
dy2y <- D(f,"y")

f_x = function(x,y) {2 * x * y - 1}
f_y = function(x,y) {x^2 + 2}
x=1
y=2
f_x(x,y)
## [1] 3
f_y(x,y)
## [1] 3

The answer is 3 for both the functions at indicated point.