Created latex source deriving the approximate cost function