I understand that textbook questions are to be avoided here but I would like to request help from this forum. This a question in mechanics which involves what should be a fairly straightforward conversion between Cartesian and polar co-ordinate systems. But this question has left me and my classmates stumped because the answer obtained from conversion is nowhere near the required solution. Here is the question:
Show that the equations $$E_r = \frac{p}{2\pi\epsilon_0r^3}\cos\theta \qquad E_\theta=\frac{p}{4\pi\epsilon_0r^3}\sin\theta$$ follow from $$E_x=\frac{3p\sin\theta\cos\theta}{4\pi\epsilon_0r^3}\qquad E_z= \frac{p(3\cos^2\theta-1)}{4\pi\epsilon_0r^3}$$
$E_x$, $E_z$, $E_r$, $E_\theta$ represent the electric field vector along the $x$-axis, $z$-axis, $r$-component and $\theta$-component. So, my question is whether this proof is possible or is there a minor error which when corrected gives the required answer?
Edit: Here's my attempt at the proof:
Assumptions:
(a) $$E_r = \sqrt {E_x^2+E_z^2}$$
(b) $$E_\theta = \tan^{-1} (E_z/ E_x)$$
(c) $$k = \frac{p}{4\pi\epsilon_0r^3}$$
Then we obtain,
$$E_r = 2k\cos\theta$$ $$E_\theta = k\sin\theta$$ $$E_x = 3k\sin\theta\cos\theta$$ $$E_z = k(3\cos^2\theta -1)$$
Plugging these values into (a) and simplifying, I obtained: $$E_r = k\sqrt {3\cos^2\theta +1}$$ after which I was stuck.
Plugging the values into (b) and simplifying, I obtained: $$E_\theta = \tan^{-1} \frac {3\cos^2\theta-1}{3\sin\theta\cos\theta}$$
I attempted to simplify this by separating one $cos^2\theta$ terma so I could have two cosine terms in my numerator: $$E_\theta = \tan^{-1} \frac {\cos^2\theta+\cos2\theta}{3\sin\theta\cos\theta}$$ I separated them and multiplied the second term by $\frac 22$ so I could convert both of them into tangent terms: $$E_\theta = \tan^{-1} \frac {\cos^2\theta}{3\sin\theta\cos\theta}+ \frac {\cos2\theta}{3\sin\theta\cos\theta}*\frac 22$$ $$E_\theta = \tan^{-1} \frac {1}{3\tan\theta}+ \frac {1}{3\tan2\theta}$$ All attempts after this were in vain.
Probably either the problem is wrongly stated or wrong understood. In any case the statement is ambiguous as the vector components in an allegedly Cartesian coordinate system are given using polar coordinates $(r,\theta)$.
Recognizing that the transformed value is a vector the transformation can be obtained using: $$ \begin{pmatrix} E_r\\ E_\theta \end{pmatrix}= \begin{pmatrix} \cos\theta&\sin\theta\\ -\sin\theta&\cos\theta \end{pmatrix} \begin{pmatrix} E_x\\ E_z \end{pmatrix}=-\frac{1}{4\pi\epsilon_0r^3} \begin{pmatrix} 2\sin\theta\\ \cos\theta \end{pmatrix}. $$
Compared to the required result we have obtained the opposite sign and interchanged trigonometric functions. Still, I would not claim that the result is "nowhere near" the required solution. One can even enforce the desired solution by the convention that the angle $\theta$ is measured in clockwise direction from the $z$-axis. And it is very probable that exactly this convention was (probably unintentionally) used by the authors of the exercise as the example obviously originates from the dipole field presented in cylindrical coordinate system with dipole moment directed along $z$-axis.