I want to calculate the value of $\nabla\cdot\frac{1}{(x^2+y^2+z^2)^{1.5}}(x\hat{x}+y\hat{y}+z\hat{z})$. I used the following syntax:
g[x_, y_, z_] = -x/(x^2 + y^2 + z^2)^1.5;
h[x_, y_, z_] = -y/(x^2 + y^2 + z^2)^1.5;
i[x_, y_, z_] = -z/(x^2 + y^2 + z^2)^1.5;
k[x_, y_, z_] = D[g[x, y, z], x] + D[h[x, y, z], y] + D[i[x, y, z], z]
it output
(3. x^2)/(x^2 + y^2 + z^2)^2.5 + (3. y^2)/(x^2 + y^2 + z^2)^2.5 + ( 3. z^2)/(x^2 + y^2 + z^2)^2.5 - 3/(x^2 + y^2 + z^2)^1.5
which is $\frac{3.\ x^2}{(x^2 + y^2 + z^2)^{2.5}} + \frac{3.\ y^2}{(x^2 + y^2 + z^2)^{2.5}} +\frac{3.\ z^2}{(x^2 + y^2 + z^2)^{2.5}} - \frac{3}{(x^2 + y^2 + z^2)^{1.5}}$.
I tried to simplify the expression with Simplify[%]
, but nothing changed.
I also tried to simplify the part before the -
, there is something I can't explain. When I input
Simplify[(3. x^2)/(x^2 + y^2 + z^2)^2.5 + (3. y^2)/(x^2 + y^2 + z^2)^2.5 + ( 3. z^2)/(x^2 + y^2 + z^2)^2.5]
it output
(3. x^2 + 3. y^2 + 3. z^2)/(x^2 + y^2 + z^2)^2.5
which is $\frac{3. x^2 + 3. y^2 + 3. z^2}{(x^2 + y^2 + z^2)^{2.5}}$, but when I input
Simplify[(3 x^2)/(x^2 + y^2 + z^2)^2.5 + (3 y^2)/(x^2 + y^2 + z^2)^2.5 + ( 3 z^2)/(x^2 + y^2 + z^2)^2.5]
by removing the .
after 3
, the output became
3/(x^2 + y^2 + z^2)^1.5
which is $\frac{3}{(x^2 + y^2 + z^2)^{1.5}}$, and it's what I want. However, if I add the subtracted part like
Simplify[(3 x^2)/(x^2 + y^2 + z^2)^2.5
+(3 y^2)/(x^2 + y^2 + z^2)^2.5
+ (3 z^2)/(x^2 + y^2 + z^2)^2.5
- 3/(x^2 + y^2 + z^2)^1.5]
the result became
3 (x^2/(x^2 + y^2 + z^2)^2.5 + y^2/(x^2 + y^2 + z^2)^2.5 + z^2/(x^2 + y^2 + z^2)^2.5 - 1/(x^2 + y^2 + z^2)^1.5)
which is $3 (\frac{x^2}{(x^2 + y^2 + z^2)^{2.5}} + \frac{y^2}{(x^2 + y^2 + z^2)^{2.5}} + \frac{z^2}{(x^2 + y^2 + z^2)^{2.5}} -\frac{1}{(x^2 + y^2 + z^2)^{1.5}})$.
So how to simplify this expression to the value of 0? Thanks and best regards!