When constructing a general Lorentz boost using an $x$-axis boost, what is the second rotation in relation ro the first rotation? As is discussed in this question and this other question, it is possible to construct Lorentz boosts along an arbitrary direction using only the Lorentz boost along the $x$-axis by performing the following procedure:
(1) Rotate the coordinate axes to align the $x$-axis with the direction of the boost.
(2) Perform a boost along the new $x$-axis using the usual formula.
(3) Rotate back.
This is all well and good except for the last step. What does "Rotate back." actually mean? What is the relationship between the rest of the process and the last step?
In this first question linked above, the accepted answer asserts without justification that (at least in 2 spatial dimensions) the second rotation is merely the inverse of the first rotation. This seems intuitively plausible to me.
The second question linked above and its accepted answer suggest that the two rotations are in general - in 3 spatial dimensions - not inverses of one another. However, the linked answer does not explain what relationship exists between them.
Taking $B(v\hat n)$ to be a boost along the $\hat n$ direction of magnitude $v$ and $R(\theta \hat k)$ to be a rotation of angle $\theta$ around the axis given by $\hat k$ we may symbolize the problem as follows: $$B(v\hat n)=R(\theta(v,\hat n)\hat k(v,\hat n))B(v\hat x)R(\cos^{-1}(\hat x \cdot \hat n)\frac{\hat x \times \hat n}{|\hat x \times \hat n|})$$
So the question is: What is the functional form of $\theta(v,\hat n)\hat k(v,\hat n)$ which specifies the angle and axis of rotation for the second rotation?
 A: 
you can obtain the spatial Lorentz transformation by applying two rotations .
we want to "bring"  the x axes align to the x' axes, this can done by  two rotation , first rotate about the z axes with the angle $\varphi$ and then rotate about the new y axes with the angel $-\psi$. thus:
the transformation matrix about the z-axes is:
$$S_z=\left[ \begin {array}{cccc} 1&0&0&0\\  0&\cos
 \left( \varphi  \right) &-\sin \left( \varphi  \right) &0
\\ 0&\sin \left( \varphi  \right) &\cos \left( 
\varphi  \right) &0\\  0&0&0&1\end {array} \right] 
$$
and about the new y-axes is:
$$S_y=\left[ \begin {array}{cccc} 1&0&0&0\\ 0&\cos
 \left( \psi \right) &0&-\sin \left( \psi \right) 
\\ 0&0&1&0\\ 0&\sin \left( \psi
 \right) &0&\cos \left( \psi \right) \end {array} \right] 
$$
with :
$$\varphi=\arctan\left(\frac{v_y}{v_x}\right)$$
$$\psi=\arctan\left(\frac{v_x}{\sqrt{v_x^2+v_y^2}}\right)$$
and the boost vector $$\vec{v}=\begin{bmatrix}
             v_x \\
             v_y \\
             v_z \\
           \end{bmatrix}$$
you obtain the spatial Lorentz transformation :
$$L_D=S_z\,S_y\,L\,S_y^T\,S_z^T$$
with  the Lorentz transformation  $L$
$$L=\left[ \begin {array}{cccc} \gamma&\gamma\,v&0&0\\  
\gamma\,v&\gamma&0&0\\  0&0&1&0\\  0
&0&0&1\end {array} \right]
$$
$\Rightarrow$
$$L_D=\left[ \begin {array}{cccc} \gamma&\gamma\,v_{{x}}&\gamma\,v_{{y}}&
\gamma\,v_{{z}}\\ v_{{x}}{\gamma}^{2}&{\frac {\gamma
\,{v_{{x}}}^{2}+{v_{{y}}}^{2}+{v_{{z}}}^{2}}{{v}^{2}}}&{\frac {
 \left( \gamma-1 \right) v_{{y}}v_{{x}}}{{v}^{2}}}&{\frac {v_{{x}}v_{{
z}} \left( \gamma-1 \right) }{{v}^{2}}}\\ v_{{y}}{
\gamma}^{2}&{\frac { \left( \gamma-1 \right) v_{{y}}v_{{x}}}{{v}^{2}}}
&{\frac {{v_{{x}}}^{2}+{v_{{y}}}^{2}\gamma+{v_{{z}}}^{2}}{{v}^{2}}}&{
\frac {v_{{y}}v_{{z}} \left( \gamma-1 \right) }{{v}^{2}}}
\\ v_{{z}}{\gamma}^{2}&{\frac {v_{{x}}v_{{z}}
 \left( \gamma-1 \right) }{{v}^{2}}}&{\frac {v_{{y}}v_{{z}} \left( 
\gamma-1 \right) }{{v}^{2}}}&{\frac {{v_{{z}}}^{2}\gamma+{v_{{x}}}^{2}
+{v_{{y}}}^{2}}{{v}^{2}}}\end {array} \right] 
=\begin{bmatrix}
   \gamma & \gamma\,\vec{v} \\
   \gamma\,\vec{v} & I_3+\frac{\gamma-1}{v^2}\vec{v}\,\vec{v}^T \\
 \end{bmatrix}$$
and the inverse Lorentz transformation is :
$$L_D^{-1}=L_D(\vec{v}\mapsto -\vec{v})=\begin{bmatrix}
   \gamma & -\gamma\,\vec{v} \\
   -\gamma\,\vec{v} & I_3+\frac{\gamma-1}{v^2}\vec{v}\,\vec{v}^T \\
 \end{bmatrix}$$
where $I_3$ is a $3\times 3$ unity matrix.
edit
What does "Rotate back." actually mean?
example:
the components of angular momentum vector in inertial system  are:
$$\left(\vec{L}\right)_I=\left[_B^I\,S\right]\,
\left(I\right)_B\,
\left(\vec{\omega}\right)_B\tag 1$$
where  B is the Body-Frame index and I is the Inertial-Frame index . $\left[_B^I\,S\right]$ is the transformation matrix between Body-Frame and Inertial-Frame. $\left(I\right)_B$ is the $3\times 3$ inertial tensor in Body-Frame.
now if the angular vector components are given in Inertial-Frame thus:
$$\left(\vec{\omega}\right)_B=\left[_I^B\,S\right]
\left(\vec{\omega}\right)_I$$
and equation (1) :
$$\left(\vec{L}\right)_I=\left[_B^I\,S\right]\,\left(I\right)_B\,
\left[_I^B\,S\right]
\left(\vec{\omega}\right)_I=S\,\left(I\right)_B\,S^T\,\left(\vec{\omega}\right)_I$$
The "components" of the  inertia tensor  are transformed by $$\left(I\right)_I=S\,\left(I\right)_B\,S^T$$
the same is  true for each matrix transformation like Lorentz matrix.
A: The solution is a lot simpler than it seems. The result from the first link that you provide is true even in general, and the suggestion in the second link that the rotations are unrelated is incorrect. In general, the relationship between the two rotations in $\Lambda=R_2\Lambda_xR_1$ is that $R_1$ and $R_2$ are inverses (which is to say, transposes) of one another.
Now, let's justify that answer.
All of the operations that we encounter in this problem are finite-dimensional (i.e. 4-dimensional) and linear, which means that they can be represented as $4\times4$ matrices. Generally, there are two interpretations that can be given to a non-singular square matrix: (1) it is a change of basis from one coordinate system to another, or (2) it is a linear transformation which maps vectors in a linear vector space to other vectors in that same space. In this problem, we are obviously interpreting the rotations as changes of basis and the boost as a linear transformation.
Given two bases $A$ and $B$ for some linear vector space and a linear transformation $T$ on that space, it is well known that $T$'s representations in the two different bases are related by $T_B=U_{A\to B}T_AU_{B\to A}$ (where $U_{A\to B}$ is the change of basis matrix from $A$ to $B$). It is clear that by definition $U_{A\to B}=(U_{B\to A})^{-1}$. For any rotation matrix $R$, $R^{-1}=R^T$; therefore, it is now obvious that a Lorentz boost along any arbitrary axis can be given by $R^T\Lambda_xR$
This answers the question as posed, but for the sake of concreteness, let's derive the general result for an arbitrary Lorentz boost using this method.
First, we will use the formula provided in this Math StackExchange answer to calculate the form of the rotation matrices.
Since we want to rotate the unit vector $\hat n = <n_x,n_y,n_z>$ into the unit vector $\hat x=<1,0,0>$, we get $\hat n \cdot \hat x = \cos(\theta)= n_x$ and $\hat n \times \hat x=<0,n_z,-n_y>$. This gives
$$
[v]_\times=\left[ \begin {array}{ccc} 0&n_y&n_z\\  
-n_y&0&0\\  -n_z&0&0\end {array} \right] 
$$
Therefore, from the Math StackExchange answer, we get
$$R = I + [v]_{\times} + [v]_{\times}^2\frac{1}{1+\cos(\theta)}$$
and we derive that the $4\times4$ rotation matrix is
$$
R(\hat n,\hat x) = \left[ \begin{array}{cccc}
1&0&0&0\\
0&n_x&n_y&n_z\\
0&-n_y&1-\frac{n_y^2}{1+n_x}&-\frac{n_y n_z}{1+n_x}\\
0&-n_z&-\frac{n_y n_z}{1+n_x}&1-\frac{n_z^2}{1+n_x}\\
\end{array}\right]
$$
As a note, $R^T(\hat n,\hat x)=R(\hat x, \hat n)$ as expected.
The matrix for the $x$-axis Lorentz boost is
$$
\Lambda(\beta\hat x) = \left[\begin{array}{cccc}
\gamma&-\gamma\beta&0&0\\
-\gamma\beta&\gamma&0&0\\
0&0&1&0\\
0&0&0&1\\
\end{array}\right]
$$
This leads to the final calculation of the matrix product
$$
\Lambda(\beta\hat n)=R^T(\hat n,\hat x)\Lambda(\beta\hat x)R(\hat n,\hat x)\\
$$
After some tedious algebra, the final result is
$$
\Lambda(\beta\hat n) = \left[\begin{array}{cccc}
\gamma&-\gamma\beta n_x&-\gamma\beta n_y&-\gamma\beta n_z\\
-\gamma\beta n_x&1+(\gamma - 1) n_x^2&(\gamma - 1)n_xn_y&(\gamma - 1)n_xn_z\\
-\gamma\beta n_y&(\gamma - 1)n_xn_y&1+(\gamma - 1) n_y^2&(\gamma - 1)n_yn_z\\
-\gamma\beta n_z&(\gamma - 1)n_xn_z&(\gamma - 1)n_yn_z&1+(\gamma - 1) n_z^2\\
\end{array}\right]
$$
which is (modulo notation) this boost matrix, which is the standard result cited in e.g. Jackson.
