# Simplify differential expressions

One can differentiate a two dimensional vector like this,

ClearAll["Global*"]
u[x_, y_] := {f[x, y], g[x, y]}
Div[u[x, y], {x, y}]


with output

f^(1,0)(x,y)+g^(0,1)(x,y)


Now there is expression as follows

(Derivative[0, 3][g][x, y] + (Derivative[0, 1][g][x, y] + Derivative[1, 0][f][x, y]) + Derivative[1, 2][f][x, y] +
Derivative[2, 1][g][x, y] + Derivative[3, 0][f][x, y])


How to ask Mathematica to identify it as $$\nabla\cdot\mathbf{u} +\nabla^2\nabla\cdot\mathbf{u}$$

I have tried it as,

 Simplify[(Derivative[0, 3][g][x, y] + (Derivative[0, 1][g][x, y] + Derivative[1, 0][f][x, y]) + Derivative[1, 2][f][x, y] +
Derivative[2, 1][g][x, y] + Derivative[3, 0][f][x, y]) ,Assumptions->u[x,y]={f[x,y],g[x,y]}]


but it does not help.

• Please post code in input form. It cannot be pasted into Mathematica in its current form. You may find this meta Q&A helpful for doing so. Mar 20, 2019 at 10:46
• Let me remind you that in Mathematica x and y in your expressions should be placed in square brackets. Mar 20, 2019 at 10:52
• @MichaelE2, thanks for pointing that out. see the edit Mar 20, 2019 at 11:02

I think you're paddling upstream: I don't believe Mathematica has built-in functions to integrate multivariate derivatives back in terms of the del operator. If you know what you're looking for, then you can use the TransformationFunctions option of Simplify:

ClearAll[u];
uu = {f[x, y], g[x, y]};
Simplify[
Div[uu, {x, y}] + Laplacian[Div[uu, {x, y}], {x, y}],
TransformationFunctions -> {# /. (First@# ->
Inactive[Laplacian][Inactive[Div][u[x, y], {x, y}], {x, y}] -
Rest[#] &@Laplacian[Div[uu, {x, y}], {x, y}]) &,
# /. (First[#] -> Inactive[Div][u[x, y], {x, y}] - Rest[#] &@
Div[uu, {x, y}]) &}] We have to inactivate the operators, since otherwise they would evaluate back to what we started with.

I suppose one could make a long list of all the combinations of operators up to some sufficient depth of nesting for the functions that appear in the expression, since the transformation rules are easy to create. What is probably harder is writing general transformations that automatically figure out the components of the vector field u and which transformation rules are needed. Of course, maybe someone has an idea or this has been done before. It doesn't seem like a quick project.

u[x_, y_] := {f[x, y], g[x, y]}
` 