Unfortunately your teacher is using x as both a variable and a multiplication sign. This is something that can be avoided by using something like the asterisk symbol to indicate multiplication.
Anyways, notice how the expression
shows up twice. Once in the numerator (the entire numerator) and once again in the denominator (nearly the whole thing)
Let's replace that messy expression with the variable y. So we're letting
![y = 3^x*2^x+1](https://img.qammunity.org/2021/formulas/mathematics/high-school/bqd9vsfi7l8ssbfzdlbrrp006v4d7784lj.png)
This means,
![(3^x*2^2+1)/(3^x\left(3^x*2^2+1\right)) = (y)/(3^x*y)](https://img.qammunity.org/2021/formulas/mathematics/high-school/jskutketvxxjolgrt4ksvfdfqx3ya9hor2.png)
At this point you can probably see how to get
from here. The y terms cancel out when we divide leaving 1 up top and 3^x down below.