(F, fct, x)
If a sympy 'Expr' is of the form (summation convention):

    expr = expr_0 + expr_i1i2...ir*a_i1*...*a_ir

    where all the a_j are noncommuting symbols in basis then

    dexpr = diff(expr_0, x) + d(expr_i1i2...ir*a_i1*...*a_ir)

    is returned where d() is the product derivation
If a sympy 'Expr' is of the form (summation convention):
If a sympy Expr is of the form ( summation convention ) :
def multilinear_derivation(F, fct, x):
    """
    If a sympy 'Expr' is of the form (summation convention):

    expr = expr_0 + expr_i1i2...ir*a_i1*...*a_ir

    where all the a_j are noncommuting symbols in basis then

    dexpr = diff(expr_0, x) + d(expr_i1i2...ir*a_i1*...*a_ir)

    is returned where d() is the product derivation
    """
    if F.is_commutative:
        return diff(F, x)
    elif isinstance(F, Mul) or isinstance(F, Symbol):
        return product_derivation(F, fct, x)
    elif isinstance(F, Add):
        result = S.Zero
        for term in F.args:
            result += product_derivation(term, fct, x)
        return result
def multilinear_derivation ( F , fct , x ) : if F . is_commutative : return diff ( F , x ) elif isinstance ( F , Mul ) or isinstance ( F , Symbol ) : return product_derivation ( F , fct , x ) elif isinstance ( F , Add ) : result = S . Zero for term in F . args : result += product_derivation ( term , fct , x ) return result