# Calculating the derivatives of an integral expression

I have the following function:

ee[x, y] = Integrate[x^2 + y^2, x]


I want to calculate the derivatives of this function w.r.t x and y. For example:

D[ee[x, y], {1, 0}] //FullSimplify


But the result of mathematica (with or without using 'FullSimplify') is the input expression itself:

D[(x^3/3 + x*y^2)[x, y], {1, 0}]


I was wondering if anyone can explain how can I simplify the above expression

Your function should be defined with patterns for the arguments

Clear[ee]

ee[x_, y_] = Integrate[x^2 + y^2, x]

(* x^3/3 + x y^2 *)


The derivatives are

D[ee[x, y], #] & /@ {x, y}

(* {x^2 + y^2, 2 x y} *)


More simply,

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

(* {x^2 + y^2, 2 x y} *)


Or more obscurely,

(Derivative @@ #)[ee][x, y] & /@ {{1, 0}, {0, 1}}

(* {x^2 + y^2, 2 x y} *)


Or if you mean to take the derivatives in turn

D[ee[x, y], x, y]

(* 2 y *)

D[ee[x, y], y, x]

(* 2 y *)

• And what if my real code is such a way that ee[x,y] is first used in an expression (e.g. named 'hh') without definition with ee[x_,y_] then I am substituting an integral expression for ee[x,y] and then calculating the derivative? @Bob-Hanlon Commented Dec 4, 2021 at 19:15
• D[expr /. ee[x_, y_] :> Integrate[x^2 + y^2, x], {{x, y}}]???? To clarify your intent give a specific example, what you have tried, and explain the problem you are having. Commented Dec 4, 2021 at 19:51