[Maxima] defining functions of s variables
Bart.Vandewoestyne at telenet.be
Tue Jan 8 09:48:05 CST 2008
On Tue, Jan 08, 2008 at 09:25:40AM -0600, Barton Willis wrote:
> Welcome to Maxima. Here is a function that sums its arguments
> [... snip explanation ...]
Thanks for the explanation. In the meanwhile, I had also found
that I can indeed do something like:
(%i1) f([x]) := product(x[i]^i, i, 1, length(x));
(%o1) f([x]) := product(x , i, 1, length(x))
(%i2) f(1, 2, 3);
But now I want to go one step further and be able to calculate partial
derivatives for an arbitrary s-dimensional function (as it is defined by
the user in his command for defining f([x])). And this is where I'm stuck.
Take the dimension of x to be three, then the function as I define it
f(x) = x^1 * x^2 * x^3
and then i want to be able to calculate for example the first partial
derivative to x, being:
x^2 * x^3
However, if I try
(%i3) diff(f(x), x, 1);
(%i4) diff(f([x]), x, 1);
These results are not what I expect them to be...
I want to be able to do this for whatever partial derivative I need and
for whatever function I a user defines, so not only for the above example
as I have given it.
Any help welcome!
"Share what you know. Learn what you don't."
More information about the Maxima