New Reply

Mathematica: A function that derives another function on all its arguments

 
Share Thread
Mar18-12, 07:21 AM   #1
 

Mathematica: A function that derives another function on all its arguments


Hi!

I am wondering if someone could help me write a function in Mathematica. What I would like it to do is take another function g
as its argument and return the sum of g derived to all of its arguments (and multiplied by a scalar Δxi)

[tex] f\left[g\left[x_1,x_2,\text{...},x_n\right]\right] = \sqrt{\overset{n}{\sum _{i=1} }\left(\frac{\partial g}{\partial x_i}\text{$\Delta $x}_i\right){}^2} [/tex]

I have already managed to make such a function by brute force,
but it brakes down if I assign a value to any character (a,b,c,d,...). This is what I came up with:

[tex] \text{symbols}=\{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A, B,C,D,\text{Ee},F,G,H,\text{Ii},J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,\alph a ,\beta ,\gamma ,\delta ,\varepsilon ,\zeta ,\eta ,\theta ,\iota ,\kappa ,\lambda ,\mu ,\nu ,\xi ,o,\rho ,\varsigma ,\sigma ,\tau ,\upsilon ,\varphi ,\chi ,\psi ,\omega \}; [/tex]
[tex] \text{abs}[\text{f$\_$}]\text{:=} \surd \text{Sum}\left[(D[f,\text{symbols}[[\aleph ]]]*\text{Symbol}[\Delta <>\text{ToString}[\text{symbols}[[\aleph ]]]])^2,\{\aleph ,\text{Length}[\text{symbols}]\}\right. [/tex]

I hope someone can help me come up with a better solution.

Thanks!
PhysOrg.com science news on PhysOrg.com

>> City-life changes blackbird personalities, study shows
>> Origins of 'The Hoff' crab revealed (w/ Video)
>> Older males make better fathers: Mature male beetles work harder, care less about female infidelity
New Reply

Tags
arguments, derivative, fuction, mathematica

Similar discussions for: Mathematica: A function that derives another function on all its arguments
Thread Forum Replies
How to compute the hypergeometric function with two matrix arguments? Calculus 0
Fortran function calling with wrong arguments Programming & Comp Sci 4
Bessel FUnction small arguments General Math 2
Dirac delta function with complex arguments General Math 2
Give to an interpolation function an analitic function with mathematica Math & Science Software 1