Hi, Attached is the code.
x = var('x') def f(x): if (x > 0): return x**2 elif (x <= 0): return -x**2 f(x).integrate(x, 0, 10) output: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/mc/.sage/sage_notebook/worksheets/admin/2/code/58.py", line 14, in <module> f(x).integrate(x) File "", line 1, in <module> AttributeError: 'NoneType' object has no attribute 'integrate' But the following works: x = var('x') def f(x): return x**2 f(x).integrate(x, 0, 10) output: 1000/3 --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---