** is implemented as the Pow object in sympy/core/pow.py. So if you do a**b, this is the same as calling Pow(a, b).
a - b is actually implemented as Add(a, Mul(-1, b)) (these are in sympy/core/add.py and sympy/core/mul.py). Similarly, a/b is implemented as Mul(a, Pow(b, -1)). Does that answer your question? The actual derivative computation happens in places like Add._eval_derivative. Aaron Meurer On Mon, Feb 13, 2012 at 3:29 AM, Alberto Barbaro <barbaro.albe...@gmail.com> wrote: > Many thanks Aaron. Now i'm trying to understand the code and understand the > flow. > > I have a simple question: > > the diff function has a body like this: > kwargs.setdefault('evaluate', True) > return Derivative(f, *symbols, **kwargs) > > and an output is like this: 4*x/(4*x**2 - 1)**(1/2) > > Where the output is formatted? Where the operation like ** or - are combined > with each other member? > > Thanks > > Alberto > > 2012/2/10 Aaron Meurer <asmeu...@gmail.com> >> >> We don't have anything like that supported directly. If you want to >> see how the code path works, the easiest way would be to step through >> it with a debugger, like pudb. >> >> Aaron Meurer >> >> On Fri, Feb 10, 2012 at 3:31 AM, Alberto <barbaro.albe...@gmail.com> >> wrote: >> > Hi to all, >> > If i write a line like: >> > >> >>>> a >> > (-sin(sin(x)) + cos(sin(x)))*cos(sin(sin(x)) + cos(sin(x))) >> >>>> diff(a) >> > (-sin(sin(x))*cos(x) - cos(x)*cos(sin(x)))*cos(sin(sin(x)) + >> > cos(sin(x))) - (- >> > sin(sin(x))*cos(x) + cos(x)*cos(sin(x)))*(-sin(sin(x)) + >> > cos(sin(x)))*sin(sin( >> > sin(x)) + cos(sin(x))) >> >>>> >> > >> > How can I see all the operations done by sympy? >> > >> > Thanks >> > >> > Alberto >> > >> > -- >> > 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. >> > >> >> -- >> 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. >> > > -- > 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. -- 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.