why the variable always x
It is just usual to use x.
Letters such as a, b, c, d, and e are often reserved for constants and u, v, w, x, y, and z are usually reserved for variables.
There is no mathematical "rule" that requires that you use x for the variable.