如何在Mathematica中创建和区分元组值函数。
更具体地说,我有以下函数,其中R
表示实线
f:R^2 -> R^3
g:R^3 -> R^3
h: R^3 -> R^1
我想考虑这些函数的组成k:R ^ 2 - > R ^ 1即k = h(g(f(x,y)))我想找到导数k_x,k_y,k_xx,k_yy,k_xy
我怎样才能在Mathematica中这样做?
答案 0 :(得分:1)
我假设你没有f,g,h的表达式,但是你想要用f,g,h的导数来表示组合的导数。
通过使用f[x_,y_] := {f1[x,y],f2[x,y],f3[x,y]}
例如:
f[x_, y_] := Through[{f1, f2, f3}[{x, y}]]
g[x_, y_, z_] := Through[{g1, g2, g3}[{x, y, z}]]
D[h @@ g @@ f[x, y], x]
结果:
(Derivative[{1, 0}][f3][{x, y}]*Derivative[{0, 0, 1}][g3][{f1[{x, y}], f2[{x, y}], f3[{x, y}]}] +
Derivative[{1, 0}][f2][{x, y}]*Derivative[{0, 1, 0}][g3][{f1[{x, y}], f2[{x, y}], f3[{x, y}]}] +
Derivative[{1, 0}][f1][{x, y}]*Derivative[{1, 0, 0}][g3][{f1[{x, y}], f2[{x, y}], f3[{x, y}]}])*
Derivative[0, 0, 1][h][g1[{f1[{x, y}], f2[{x, y}], f3[{x, y}]}], g2[{f1[{x, y}], f2[{x, y}], f3[{x, y}]}],
g3[{f1[{x, y}], f2[{x, y}], f3[{x, y}]}]] +
(Derivative[{1, 0}][f3][{x, y}]*Derivative[{0, 0, 1}][g2][{f1[{x, y}], f2[{x, y}], f3[{x, y}]}] +
Derivative[{1, 0}][f2][{x, y}]*Derivative[{0, 1, 0}][g2][{f1[{x, y}], f2[{x, y}], f3[{x, y}]}] +
Derivative[{1, 0}][f1][{x, y}]*Derivative[{1, 0, 0}][g2][{f1[{x, y}], f2[{x, y}], f3[{x, y}]}])*
Derivative[0, 1, 0][h][g1[{f1[{x, y}], f2[{x, y}], f3[{x, y}]}], g2[{f1[{x, y}], f2[{x, y}], f3[{x, y}]}],
g3[{f1[{x, y}], f2[{x, y}], f3[{x, y}]}]] +
(Derivative[{1, 0}][f3][{x, y}]*Derivative[{0, 0, 1}][g1][{f1[{x, y}], f2[{x, y}], f3[{x, y}]}] +
Derivative[{1, 0}][f2][{x, y}]*Derivative[{0, 1, 0}][g1][{f1[{x, y}], f2[{x, y}], f3[{x, y}]}] +
Derivative[{1, 0}][f1][{x, y}]*Derivative[{1, 0, 0}][g1][{f1[{x, y}], f2[{x, y}], f3[{x, y}]}])*
Derivative[1, 0, 0][h][g1[{f1[{x, y}], f2[{x, y}], f3[{x, y}]}], g2[{f1[{x, y}], f2[{x, y}], f3[{x, y}]}],
g3[{f1[{x, y}], f2[{x, y}], f3[{x, y}]}]]