For any real number x {\displaystyle x} , define g ( x ) = ∫ 0 1 ( x e t − t ) 2 d t {\displaystyle g(x)=\int _{0}^{1}(xe^{t}-t)^{2}dt} . Find the minimum value of g ( x ) {\displaystyle g(x)} .