I'm trying to formally differentiate an expression. (I am aware of how to differentiate formally?, but am unable to generalize the idea)

For example:

tmp1 = Sum[Product[MyVal[i, j]^(1/n), {j, 1, n}], {i, 1, n}]

I would like to take the derivative with respect to some i in 1...n and j in 1...n . I thought I could specify something like

MyVal /: D[MyVal[i_, j_], MyVal[k_, l_], NonConstants -> {MyVal}] :=
     KroneckerDelta[i, k]*KroneckerDelta[j, l]

Then take the derivative

D[tmp1, MyVal[i, j]]

But this turns out not to work as expected. Any help in the right direction is appreciated. Thanks.


Unfortunately, I think formal differentiation of Product only works if you specify a numerical value for the limit n:

For example,

tmp = With[{n = 3},
   Sum[Product[MyVal[i, j]^(1/n), {j, 1, n}], {i, 1, n}]];

FullSimplify[D[tmp, MyVal[i1, j1], NonConstants -> {MyVal}]]


| improve this answer | |
  • 1
    $\begingroup$ Ah, so it does have some logic for Product, but won't go far enough. I guess I'll have to do some of this by hand still! $\endgroup$ – Rob Richmond Jun 19 '15 at 21:35
  • $\begingroup$ Since nothing else has come along, I'll go ahead and accept this. $\endgroup$ – Rob Richmond Jun 22 '15 at 5:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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