We present recent results with Bénéteau and Manolaki with respect to
the invariant subspaces generated by a function f in a function space.
The information on such spaces is contained on a family of polynomials
that we call optimal approximants. In this work, we provide a method
for finding a closed formula for all such approximants for a fixed
function f, with some assumptions.