Desmos construction corrected
Briefly, my questions deals with the shifting terms that have to be applied in order to move the blue ellipse to the purple one :
https://www.desmos.com/calculator/gise9qcyfz
The givens of the question are :
(1) the ellipse the equation of which is researched is centered at $C_f = (3,2)$.
(2) its right vertex is $V_f = (5,7) $
(3) the length of its semi minor axis is ( arbitrarily) $3$ units
(4) this ellipse is the result of rotating and translating an original ellipse that is in standard orientation and in standard position ( hence, with its major axis on the X axis , and its center at $(0,0) ) $.
Step 1 : equation of the original ellipse in standard orientation and in standard position
Let $S_M$ be the length of the semi major axis; we have : $S_M = \sqrt {(5-3)^2 + (7-2)^2}$ ( because rotation and translation preserve length).
Equation of the original ellipse : $\large \frac {x^2} { (S_M) ^2} + \frac {y^2} {3^2} =1$
Step 2 : equation of the rotated ellipse whose major axis will be parallel to the major axis of the final ellipse
Let $R$ be the angle by which the ellipse is rotated; we have : $R = \arctan \bigg{(} \frac {7-2} {5-3} \bigg {)}$.
Applying the rotation of axis formula , we get :
$X(x,y) = x \cos(R)+ y \sin(R)$
$Y(x,y) = y \cos(R) - x \sin(R)$
and finally, for the rotated ellipse : $\large \frac { X(x,y)^2 } { (S_M)^2 } + \frac { Y(x,y)^2 } {3^2 } =1 $
Step 3 : shifting the rotated ellipse in order to get the final ellipse.
What remains to be done is to find the shifting terms $ h$ and $k$ in the final equation :
$$\large \frac { (X(x,y) -h)^2 } { (S_M)^2 } + \frac { (Y(x,y) -k)^2 } {3^2 } =1 $$
If I am correct, these shifting terms " operate" , so to say, in the rotated coordinate system , with
- new X axis :$ y = \tan (R) x $
- new Y axis : $y = (-1/ \tan(R))x $
Let $\gamma$ be the angle point $C_f = (3,2)$ makes with the new ( rotated) Y axis .
We have $ \gamma = \arctan (2/3) + ((\pi/2) -R)$.
With $D= \sqrt {2²+3²}$ the distance from $C_f$ to $O$ , the ( unchanged) origin, the new coordinates of $C_f$ are $ (h, k) = ( D \sin\gamma , D \cos \gamma)$.
So applying the new coordinates of $C_f$ as shifting terms , it seemed to me that I should have ( for the final ellipse) :
$$\large \frac { (X(x,y) -h)^2 } { (S_M)^2 } + \frac { (Y(x,y) -k)^2 } {3^2 } =1 . $$
However, the equation that, apparently works requires not a minus $k$ but a plus $k$ :
$$\large \frac { (X(x,y) -h)^2 } { (S_M)^2 } + \frac { (Y(x,y) +k)^2 } {3^2 } =1 . $$
Since $h$ and $k$ are both positive numbers , should not the displacement to the right and the displacement in the direction of the positive ( new) Y axis require a minus sign in both cases?
Note : I observe the same phenomenon if I directly apply as shifting terms the coordinates of $C_f$ in the original non rotated coordinate system , namely $(3,2)$.


I don't really get how you computed $\gamma$, but I imagine the root of your problem is the fact that $(h,k) = (D\cos \gamma, D\sin\gamma)$ expand into $$\cos \gamma = \cos \left ( \frac{\pi}{2}+\arctan(2/3) - R \right )=-\sin\left (\arctan(2/3) - R \right),$$ meanwhile $$\sin \gamma = \sin \left ( \frac{\pi}{2}+\arctan(2/3) - R \right )=\cos \left (\arctan(2/3) - R \right).$$ So that $$\left ( Y-\left | k \right | \right )^{2}$$ should actually be $$ \left ( Y-\left(-\left | k \right | \right) )^{2}=(Y+\left | k \right | \right )^{2}.$$
PS: Please work on your notation. You can stick to complete abstraction replacing all constants with variables, so you won't have as many problems with +/-'s. You can also give the variables you provided more meaningful "names". The post was very difficult to comprehend "as is".