Consider the setup in the figure below.
There are three different coordinate frames: A, B, and C. Frame A can be thought of as the "global" frame, which means that the location and orientation of frames B and C are expressed relative to frame A. That is, frame B is translated by the green vector and rotated counterclockwise by $\theta_B$ radians with respect to frame A. Similarly, frame C is translated by the orange vector and rotated counterclockwise by $\theta_C$ radians with respect to frame A ($\theta_C$ can be greater than or less than $\theta_B$; my drawing is only an illustration). I am given the blue vector, which corresponds to the coordinates of the vector $x$ with respect to frame B, as well as the green and orange vectors. My objective is to determine the coordinates of the vector $x$ with respect to frame C (that is, to determine the red vector).
Here is what I tried so far: the vector $x$ has three different coordinate vectors associated with it: one for frame A, which is $v_A$ (not drawn above and not given), one for frame B, which is $R_{\theta_B}v_B + t_B$ ($v_B$ should be the blue vector), and one for frame C, which is $R_{\theta_C}v_C + t_C$ ($v_C$ should be the red vector), where $$ R_\theta = \begin{bmatrix}\cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta)\end{bmatrix} $$ corresponds to a 2D rotation counterclockwise by $\theta$ and $R_\theta^{-1}$ is its inverse that corresponds to a clockwise rotation by $\theta$, $t_B$ corresponds to the green vector, and $t_C$ corresponds to the orange vector. Therefore, to obtain the coordinates of $x$ with respect to frame C, we solve for $v_C$ as follows: \begin{align} R_{\theta_B}v_B + t_B &= R_{\theta_C}v_C + t_C \\ R_{\theta_B}v_B + t_B - t_C &= R_{\theta_C}v_C \\ R_{\theta_C}^{-1}(R_{\theta_B}v_B + t_B - t_C) &= v_C \\ \end{align} I'm not sure about this reasoning, so I would appreciate any feedback.
After some more thought, I think this reasoning is indeed correct. To better understand why, we will consider a related but simpler example. Consider the setup shown in Fig. 1 below.
Fig. 1
There are two different frames, A and B, where A is considered to be the "global" frame. We have two different expressions for the vector $v$: one in frame A, which is represented by the coordinate vector $y$, and one in frame B, which is represented by the coordinate vector $w$ (note that a vector $v$ is an element of some vector space, while its associated coordinate vector is its representation with respect to some basis that is chosen from the same vector sapce, in this case the basis vectors associated with either frame A ($y$) or frame B ($w$)).
We want to determine the relationship between the coordinate vectors $y$ and $w$. That is, how do we go from $w$ to $y$, and vice versa, via some rotation and translation. To do so, we will proceed as follows. First, consider frame A only, as shown in Fig. 2 below.
Fig. 2
We consider the basis vectors associated with frame A to be the standard basis vectors $e_1$ and $e_2$. Then, we can construct the vector $v$ by taking a specific linear combination of the vectors $e_1$ and $e_2$. Let this linear combination be represented by the coordinate vector $y$. This amounts to computing $v = Iy$, where $I$ is the $2 \times 2$ identity matrix, as shown in Fig. 3 below.
Fig. 3
Going back to frame A, we can rotate each of the basis vectors associated with frame A counterclockwise by $\theta_B$ to get frame B before it is translated, as shown in Fig. 4 below. Because the basis vectors associated with frame A are $e_1$ and $e_2$, then this amounts to computing $R_{\theta_B} I$, where $R_{\theta_B}$ is the $2 \times 2$ rotation matrix that corresponds to a counterclockwise rotation by $\theta_B$.
Fig. 4
Using this rotated frame, we can compute some linear combination of its basis vectors to compute the vector $z$. Let this linear combination be represented by the coordinate vector $w$ (which is the same $w$ shown in Fig. 1 above). This is equivalent to computing $z = R_{\theta_B} I w$, as shown in Fig. 5 below.
Fig. 5
Finally, we compute the vector $v$ by translating the coordinate vector associated with $z$ by the coordinate vector $t$, as shown in Fig. 6 below ($t$ also has an abstract vector equivalent that is independent of a basis, but that's another story). This is equivalent to computing $v = R_{\theta_B} I w + t = Iy$.
Fig. 6
We therefore have the following relationship between $w$ and $y$: $$R_{\theta_B} w + t = y$$ Relating this back to the question, we have the following relationship (note that frame A is the global frame): \begin{align} x &= Iv_A \\ &= R_{\theta_B} I v_B + t_B \\ &= R_{\theta_C} I v_C + t_C \end{align} which can be used to solve for $v_C$ in terms of $v_B$. Note that the simpler example given above is just the special case when $t_C = 0$ and $\theta_C = 0$. Also, note that $$ \begin{align} R_{\theta_C}^{-1}R_{\theta_B} &= R_{\theta_B - \theta_C} \\ R_{\theta_C}^{-1} &= R_{\theta_C}^T \end{align} $$