Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Differentiation w.r.t. elements of lists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79642] Differentiation w.r.t. elements of lists
  • From: Daniel Hornung <ds.mpg.de.thispartismydomain.daniel.hornung at insertdomainhere.com>
  • Date: Wed, 1 Aug 2007 04:54:54 -0400 (EDT)
  • Organization: GWDG, Goettingen
  • Reply-to: ds.mpg.de.thispartismydomain.daniel.hornung at insertdomainhere.com

Hello,
I don't know if what I want to do is impossible to do neatly (probably not)
or whether I simply chose the wrong way (maybe).

Basically I want to do componentwise differentiation.  Here's a short test
case:
----
In[1] := h[x_]:=Sum[x[[j]]^2,{j,1,Length[x]}]

In[2] := dh[x_,i_]=D[h[x],x[[i]]]
>From In[2]:=
Part::pspec: Part specification i is neither an integer nor a list of 
integers. Mehr...
Out[2]= 0

In[3]:= Assuming[i\[Element]Integers&&i>0&&i<=n,dh[x_,i_]=D[h[x],x[[i]]]]
>From In[3]:=
Part::pspec: Part specification i is neither an integer nor a list of 
integers. Mehr...
Out[3]= 0
----

What I would want is a result like dh[x_,i_]=2x[[i]], of course.

Another, even shorter test case would be 

D[x[[i]], x[[j]]]

which "should", IMHO, return KroneckerDelta[i,j].

Any ideas or hints how to solve these problems in a nice way?

Thank you in advance,
Daniel Hornung


  • Prev by Date: Re: Is Save As->HTML broken in 6.0?
  • Next by Date: Multi-variable Integration
  • Previous by thread: Re: Is Save As->HTML broken in 6.0?
  • Next by thread: Re: Differentiation w.r.t. elements of lists