3 added 9 characters in body
source | link

Let $\mathbf{R} = [x,y,z]$ be a cartesian vector, $R_\alpha$ it's tensor representation with $\alpha = x,y,z$ and let $R=\sqrt{x^2 + y^2 + z^2}$ be its norm. I want to do tensor derivatives of the Coulomb potential $1/R$. The first derivative is $\frac{\partial}{\partial R_\alpha} \frac{1}{R} = -\frac{R_\alpha}{R^3}$ and the second derivative is $\frac{\partial}{\partial R_\beta} \frac{\partial}{\partial R_\alpha} \frac{1}{R}= \frac{\delta_{\alpha\beta}R^2 - R_\alpha R_\beta }{R^5}$. I want to make further derivatives in Mathematica.

I tried

R = Sqrt[x^2 + y^2 + z^2]

$\sqrt{x^2 + y^2 + z^2}$

rR = 1/R

$\frac{1}{\sqrt{x^2 + y^2 + z^2}}$

drR = Grad[rR, {x, y, z}, "Cartesian"]

$\{-\frac{x}{(x^2 + y^2 + z^2)^{3/2}}, -\frac{y}{(x^2 + y^2 + z^2)^{3/2}}, -\frac{z}{(x^2 + y^2 + z^2)^{3/2}} \}$

So can I make Mathematica identify the denominators as $R^3$ and the numerators as $R_\alpha$ and get it to the compact form $-\frac{R_\alpha}{R^3}$, or is there some other way to do tensor arithmeticscalculus/arithmetics compactly?

Let $\mathbf{R} = [x,y,z]$ be a cartesian vector, $R_\alpha$ it's tensor representation with $\alpha = x,y,z$ and let $R=\sqrt{x^2 + y^2 + z^2}$ be its norm. I want to do tensor derivatives of the Coulomb potential $1/R$. The first derivative is $\frac{\partial}{\partial R_\alpha} \frac{1}{R} = -\frac{R_\alpha}{R^3}$ and the second derivative is $\frac{\partial}{\partial R_\beta} \frac{\partial}{\partial R_\alpha} \frac{1}{R}= \frac{\delta_{\alpha\beta}R^2 - R_\alpha R_\beta }{R^5}$. I want to make further derivatives in Mathematica.

I tried

R = Sqrt[x^2 + y^2 + z^2]

$\sqrt{x^2 + y^2 + z^2}$

rR = 1/R

$\frac{1}{\sqrt{x^2 + y^2 + z^2}}$

drR = Grad[rR, {x, y, z}, "Cartesian"]

$\{-\frac{x}{(x^2 + y^2 + z^2)^{3/2}}, -\frac{y}{(x^2 + y^2 + z^2)^{3/2}}, -\frac{z}{(x^2 + y^2 + z^2)^{3/2}} \}$

So can I make Mathematica identify the denominators as $R^3$ and the numerators as $R_\alpha$ and get it to the compact form $-\frac{R_\alpha}{R^3}$, or is there some other way to do tensor arithmetics compactly?

Let $\mathbf{R} = [x,y,z]$ be a cartesian vector, $R_\alpha$ it's tensor representation with $\alpha = x,y,z$ and let $R=\sqrt{x^2 + y^2 + z^2}$ be its norm. I want to do tensor derivatives of the Coulomb potential $1/R$. The first derivative is $\frac{\partial}{\partial R_\alpha} \frac{1}{R} = -\frac{R_\alpha}{R^3}$ and the second derivative is $\frac{\partial}{\partial R_\beta} \frac{\partial}{\partial R_\alpha} \frac{1}{R}= \frac{\delta_{\alpha\beta}R^2 - R_\alpha R_\beta }{R^5}$. I want to make further derivatives in Mathematica.

I tried

R = Sqrt[x^2 + y^2 + z^2]

$\sqrt{x^2 + y^2 + z^2}$

rR = 1/R

$\frac{1}{\sqrt{x^2 + y^2 + z^2}}$

drR = Grad[rR, {x, y, z}, "Cartesian"]

$\{-\frac{x}{(x^2 + y^2 + z^2)^{3/2}}, -\frac{y}{(x^2 + y^2 + z^2)^{3/2}}, -\frac{z}{(x^2 + y^2 + z^2)^{3/2}} \}$

So can I make Mathematica identify the denominators as $R^3$ and the numerators as $R_\alpha$ and get it to the compact form $-\frac{R_\alpha}{R^3}$, or is there some other way to do tensor calculus/arithmetics compactly?

2 edited tags
| link
1
source | link

Cartesian tensor gradient

Let $\mathbf{R} = [x,y,z]$ be a cartesian vector, $R_\alpha$ it's tensor representation with $\alpha = x,y,z$ and let $R=\sqrt{x^2 + y^2 + z^2}$ be its norm. I want to do tensor derivatives of the Coulomb potential $1/R$. The first derivative is $\frac{\partial}{\partial R_\alpha} \frac{1}{R} = -\frac{R_\alpha}{R^3}$ and the second derivative is $\frac{\partial}{\partial R_\beta} \frac{\partial}{\partial R_\alpha} \frac{1}{R}= \frac{\delta_{\alpha\beta}R^2 - R_\alpha R_\beta }{R^5}$. I want to make further derivatives in Mathematica.

I tried

R = Sqrt[x^2 + y^2 + z^2]

$\sqrt{x^2 + y^2 + z^2}$

rR = 1/R

$\frac{1}{\sqrt{x^2 + y^2 + z^2}}$

drR = Grad[rR, {x, y, z}, "Cartesian"]

$\{-\frac{x}{(x^2 + y^2 + z^2)^{3/2}}, -\frac{y}{(x^2 + y^2 + z^2)^{3/2}}, -\frac{z}{(x^2 + y^2 + z^2)^{3/2}} \}$

So can I make Mathematica identify the denominators as $R^3$ and the numerators as $R_\alpha$ and get it to the compact form $-\frac{R_\alpha}{R^3}$, or is there some other way to do tensor arithmetics compactly?