$$ \begin{aligned} 40 &= 9x-5&& \text{ swap the left and right side of the equation } \\[1 em]9x-5 &= 40&& \text{ move -5 to the right } \\[1 em]9x &= 40+5&& \\[1 em]9x &= 45&& \text{ divide both sides by $ 9 $ } \\[1 em]x &= \frac{45}{9}&& \\[1 em]x &= 5&& \\[1 em] \end{aligned} $$