Re: partial derivate of a function of vector variable
- To: mathgroup at smc.vnet.net
- Subject: [mg108633] Re: partial derivate of a function of vector variable
- From: dh <dh at metrohm.com>
- Date: Thu, 25 Mar 2010 06:08:24 -0500 (EST)
- References: <hofa0t$4fd$1@smc.vnet.net>
Hi, f[x_]:=.. is a function of one argument (even if your scalar is a list) and not a function of several variables. Therefore there are no partial derivatives. The easiest soultion would be to define a function of several variables, but you do not want to do this. Another solution is to "create" a function of several variables on the fly, e.g. using dummy variables like: D[f[{x1,x2},x1]]/.{x1->first argument, x2->second argument} or we may use a pure function like: Derivative[1, 0][Evaluate@f[{#1, #2}] &] or another simpler possibility: Evaluate@D[f[{#1, #2}], #1]& Daniel On 25.03.2010 10:22, atlas shrugger wrote: > Hi, > > Let's say have function f of vector variable x. > f[x_] := x[[1]]^2 + x[[2]]^2 > > How to compute partial derivate by x_1? > Something like D[f[x], {{x[[1]]}}] does not work. > > I don't want to rewrite function f as f[x1_,x2_]. > > Thanks for help. > -- Daniel Huber Metrohm Ltd. Oberdorfstr. 68 CH-9100 Herisau Tel. +41 71 353 8585, Fax +41 71 353 8907 E-Mail:<mailto:dh at metrohm.com> Internet:<http://www.metrohm.com>