Rotate vector in spherical coordinates

I have two arbitrary vectors $\vec{x}$ and $\vec{x}'$ given in spherical coordinates $(|\vec{x}|=x,\theta,\phi)$ (as convention I take the "physics notation" given on Wikipedia http://en.wikipedia.org/wiki/Spherical_coordinate_system). I now want to rotate the coordinate system so that it's $z$-direction points along $\vec{x}$. That means, $\vec{x}$ would have the values $(0, 0, x)$. I now need to compute the angles of $\vec{x}'$. The absolute value does not change, but the angles do. I need to figure out how the angles are in the new coordinate system. With the help of rotation matrices, one is able to get:

$\vec{x}' = x' (\sin(\theta')\cos(\phi'-\phi)\cos(\theta)-\sin(\theta)\cos(\theta'),\sin(\theta')\sin(\phi'-\phi),\sin(\theta')\cos(\phi'-\phi)\sin(\theta)+\cos(\theta)\cos(\theta')) \equiv x' (\sin(\alpha')\cos(\beta'),\sin(\alpha')\sin(\beta'),\cos(\beta'))$

Now $\alpha', \beta'$ are the angles in the normal sense but in the new coordinate system. I need a converting rule $\theta', \phi' \to \alpha', \beta'$. Anyone a hint?

Edit (some further explanations): I need this to compute an integral of the form $\int \mathrm{d}^3x' g(\theta',\phi')f(|\vec{x}-\vec{x}'|)$ and I converted $\mathrm{d}^3x'=x'^2\mathrm{d}x\mathrm{d}\phi' \sin(\theta')\mathrm{d}\theta'$ to spherical coordinates. The problem is that $|\vec{x}-\vec{x}'|=x^2+x'^2-2xx'[\sin(\theta')\cos(\phi'-\phi)\sin(\theta)+\cos(\theta)\cos(\theta')]$ contains angles of both vectors and I need to get rid of the unprimed angles (which is possible in transforming the coordinate system under the integral to point with it's z-direcion along $\vec{x}$).

-

1
are you sure your transformation is right? One check I did was plug in $\theta' = \theta$, $\phi' = \phi$, $x' = x$, i.e. see how $\vec{x}$ itself is described in this new coordinate system in which $\vec{x}$ is in the z-direction. The answer should be $x(0,0,1)$. But I get $x(\sin(2\theta),0,1)$. – nervxxx Jan 17 at 21:49
Correct, I made two typos. Corrected it and then it fits. – DaPhil Jan 18 at 8:25
I think this should be migrated to math, it is not really a physics problem. – daaxix Jan 18 at 20:16

1
@daaxix, but it is a very frequent problen one finds in physics. I think it is best placed here. In math.se they are usually interested in questions of a more abstract nature. – Eduardo Guerras Valera Jan 18 at 20:49
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 22, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9347748756408691, "perplexity_flag": "head"}