(f, x)
return result
Returns a set of all functional components of the given expression
    which includes symbols, function applications and compositions and
    non-integer powers. Fractional powers are collected with with
    minimal, positive exponents.

    >>> from sympy import cos, sin
    >>> from sympy.abc import x, y
    >>> from sympy.integrals.heurisch import components

    >>> components(sin(x)*cos(x)**2, x)
    set([x, sin(x), cos(x)])

    See Also
    ========

    heurisch
Returns a set of all functional components of the given expression
    which includes symbols, function applications and compositions and
    non-integer powers. Fractional powers are collected with with
    minimal, positive exponents.
Returns a set of all functional components of the given expression which includes symbols function applications and compositions and non - integer powers . Fractional powers are collected with with minimal positive exponents .
def components(f, x):
    """
    Returns a set of all functional components of the given expression
    which includes symbols, function applications and compositions and
    non-integer powers. Fractional powers are collected with with
    minimal, positive exponents.

    >>> from sympy import cos, sin
    >>> from sympy.abc import x, y
    >>> from sympy.integrals.heurisch import components

    >>> components(sin(x)*cos(x)**2, x)
    set([x, sin(x), cos(x)])

    See Also
    ========

    heurisch
    """
    result = set()

    if x in f.free_symbols:
        if f.is_Symbol:
            result.add(f)
        elif f.is_Function or f.is_Derivative:
            for g in f.args:
                result |= components(g, x)

            result.add(f)
        elif f.is_Pow:
            result |= components(f.base, x)

            if not f.exp.is_Integer:
                if f.exp.is_Rational:
                    result.add(f.base**Rational(1, f.exp.q))
                else:
                    result |= components(f.exp, x) | set([f])
        else:
            for g in f.args:
                result |= components(g, x)

    return result
def components ( f , x ) : result = set ( ) if x in f . free_symbols : if f . is_Symbol : result . add ( f ) elif f . is_Function or f . is_Derivative : for g in f . args : result |= components ( g , x ) result . add ( f ) elif f . is_Pow : result |= components ( f . base , x ) if not f . exp . is_Integer : if f . exp . is_Rational : result . add ( f . base ** Rational ( 1 , f . exp . q ) ) else : result |= components ( f . exp , x ) | set ( [ f ] ) else : for g in f . args : result |= components ( g , x ) return result