# Inverse of a Matrix of Functions

## Homework Statement

Express in unit vectors $$\hat{r}$$, $$\hat{\theta}$$, $$\hat{\phi}$$ in terms of $$\hat{x}$$, $$\hat{y}$$, $$\hat{z}$$ (that is derive the relevant equations). ... Also work out the inverse forulas giving $$\hat{x}$$, $$\hat{y}$$, $$\hat{z}$$ in terms of $$\hat{r}$$, $$\hat{\theta}$$, $$\hat{\phi}$$ (and $$\theta$$, $$\phi$$).

## Homework Equations

$$\hat{r} = sin \theta cos \phi \hat{x} +sin \theta sin \phi \hat{y} +cos \theta \hat{z}$$
$$\hat{\theta} = cos \theta cos \phi \hat{x} +cos \theta sin \phi \hat{y} -sin \theta \hat{z}$$
$$\hat{\phi} = -sin \phi \hat{x} +cos \phi \hat{y}$$

## The Attempt at a Solution

That looked like a linear system to me so I put the spherical coordinate unit vectors in a 3x1 matrix, the trig in a 3x3 matrix, and the Cartesian in a 3x1 matrix. Called the 3x3 [A] and took its inverse.
The method I used to arrive with the inverse is [A]-1=$$\frac{adj A}{det A}$$=$$\frac{adj A}{|[A]|}$$. The determinate of A is $$sin^{2}\theta sin^{2}\phi + cos^{2}\theta cos^{2}\phi + cos^{2}\theta sin^{2}\phi + sin^{2}\theta cos^{2}\phi = 1$$
The solution I came up with is:
$$\hat{x} = sin \theta cos \phi \hat{r} -sin \theta sin \phi \hat{\theta} +cos \theta \hat{\phi}$$
$$\hat{y} = -cos \theta cos \phi \hat{r} +cos \theta sin \phi \hat{\theta} +sin \theta \hat{\phi}$$
$$\hat{z} = -sin \phi \hat{r} +cos \phi \hat{\theta}$$
The problem I'm having is that [A][A]-1$$\neq$$the identity matrix. Some of the symptoms are $$\frac{d}{d\theta}$$|[A][A]-1|=0, $$\frac{d}{d\phi}$$|[A][A]-1|$$\neq$$0, |A-1|=1, $$\frac{d}{d\theta}$$|[A]|=0, and $$\frac{d}{d\phi}$$|[A]|$$\neq$$0.
Either this operation is not allowed, not defined in this manner, or I screwed up. If you happen to know which and in what manner please say so. I have not done the first part yet figuring I would take care of what looked to be the easy part first. That may help in this second part. If you happen to have pointers on how to proceed in the first part, please say so. I'm going to go poking through my notes now to see what might work there.

Related Advanced Physics Homework Help News on Phys.org
gabbagabbahey
Homework Helper
Gold Member

$$A=\begin{pmatrix}A_{11} & A_{12} & A_{13}\\ A_{21} & A_{22} & A_{23} \\A_{31} & A_{32} & A_{33}\end{pmatrix}\implies A^{\dagger}=\begin{pmatrix}A_{11}^* & A_{21}^* & A_{31}^*\\ A_{12}^* & A_{22}^* & A_{32}^* \\A_{13}^* & A_{23}^* & A_{33}^*\end{pmatrix}$$

Last edited:
After redoing the adj A, I came up with:
$$\hat{x} = sin \theta cos \phi \hat{r} -sin \theta sin \phi \hat{\theta} +cos \theta \hat{\phi}$$
$$\hat{y} = -cos \theta cos \phi \hat{r} +cos \theta sin \phi \hat{\theta} +sin \theta \hat{\phi}$$
$$\hat{z} = -sin \phi \hat{r} -cos \phi \hat{\theta}$$
I also realized that as [A]['B]$$\neq$$['B][A]. I would save some headache with [A]-1[A] instead. This is closer as |[A]-1[A]|=1. But [A]-1[A]$$\neq$$['I].

Is there any to keep the server from messing with the letter case besides inserting the most discrete character you can find?

gabbagabbahey
Homework Helper
Gold Member
After redoing the adj A, I came up with:
$$\hat{x} = sin \theta cos \phi \hat{r} -sin \theta sin \phi \hat{\theta} +cos \theta \hat{\phi}$$
$$\hat{y} = -cos \theta cos \phi \hat{r} +cos \theta sin \phi \hat{\theta} +sin \theta \hat{\phi}$$
$$\hat{z} = -sin \phi \hat{r} -cos \phi \hat{\theta}$$
No, this is still incorrect.

Your matrix $A$ is

$$A=\begin{pmatrix}\sin\theta\cos\phi & \sin\theta\sin\phi & \cos\theta \\ \cos\theta\cos\phi & \cos\theta\sin\phi & -\sin\theta \\-\sin\phi & \cos\phi & 0\end{pmatrix}$$

right?

Is there any to keep the server from messing with the letter case besides inserting the most discrete character you can find?
Sorry, not my area of expertise.

I don't see how that is incorrect. Yes that is my A. I did the adj A again and came up with the same thing. If I replace the position with letters except for zero I come up with: $$A=\begin{pmatrix}A & B & C \\ D & E & F \\ G & H & 0\end{pmatrix}$$
The adj A is $$adj A=\begin{pmatrix}-HF & -GF & DH-GE \\ -HC & -GC & AH-GB \\ BF-EC & AF-DC & AE-DB\end{pmatrix}$$
Filling in the functions in to the letters I come up with: $$adj A=\begin{pmatrix}(-1)^{2}\sin\theta\cos\phi & (-1)^{3}\sin\theta\cos\phi & \cos\theta\cos^{2}\phi--\cos\theta\sin^{2}\phi \\ -\cos\theta\cos\phi & (-1)^{2}\cos\theta\sin\phi & \sin\theta\cos^{2}\phi--\sin\theta\sin^{2}\phi \\ -\sin^{2}\theta\sin\phi-\cos^{2}\theta\sin\phi & -\sin^{2}\theta\cos\phi-\cos^{2}\theta\cos\phi & \sin\theta\cos\phi\cos\theta\sin\phi-\cos\theta\cos\phi\sin\theta\sin\phi \end{pmatrix}$$

That mess simplifies by the cos/sin Pythagorean Identity and distributive property of multiplication to the second solution I came up with.

gabbagabbahey
Homework Helper
Gold Member
I don't see how that is incorrect. Yes that is my A. I did the adj A again and came up with the same thing. If I replace the position with letters except for zero I come up with: $$A=\begin{pmatrix}A & B & C \\ D & E & F \\ G & H & 0\end{pmatrix}$$
The adj A is $$adj A=\begin{pmatrix}-HF & -GF & DH-GE \\ -HC & -GC & AH-GB \\ BF-EC & AF-DC & AE-DB\end{pmatrix}$$
Not quite, the adjugate matrix is the transpose of the matrix of cofactors. You also have a couple of negative sign errors. Remember, $C_{ij}=(-1)^{i+j}M_{ij}$ where $M_{ij}$ is the {i,j} minor of $A$. What you've actually calculated is a matrix of the minors of $A$.

$$\text{adj}(A)=\begin{pmatrix}-HF & +GF & DH-GE \\ HC & -GC & -AH+GB \\ BF-EC & -AF+DC & AE-DB\end{pmatrix}^T$$

gabbagabbahey
Homework Helper
Gold Member
You could also save yourself from calculating a cofactor matrix at all by recognizing that both coordinate bases are orthogonal, and hence $A$ must be an orthogonal matrix, so that $A^{-1}=A^T$

Paying attention to what the book says helps. That was staring me in the face just a little above the definition of the adjoint.
The transpose works better, more foolproof. I didn't like that transpose method myself because the proper inverse should work and because I had know idea as to why it worked. As I recall, it felt like it appeared out the blue and I said, "What is this?" and dropped it.

Last edited: