[Python] Changing variables in sympy

Discussão em 'Python' iniciado por Stack, Setembro 10, 2024.

  1. Stack

    Stack Membro Participativo

    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...

Compartilhe esta Página