1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – Michael E2 Mar 20 at 10:46
  • $\begingroup$ Let me remind you that in Mathematica x and y in your expressions should be placed in square brackets. $\endgroup$ – Alexei Boulbitch Mar 20 at 10:52
  • $\begingroup$ @MichaelE2, thanks for pointing that out. see the edit $\endgroup$ – alekhine Mar 20 at 11:02
2
$\begingroup$

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}]) &}]

Mathematica graphics

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.

$\endgroup$
1
$\begingroup$

Will this help you:

u[x_, y_] := {f[x, y], g[x, y]}
Inactivate[Grad[Inactivate[Div[u[x, y], {x, y}], Div], {x, y}], Grad]

enter image description here

??

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.