0
$\begingroup$

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

$\endgroup$

1 Answer 1

1
$\begingroup$

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 *)
$\endgroup$
2
  • $\begingroup$ 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 $\endgroup$
    – Alex97
    Commented Dec 4, 2021 at 19:15
  • $\begingroup$ 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. $\endgroup$
    – Bob Hanlon
    Commented Dec 4, 2021 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.