On Sat, Mar 21, 2009 at 5:58 AM, Vinzent Steinberg
<vinzent.steinb...@googlemail.com> wrote:
>
> What is the best way to replace tan(x) with sin(x)/cos(x)?
>
> *.match() does not seem to be suited, because I don't care where tan
> (x) occurs, I just want to replace it.
> WildFunction() seems to be broken.

That's a good question. You need to know the argument of tan(x). If
it's just x, then:
I would use:

e.subs(tan(x), sin(x)/cos(x))

I think we should maybe enhance our .match() or introduce .find() so
that one can do e.find(tan(Wild("a"))) and it would return tan(x**2)
or whatever is in the expression. Then you can use .subs() to
substitute it.

Ondrej

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com
To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to