I am wondering about the following well-known problem: Let $p$ is a prime number, $g$ is a generator of $(\mathbb{Z}/p\mathbb{Z})^\times$, $b \in (\mathbb{Z}/p\mathbb{Z})^\times$. Find $x$ - an integer such that $g^x = b \mod p$.
When I read about Shor algorithm for discrete log problem I always see the following function $$ f(x_1, x_2) = b^{x_1} a^{x_2} \mod p$$ and the task is to find the period of the function, i.e. $(\omega_1, \omega_2)$ such that $$ f(x_1, x_2) = f(x_1 + \omega_1, x_2 + \omega_2) $$.
My question is the following: why do we consider the complex function and don't consider the simplest one: $$ f(x_1) = b^{x_1} \mod p$$ If we can find the period of the function $\omega_1 < p - 1$ then $$g^{x \omega_1} = 1 \mod p$$ Thus from small Fermat theorem we have $$ x \omega_1 = 0 \mod p-1 $$ That can give the discrete log problem solution