The calculation of literal expansions