I'm trying to draw an integral in spherical coordinates, but I'm a bit lost. I think my only problem is switching to Cartesian. Everything I saw about it went a bit over the head. Here is my code (sorry for formatting):

$$

vec {E} = sigma k int_0 ^ R int_0 ^ {2 pi} ( frac {(r sin theta cos phi-r & # 39; cos phi & # 39;) textbf {i} + (r sin theta sin phi-r & # 39; sin phi & # 39;) textbf {j} + (r cos theta) textbf {k}} {( r ^ 2 + r & # 39; ^ 2-2rr & # 39; cos phi cos phi & # 39; sin theta-2rr & # 39; sin theta sin phi sin phi & # 39;) ^ {3/2}}) r & # 39; d phi & # 39; dr & # 39;

$$

```
(ScriptR)((Phi)_, r_, (Theta)_, (Phi)1_,
r1_) := {r*Sin((Theta))*Cos((Phi)) - r1*Cos((Phi)1),
r*Sin((Theta))*Sin((Phi)) - r1*Sin((Phi)1), r*Cos((Theta))};
(ScriptR)Norm((Phi)_, r_, (Theta)_, (Phi)1_, r1_) :=
Sqrt((r*Sin((Theta))*Cos((Phi)) -
r1*Cos((Phi)1))^2 + (r*Sin((Theta))*Sin((Phi)) -
r1*Sin((Phi)1))^2 + (r*Cos((Theta)))^2) // Simplify;
ele((Phi)_?NumericQ, r_?NumericQ, (Theta)_?NumericQ) := (Sigma)*k*
NIntegrate(((ScriptR)((Phi), r, (Theta), (Phi)1,
r1)/(ScriptR)Norm((Phi), r, (Theta), (Phi)1, r1)^3)*
r1, {(Phi)1, 0, 2*(Pi)}, {r1, 0, R});
VectorPlot3D(
ele((Phi), r, (Theta)) /. {(Sigma) -> 200, k -> 9*10^9, R -> 0.5,
r*Sin((Theta))*Cos((Phi)) -> x, r*Sin((Theta))*Sin((Phi)) -> y,
r*Cos((Theta)) -> z}, {x, -1, 1}, {y, -1, 1}, {z, -1, 1})
```

I'm concerned that part of my problem is in the function I created, but I'm very sure that calling "Replace All" in this way is not a viable method for transforming coordinates.

Edit: Added integral that I am trying to solve. The (ScriptR) is the vector in the numerator, and the (ScriptR) norm is the cube root of the denominator