(p, x, prec)
return rs_integrate(dlog, x)
logarithm of ``p`` modulo ``O(x**prec)``

    Notes
    =====

    truncation of ``integral dx p**-1*d p/dx`` is used.

    Examples
    ========

    >>> from sympy.polys.domains import QQ
    >>> from sympy.polys.rings import ring
    >>> from sympy.polys.ring_series import rs_log
    >>> R, x = ring('x', QQ)
    >>> rs_log(1 + x, x, 8)
    1/7*x**7 - 1/6*x**6 + 1/5*x**5 - 1/4*x**4 + 1/3*x**3 - 1/2*x**2 + x
logarithm of ``p`` modulo ``O(x**prec)``
logarithm of p modulo O ( x ** prec )
def rs_log(p, x, prec):
    """
    logarithm of ``p`` modulo ``O(x**prec)``

    Notes
    =====

    truncation of ``integral dx p**-1*d p/dx`` is used.

    Examples
    ========

    >>> from sympy.polys.domains import QQ
    >>> from sympy.polys.rings import ring
    >>> from sympy.polys.ring_series import rs_log
    >>> R, x = ring('x', QQ)
    >>> rs_log(1 + x, x, 8)
    1/7*x**7 - 1/6*x**6 + 1/5*x**5 - 1/4*x**4 + 1/3*x**3 - 1/2*x**2 + x
    """
    ring = p.ring
    if p == 1:
        return 0
    if _has_constant_term(p - 1, x):
        raise NotImplementedError('p - 1 must not have a constant term in the series variables')
    dlog = p.diff(x)
    dlog = rs_mul(dlog, _series_inversion1(p, x, prec), x, prec - 1)
    return rs_integrate(dlog, x)
def rs_log ( p , x , prec ) : ring = p . ring if p == 1 : return 0 if _has_constant_term ( p - 1 , x ) : raise NotImplementedError ( 'p - 1 must not have a constant term in the series variables' ) dlog = p . diff ( x ) dlog = rs_mul ( dlog , _series_inversion1 ( p , x , prec ) , x , prec - 1 ) return rs_integrate ( dlog , x )