According to the documentation one can make substitutions as: expr = sin(2*x) + cos(2*x) expr.subs(sin(2*x), 2*sin(x)*cos(x)) But say x = y + 2. How do I convert the expression from a function of x to a function of y without having to give the substitution explicitly? Continue reading...