You can use the method subs:
sage: e1 = cos(x) + sin(x) - exp(x) + x^2/3

Note though that it won't work with too complicated expressions for e2. For more on this, you may have a look to the documentation of subs in the reference manual.