Skip to main content
\( \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section4Sage Environs

Sage ships with a Jupyter notebook server, which is a web application that provides a convenient interface to Sage commands, components and features.

Much of this section will only behave properly within a Jupyter Notebook server using a Sage kernel. However some portions are transferable to command-line use or via the Sage Cell Server.

Subsection4.1(Some) Indiscreet Mathematics

A symbolic derivative (from Maxima).

Derivative of a function is again a function, and can be evaluated.

Arbitrary precision numerical values on request (from MPmath).

Can display plots in the notebook (via matplotlib).

Study the multivariate integral \(\displaystyle\int_{-4}^4\int_0^{x^2} y^2-10x^2\,dy\,dx\text{.}\)

3-D plots are especially intriguing.

Implicit plots allow for more general surfaces.

Subsection4.2Interactive Explorations

Interactive demonstrations are easy to create with the “interact” decorator and modified function arguments.

Subsection4.3LaTeX Integration

…is superb.

Now switch display mode to .

And back to plain text.

Cut and paste a representation into your research article.

New Markdown cells also allow HTML and .We can add text to our notebooks using TeX syntax and dollar signs. Previous multivariate integral: \int_0^4\int_0^{x^2} y^2-10x^2\,dy\,dx

Can embed images this way also.

Subsection4.4Help, Doctests, Source Code

A huge number of examples are provided for (a) learning to use Sage commands, and (b) to test Sage commands. We call these “doctests.”

Illustrate tab-completion (rational form), help (doctests, zig-zag form), source code.

Subsection4.5Cython

A Sage-inspired project to convert Python to C, then compile.

Factorial, Python-style.

Cython-style. (cdef, long in header)

Subsection4.6Sage Single Cell Server

See HTML version of this presentation.