Derivative function

25 views
Skip to first unread message

Akshat Jain

unread,
Nov 13, 2014, 2:58:56 PM11/13/14
to sy...@googlegroups.com
What does this means? 'Differentiate wrt x as long as x is not in the free symbols of any of
the upper or lower limits.' What are free symbols?

Aaron Meurer

unread,
Nov 13, 2014, 3:41:43 PM11/13/14
to sy...@googlegroups.com
Free symbols (or free variables) are variables that are not "dummy variables" (or bound variables). In terms of an integral, the integration variable of a definite integral is not free, since Integral(f(x), (x, 0, 1)) == Integral(f(y), (y, 0, 1)) mathematically. This means that Integral(f(x), (x, 0, 1)) does not really "depend" on x as a variable. 

This matters for differentiation as Integral(f(x), (x, a, b)).diff(x) is 0, regardless of what f is, *unless* a or b contains x, as then x would be free (Integral(f(x), (x, 0, x)) *does* depend on x). It's usually a bad idea to use the same variable as both a dummy variable of integration and a free symbol in the integration limits, but SymPy allows it.  However, if you avoid doing it, then this issue will never really come up, and you'll avoid confusion. 

There is more information on this concept at http://en.wikipedia.org/wiki/Free_variables_and_bound_variables

Aaron Meurer

On Thu, Nov 13, 2014 at 1:58 PM, Akshat Jain <akshat...@gmail.com> wrote:
What does this means? 'Differentiate wrt x as long as x is not in the free symbols of any of
the upper or lower limits.' What are free symbols?

--
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 sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/6f9536f4-f2bf-4dc8-bb6a-7a72a8a9e018%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aaron Meurer

unread,
Nov 13, 2014, 3:43:13 PM11/13/14
to sy...@googlegroups.com
I should also add that you can get a set of all the free symbols in an expression using the free_symbols attribute, like

In [2]: sin(x).free_symbols
Out[2]: set([x])

In [3]: Integral(f(x), (x, 0, y)).free_symbols
Out[3]: set([y])

If an expression has no free symbols it is considered by SymPy to be a constant.

Aaron Meurer

Reply all
Reply to author
Forward
0 new messages