Yes. The problem, of course, is that like with so much else in maths, simply memorizing a procedure alone won't really help. You need to understand the procedure in depth so that you can first identify, then next rearrange its elements and do things like this, and even better, know when and why you can and cannot do so under certain circumstances.
Integration by substitution is really like any other substitution and, in this regard, it is helpful to go back to elementary algebra. In the purely algebraic equation
$$x^2 + x + 1 = 3$$
we can substitute $7$ for $x$, or $-3$ for $x$, or any other value for $x$. We will typically get something false, but that is irrelevant to the basic mechanic of substitutions, which is just replacing one term for another term(*). When we have two variables, we can likewise do similar, e.g.
$$x^2 + y^2 = 9$$
and substitute $2$ for $x$ and $100$ for $y$ or $0.3$ for $x$ and $\pi$ for $y$ - the important point here is that, in general substitution, we can just substitute arbitrarily.
In the case of integration by substitution, however, we have two things. One of these is that in the integral
$$\int f(x)\ dx$$
we can substitute for any of the terms $x$, $f$, or $dx$ independently, just as before. The second is that, though, we are not just trying to use substitution to "massage" an integral, but we are trying to use substitution to evaluate an integral, and so we must make sure that our substitutions do not change the end value thereof, and thus that our substitutions are suitably constrained.
For example, back at algebra, if we are trying to solve $x^2 + x + 1 = 5$ by substitution, we should only substitute for $x$ something that will not rule out the possibility that we can still get $5$ on the left-hand side, which could either be a raw guess that $x = 1$ or, much more powerfully, a substitution involving other variables, say $x = y + h$, such that we can then control one to see if we can change the equation to a more favorable form (try $h = -\frac{1}{2}$).
The trick here is that replacing $x$ with $y + h$ does not compromise the potential range of $x$ so that some of the new variables will be unable to, if themselves substituted, generate sums that will cover the (as-yet unknown) solutions of the equation, but if we randomly replaced $x$ with, say, $5$, we now constrain the value of $x$ so bad that we have completely wiped out where the actual solution lies and thus the equation becomes always false (i.e. $31 = 3$).
Likewise, when doing integrals, we must, when we substitute for $x$, not then substitute for $dx$ in such a way that the integral's value changes. We are not "prescribing an algorithm" for doing the integral, but rather "setting a constraint" on an otherwise free manipulative process of plugging for $x$ and $dx$ as separate substitutibles that we can, so long as we understand what that constraint is and obey it, perform in any number of ways including, and especially - ones with cleverness and ingenuity.
And that relevant constraint here is that if you are going to substitute $x$ and $dx$ with different things, you must substitute them with things obeying the rule that
$$x = g(y) \leftrightarrow dx = g'(y)\ dy$$
. But beyond that, it doesn't matter whether you chose $x$ first, or chose - yes - $dx$ first, or chose - as in this case, something else first that then gave $x$ and $dx$ both as derivations (not "differentiation" sense but the general word sense) therefrom, so long as you just ensure that the substitutions for $x$ and $dx$ that you come up with in the end ultimately obey the constraint! And your Professor took an alternate route to achieving just that, namely via implicit differentiation.
(*) Terms are the units or "chunks" of mathematical expressions or, to put another way, they are the "nodes" in a grammar tree for the mathematical sentence, just as words, phrases, etc. are the "nodes" in the grammar trees for sentences in natural languages.