I am looking for a command that will calculate the Laplacian of a function defined on a line.

I have a definition of the line, $r(\theta)$

I want to calculate

$$\frac{1}{r}\frac{d}{dr}(r\frac{df}{dr}) + \frac{1}{r^2}\frac{d^2f}{d\theta^2}$$

When evaluating this derivative, it should change out r for theta to give a derivative which depends only on theta.

Laplacian[f[r, θ], {r, θ}, "Polar"] /. r -> 1 + Cos[2 θ] // Expand

This is what it prints out:

$$\frac{f^{(0,2)}(\cos (2 \theta )+1,\theta )}{(\cos (2 \theta )+1)^2}+\frac{f^{(1,0)}(\cos (2 \theta )+1,\theta )}{\cos (2 \theta )+1}+f^{(2,0)}(\cos (2 \theta )+1,\theta )$$

As you can see, the $f^{(2,0)}$ and $f^{(1,0)}$ are implicit derivatives of r, and the transformation using my equation of the line has not been carried out for differentiation.


closed as off-topic by Jens, m_goldberg, Feyre, Wjx, gwr Sep 2 '16 at 12:08

  • The question does not concern the technical computing software Mathematica by Wolfram Research. Please see the help center to find out about the topics that can be asked here.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Please don't type equations and outputs using $\TeX$. It is better to have a mathematica-format code that anyone can copy and paste right away. $\endgroup$ – JungHwan Min Sep 1 '16 at 23:09
  • $\begingroup$ The only input line I used was in mathematica syntax. I can't figure out how to get the output to copy and paste as a mathematica command. $\endgroup$ – Tony Ruth Sep 1 '16 at 23:16
  • $\begingroup$ You could type // InputForm at the end of your code and paste the output. $\endgroup$ – JungHwan Min Sep 1 '16 at 23:21
  • 3
    $\begingroup$ Your definition of the Laplacian is mathematically not properly adapted to the question you seem to be asking. On a line, r is a function of $\theta$ whereas your Laplacian treats $r,\theta$ as independent variables. Therefore, the issue seems to be not caused by Mathematica but by the maths being posed incorrectly. $\endgroup$ – Jens Sep 1 '16 at 23:42
  • 3
    $\begingroup$ I'm voting to close this question as off-topic because the issue it raises is not really a Mathematica issue but a matter of the OP not having grasped the mathematics involved. $\endgroup$ – m_goldberg Sep 2 '16 at 6:31