I have a list of functions (actually they are derivatives) of the type:

{D[g[x,y],x],D[g[x,y],y]}

I would like to evaluate all of these functions at a point, say,[0,0], creating a list of the type:

{D[g[x,y],x][0,0],D[g[x,y],y][0,0]}

Is this possible?

Thanks.

=================

are you sure you want D[g[x,y],x][0,0]?

– Kuba

Jan 29 ’15 at 17:16

=================

2 Answers

2

=================

To get what you asked for, you can use

dl = {D[g[x, y], x], D[g[x, y], y]};

Through @ dl[0, 0]

However, as noted by @Kuba, you probably want something like

ClearAll[foo];

foo = Through@(Function[{x, y}, #] & /@ dl)@## &;

foo[0, 0]

Thats exactly it. Thanks.

– user191919

Jan 29 ’15 at 17:17

@user191919, my pleasure..

– kglr

Jan 29 ’15 at 17:20

f[x_] := x^2;

g[x_] := x^3;

{f[#], g[#]} & @ 5

(*

{25, 125}

*)

Or for your example:

f[x_, y_] := x^2 + y;

g[x_, y_] := Sin[x] + y^3;

{D[f[x, y], x], D[g[x, y], y]} /. {x -> 3, y -> 4}

(*

{6, 48}

*)