> Int[cos[a_.+b_.*x_], x_Symbol] := Sin[a+b*x] / b /; FreeQ[{a, b}, x]
>
> Here *a* and *b* are matched if they do not contain *x*.
>

Well, I'm a bit confused, but I was just considering, when we call an 
integration function:

*integrate(expression, x)*

we already know that *x* is the integration symbol, so we don't need to 
introduce some kind of WildSymbol or isinstance=[Symbol] to match that 
pattern.
 
assert isinstance(x, Symbol)
a = Wild('a', exclude=[x]) 
b = Wild('b', exclude=[x]) 
match_dict = expression.match(cos(a+b*x))
if match_dict:
    if set(match_dict.keys()) == set([a, b]):
        return sin(match_dict[a]+match_dict[b]*x)

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to