# execute a summation involving a differential operator

Below is an operator

$$\hat{D}=\sum_{i,j}^2 \frac{\partial}{\partial u^i}\sqrt{g}g^{ij}\frac{\partial}{\partial u^j}$$

where $$g_{ij}=\begin{pmatrix}p(x,y) & q(x,y)\\\ q(x,y) & r(x,y)\end{pmatrix}$$ and $$u^1,u^2$$ are respectively $$x$$ and $$y$$.

In mathematica, how do I make it act on a function $$F(x,y)$$? Im having trouble understanding how to do the summation part. The functions $$p,q,\& \, r$$ will all be specified but $$F$$ is to remain arbitrary. What I actually then want to get is an equation

$$\hat{D}F(x,y)=0$$

This is easy to work out by hand if $$i,j$$ only run from 1 to 2, but I want to learn if there is a way to make it work in Mathematica if I replace 2 with 3 or more.

Old

Do you mean something like this? (I did not know what you meant with the root of the matrix $$g$$, so I left it out)

g[x_, y_] := {{p[x, y], q[x, y]}, {q[x, y], r[x, y]}};
op[u1_, u2_] = (
D[g[u1, u2][[1, 1]]*D[#, {u1, 1}], {u1, 1}]
+ D[g[u1, u2][[1, 2]]*D[#, {u2, 1}], {u1, 1}]
+ D[g[u1, u2][[2, 1]]*D[#, {u1, 1}], {u2, 1}]
+ D[g[u1, u2][[2, 2]]*D[#, {u2, 1}], {u2, 1}]
) &


Application on function

op[x, y][F[x, y]]


Update: Summation

op2[u_] = Sum[
D[(g @@ u)[[i1, i2]]*D[#, {u[[i2]], 1}], {u[[i1]], 1}]
, {i1, Length@u}
, {i2, Length@u}
] &

op2[{x, y}][F[x, y]] == op[x, y][F[x, y]]


True

• g was actually just the determinant of the matrix g_{ij}. Is there a way to write op[u1_,u2_] without explicitly writing code for all the terms?
– jboy
Sep 20, 2020 at 8:11
• See update at the bottom Sep 20, 2020 at 8:19