7
$\begingroup$

How to define the following operator in Mathematica?

$$\hat{\nabla}^4=\left(\frac{\partial^2}{\partial\hat{r}^2}+\frac1{\hat{r}}\frac{\partial}{\partial\hat{r}}\right)^2$$

$\endgroup$
2
  • 1
    $\begingroup$ Is this what you mean? (Laplacian[u[r], {r,theta}, "Polar"])^2 $\endgroup$
    – Nasser
    Commented Mar 23, 2020 at 6:02
  • 4
    $\begingroup$ @Nasser I think it should be nested Laplacian rather than directive square. $\endgroup$ Commented Mar 23, 2020 at 6:24

2 Answers 2

13
$\begingroup$

It should be this:

lap = D[#, {r, 2}] + 1/r D[#, r] &;
lapsquared = lap @* lap;
lapsquared[f[r]] // Simplify

Or using Laplacian to define lap

lap = Laplacian[#, {r, θ}, "Polar"] &;
$\endgroup$
2
  • 1
    $\begingroup$ Wow, never knew of @* AKA Composition! $\endgroup$
    – Ruslan
    Commented Mar 23, 2020 at 18:37
  • 1
    $\begingroup$ @Ruslan It happens to be it :); also /* for RightComposition. $\endgroup$ Commented Mar 24, 2020 at 1:25
2
$\begingroup$

A simple answer:

operator[f_] := Nest[(D[#, {r, 2}] + 1/r D[#, r]) &, f, 2]
operator[f[r]]
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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