I am trying to obtain the Jacobian matrix for a change of variables from Cartesian coordinate to spherical coordinates. My spherical coordinate system is a conventional right-handed Geographic Coordinate System such that the $\phi$ parameter represents latitude. I have found documentation, including this Wikipedia page [https://en.wikipedia.org/wiki/List_of_common_coordinate_transformations#From_Cartesian_coordinates ], for change of variable to spherical coordinate system that includes a parameter for colatitude. Unfortunately that is not what I require.
Here are the expressions relating Cartesian to spherical coordinates: $$ \mathrm {longitude:} \; \lambda \,=\, \arctan \left( \frac{y}{x} \right) \\ \mathrm {latitude:} \;\phi \,=\, \arcsin \left( z \rho^{-1} \right) \\ \mathrm {radius:} \;\rho \, = \, \sqrt{x^2+y^2+z^2} $$ I am struggling to obtain the partial derivatives of $\phi$. Here is what I have derived: $$ \frac {\partial \phi} {\partial y} \, = \, \frac{1}{\sqrt{1-z^2 \rho^{-1}}} \,*\, \frac{z}{2 \rho^{3 \over 2}} \,*\, \frac{1}{2\rho^3} \,*\, 2y \\ \frac {\partial \phi}{\partial y} \, = \, \frac{-yz}{2 \rho^{\frac{9}{2}} \sqrt{1-\frac{z^2}{\rho}}} $$ That is a horrible looking expression and I am not confident that it is correct. Can anybody please verify the accuracy of this partial derivative? It would be even better if somebody could show (a link to) the full Jacobian matrix for this conversion.
This coordinate transformation is just the “standard” cartesian to spherical transformation, but with the sine and cosine of the latitude replacing the cosine and sine of the colatitude, respectively. I.e., the roles of $z$ and $\sqrt{x^2+y^2}$ are reversed.
It’s probably easier to compute the partial derivatives starting from the equivalent $\phi=\arctan\left({z\over\sqrt{x^2+y^2}}\right)$. You could grind through the calculations directly, but since $\arctan(1/f(t))'=-\arctan(f(t))'$, you can immediately see that the partial derivatives of the latitude are just the negations of the elements in the second row of the Jacobian matrix found here in Wikipedia. This makes some intuitive sense since latitude and colatitude increase in opposite directions.