1 | initial version |
Is this what you want?
sage: var('T p')
(T, p)
sage: X = (5/(e^(T*p) - 1) + 1/(e^(T*p) - e^(2*T)))*e^(T*p)/(80*e^(T*p) + e^(2*T*p))
sage: var('z')
z
sage: X.substitute(p=log(z)/T)
(5/(z - 1) + 1/(z - e^(2*T)))*z/(80*z + e^(2*log(z)))
sage: X.substitute(p=log(z)/T).simplify()
(5/(z - 1) + 1/(z - e^(2*T)))*z/(z^2 + 80*z)
or:
sage: X.substitute_expression(e^(p*T)==z)
(5/(z - 1) + 1/(z - e^(2*T)))*z/(80*z + e^(2*T*p))
(This second way doesn't seem to catch the last exponential piece.)