(eq, func, new)
return eq.subs(reps).subs(func, new).subs(repu)
r"""
    When replacing the func with something else, we usually want the
    derivative evaluated, so this function helps in making that happen.

    To keep subs from having to look through all derivatives, we mask them off
    with dummy variables, do the func sub, and then replace masked-off
    derivatives with their doit values.

    Examples
    ========

    >>> from sympy import Derivative, symbols, Function
    >>> from sympy.solvers.ode import sub_func_doit
    >>> x, z = symbols('x, z')
    >>> y = Function('y')

    >>> sub_func_doit(3*Derivative(y(x), x) - 1, y(x), x)
    2

    >>> sub_func_doit(x*Derivative(y(x), x) - y(x)**2 + y(x), y(x),
    ... 1/(x*(z + 1/x)))
    x*(-1/(x**2*(z + 1/x)) + 1/(x**3*(z + 1/x)**2)) + 1/(x*(z + 1/x))
    ...- 1/(x**2*(z + 1/x)**2)
r"""
    When replacing the func with something else, we usually want the
    derivative evaluated, so this function helps in making that happen.
r When replacing the func with something else we usually want the derivative evaluated so this function helps in making that happen .
def sub_func_doit(eq, func, new):
    r"""
    When replacing the func with something else, we usually want the
    derivative evaluated, so this function helps in making that happen.

    To keep subs from having to look through all derivatives, we mask them off
    with dummy variables, do the func sub, and then replace masked-off
    derivatives with their doit values.

    Examples
    ========

    >>> from sympy import Derivative, symbols, Function
    >>> from sympy.solvers.ode import sub_func_doit
    >>> x, z = symbols('x, z')
    >>> y = Function('y')

    >>> sub_func_doit(3*Derivative(y(x), x) - 1, y(x), x)
    2

    >>> sub_func_doit(x*Derivative(y(x), x) - y(x)**2 + y(x), y(x),
    ... 1/(x*(z + 1/x)))
    x*(-1/(x**2*(z + 1/x)) + 1/(x**3*(z + 1/x)**2)) + 1/(x*(z + 1/x))
    ...- 1/(x**2*(z + 1/x)**2)
    """
    reps = {}
    repu = {}
    for d in eq.atoms(Derivative):
        u = C.Dummy('u')
        repu[u] = d.subs(func, new).doit()
        reps[d] = u

    return eq.subs(reps).subs(func, new).subs(repu)
def sub_func_doit ( eq , func , new ) : reps = { } repu = { } for d in eq . atoms ( Derivative ) : u = C . Dummy ( 'u' ) repu [ u ] = d . subs ( func , new ) . doit ( ) reps [ d ] = u return eq . subs ( reps ) . subs ( func , new ) . subs ( repu )