Re: Some questions about vector
- To: mathgroup at smc.vnet.net
- Subject: [mg74567] Re: Some questions about vector
- From: dh <dh at metrohm.ch>
- Date: Tue, 27 Mar 2007 03:52:14 -0500 (EST)
- References: <eu54qn$l30$1@smc.vnet.net>
Hi Qi,
Mathematica treats your command mechanical. It takes the derivative of
Sum[i v[i],{i,1,N}] treating v[i] as a variable. Well this gives
Sum[i,{i,1,N}] and this evaluates to what you got.
Try also D[f[v],v[j]] and you get zero! As far as I know, it is not
possible to take the derivative with respect to a not yet determined
variable y[j]. To be on the save side, in D[..,x], x should be an atomic
symbol.
Daniel
Qi Zhang wrote:
> input:
>
> Clear[f];
> f[v] = Sum[(i*v[i]), {i, 1, N}]
> D[f[v], v[i]]
>
> the output is
>
> \!\(1\/2\ N\ \((1 + N)\)\)
>
> However what I expect is i
>
> What should I do in order to get the the answer I expected?
>
> Thanks a lot.
>