x
is defined as a ufl object, ie
This means that it is interpeted as the physical coordinate in the physical cell at evaluation, which means that during assembly it is equal to the quadrature points on the physical cell (not reference element), giving exact integration of the quadrature degree is ser suffficiently high for polynomials.
Ive talked more about this at: Numerical values from ufl.SpatialCoordinate - #2 by dokken