Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
| Download
Project: Math 152 - Winter 2017
Views: 17362Math 152: Intro to Mathematical Software
2017-01-27
Kiran Kedlaya; University of California, San Diego
adapted from lectures by William Stein, University of Washington
** Lecture 8: Symbolic Calculus (part 1) **
Announcements:
Usual schedule next week! (including sections, office hours, homework, peer evaluation)
Some Resources for Symbolic Calculus in Sage
Basic Sage Calculus Tutorial: http://www.sagemath.org/calctut/
Sage for Undergraduates: http://www.gregorybard.com/Sage.html
Sage reference manual: http://doc.sagemath.org/html/en/reference/calculus/index.html
Sage Calculus "thematic tutorial": http://doc.sagemath.org/html/en/prep/Calculus.html
Short crash course
defining symbolic variables
defining symbolic functions
plot
differente
integrate
finding zeros
x^2
Error in lines 1-1
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/smc_sagews/sage_server.py", line 976, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 1, in <module>
NameError: name 'y' is not defined
<type 'sage.symbolic.expression.Expression'>
<type 'sage.symbolic.expression.Expression'>
(y, theta)
william*(z + 1)*z
william + z
<type 'sage.symbolic.expression.Expression'>
<type 'sage.symbolic.expression.Expression'>
Callable function ring with arguments (z, william)
(z, 0
(z + 1)*z
<type 'sage.symbolic.expression.Expression'>
<type 'sage.symbolic.expression.Expression'>
1
0.500000000000000
2*(tan(x)^2 + 1)*tan(x)
cos(x)
-cos(x)*sin(x)*tan(x) - 1/2*cos(2*x) + 1/2
0
0
0.0
0.47942553860420300027328793521557138808180336794060
x |--> 1/sqrt(-x^4 + 1)
Error in lines 1-1
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/smc_sagews/sage_server.py", line 976, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 1, in <module>
File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 554, in wrapper
return func(*args, **options)
File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/plot/plot.py", line 1931, in plot
G = funcs.plot(*args, **original_opts)
File "sage/symbolic/expression.pyx", line 11386, in sage.symbolic.expression.Expression.plot (/projects/sage/sage-7.5/src/build/cythonized/sage/symbolic/expression.cpp:63509)
return plot(f, *args, **kwds)
File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 554, in wrapper
return func(*args, **options)
File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/plot/plot.py", line 1946, in plot
G = _plot(funcs, (xmin, xmax), **kwds)
File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/plot/plot.py", line 2257, in _plot
randomize)
File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/plot/plot.py", line 3871, in generate_plot_points
data[i] = (float(xj), float(f(xj)))
File "sage/ext/interpreters/wrapper_py.pyx", line 68, in sage.ext.interpreters.wrapper_py.Wrapper_py.__call__ (/projects/sage/sage-7.5/src/build/cythonized/sage/ext/interpreters/wrapper_py.c:1800)
raise
File "sage/ext/interpreters/wrapper_py.pyx", line 60, in sage.ext.interpreters.wrapper_py.Wrapper_py.__call__ (/projects/sage/sage-7.5/src/build/cythonized/sage/ext/interpreters/wrapper_py.c:1734)
return interp_py((<PyTupleObject*>args).ob_item
File "sage/symbolic/function.pyx", line 996, in sage.symbolic.function.BuiltinFunction.__call__ (/projects/sage/sage-7.5/src/build/cythonized/sage/symbolic/function.cpp:11436)
res = super(BuiltinFunction, self).__call__(
File "sage/symbolic/function.pyx", line 491, in sage.symbolic.function.Function.__call__ (/projects/sage/sage-7.5/src/build/cythonized/sage/symbolic/function.cpp:6580)
res = g_function_eval2(self._serial, (<Expression>args[0])._gobj,
File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 78, in _eval_
if len(x.variables()) == 1:
AttributeError: 'float' object has no attribute 'variables'