I’m trying to make a sum with derivatives of an arbitrary number of parameters. E.g. for a vector
function F(x,y)=[exp(x^3 y) - 1, y^2 - 5xy]
I’d like to calculate expressions like first derivative multiplied on something.
I tried
n := 2;
xvars := seq(x[i], i = 1 .. n);
yvars := seq(y[i], i = 1 .. n);
F := (x, y) -> [exp(x^3 *y) - 1, y^2 - 5*y*x];
seq(sum(diff(F(xvars)[i], xvars[j])*yvars[j], j = 1 .. n), i = 1 .. n);
and got 0,0. And diff(F(xvars)[1], xvars[1])
it finds correctly. Seems like Maple is differentiating with respect to xvars[j]
rather than xvars[1]
and xvars[2]
. Changing diff
on D
gives another but also incorrect answer.
How to do it in general?
I’d like to understand how to do it with many variables and nested sums.
Andrew is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.