[guided]Let $a_1,a_2,a_3,a_4,a_6 \in k$ be the coefficients of the original long Weierstrass equation
\begin{align*}
y^2+a_1xy+a_3y=x^3+a_2x^2+a_4x+a_6.
\end{align*}
Throughout this guided computation, $X$ denotes the new variable $x'$ and $Y$ denotes the new variable $y'$. The right-hand side contributes only pure powers of $X$, because $x=u^2X+r$ contains no $Y$ term. Expanding in the polynomial ring $k[X,Y]$ gives
\begin{align*}
x^3 = u^6X^3+3u^4rX^2+3u^2r^2X+r^3,
\end{align*}
\begin{align*}
a_2x^2 = a_2u^4X^2+2a_2u^2rX+a_2r^2,
\end{align*}
and
\begin{align*}
a_4x = a_4u^2X+a_4r.
\end{align*}
Adding the constant term $a_6$ and collecting equal powers of $X$ yields
\begin{align*}
x^3+a_2x^2+a_4x+a_6 = u^6X^3+u^4(a_2+3r)X^2+u^2(a_4+2a_2r+3r^2)X+a_6+a_4r+a_2r^2+r^3.
\end{align*}
Now we compare this with the left-hand-side expansion. The terms involving $Y$ must stay on the left, because the target long Weierstrass form has $Y^2$, $XY$, and $Y$ on the left. The pure $X$ terms from the left-hand side are moved to the right by subtraction, giving
\begin{align*}
u^6Y^2+u^5(2s+a_1)XY+u^3(2t+a_1r+a_3)Y = u^6X^3+u^4(a_2+3r-s^2-a_1s)X^2+u^2(a_4+2a_2r+3r^2-2st-a_1t-a_1rs-a_3s)X+a_6+a_4r+a_2r^2+r^3-t^2-a_1rt-a_3t.
\end{align*}
The definition of a Weierstrass change of variables requires $u \in k^\times$, so $u$ is invertible in $k$. Hence $u^6$ is also invertible in $k$. Dividing every term by $u^6$ normalizes the coefficients of $Y^2$ and $X^3$ to $1$, which is exactly what is needed for long Weierstrass form. We obtain
\begin{align*}
Y^2+a_1'XY+a_3'Y=X^3+a_2'X^2+a_4'X+a_6',
\end{align*}
where the transformed coefficients are defined by
\begin{align*}
a_1'=\frac{a_1+2s}{u},
\end{align*}
\begin{align*}
a_2'=\frac{a_2+3r-s^2-a_1s}{u^2},
\end{align*}
\begin{align*}
a_3'=\frac{a_3+a_1r+2t}{u^3},
\end{align*}
\begin{align*}
a_4'=\frac{a_4+2a_2r+3r^2-2st-a_1t-a_1rs-a_3s}{u^4},
\end{align*}
and
\begin{align*}
a_6'=\frac{a_6+a_4r+a_2r^2+r^3-t^2-a_1rt-a_3t}{u^6}.
\end{align*}
Each numerator is an expression formed from elements of $k$ using addition and multiplication, so each numerator lies in $k$. Since $u \in k^\times$, each denominator $u,u^2,u^3,u^4,u^6$ is invertible in $k$. Therefore
\begin{align*}
a_1',a_2',a_3',a_4',a_6' \in k.
\end{align*}[/guided]