I would like to define an $n$-variable function with $n$ undefined. For example, I want something like this:
$$ f(x_1, \, \dots, \, x_n) = x_1 + \dots + x_n $$
And afterwards I want to take its derivatives with respect to x_j like this
$$ \dfrac{\partial}{\partial x_j} f = 1 $$
Is it possible to realise in Mathematica?
f[x__]:=Total[{x}]; D[f[x1,t x2,x3],x2]
work for you? $\endgroup$