       Re: D under Sum

• To: mathgroup at smc.vnet.net
• Subject: [mg128431] Re: D under Sum
• From: Daniel <dosadchy at its.jnj.com>
• Date: Fri, 19 Oct 2012 02:41:23 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-newout@smc.vnet.net
• Delivered-to: mathgroup-newsend@smc.vnet.net

```> Hello
>
> I want the derivation D to be applied under the Sum
> sign,
> I have a function HoldSum that do not evaluate but is
> similar to Sum in form
>
> In:= D[HoldSum[p*i, {i, 1, n}], p]
>
> I get the output :
>
> Out=i*HoldSum^(1, {0, 0, 0})[i p, {i, 1, n}]
>
> but I would want that D be applied under the Sum sign
> like done by hand here :
>
> In:= HoldSum[D[p i, i], {i, 1, n}]
>
> Out= HoldSum[p, {i, 1, n}]
>
> Obviously I want D to work for any expression
> containing HoldSum (even on nested HoldSum
> expression)
>
> Does anybody knows how to do that ?
>
> Best regards
>
> Nicolas
>

I don't understand why you want derivative with respect to 'p' (D[HoldSum[p*i, {i, 1, n}], p]) to be replaced by derivative with respect to 'i' (HoldSum[D[p i, i], {i, 1, n}])

Assuming you meant HoldSum[D[p i, p], {i, 1, n}], you should define a delayed upvalue:

In:= D[HoldSum[s_,i_],v_] ^:= HoldSum[D[s,v],i]

In:= D[HoldSum[p*i,{i,1,n}],p]
Out= HoldSum[i,{i,1,n}]

In:= D[HoldSum[p^i,{i,1,n}],p]
Out= HoldSum[i p^(-1+i),{i,1,n}]

```

• Prev by Date: Re: Sum elements in a list with conditions
• Next by Date: Re: "Discovering" a grid in an image?
• Previous by thread: Re: D under Sum
• Next by thread: Ordinary Differential Equation: Mathematica