CoCalc Public Filestmp / 2015-02-02-101823.tex
Authors: Harald Schilly, ℏal Snyder, William A. Stein
1\documentclass{article}
2\usepackage{sagetex}
3
4\begin{document}
5
6Using Sage\TeX, one can use Sage to compute things and put them into
7your \LaTeX{} document. For example, there are
8$\sage{number_of_partitions(1269)}$ integer partitions of $1269$.
9You don't need to compute the number yourself, or even cut and paste
10it from somewhere.
11
12Here's some Sage code:
13
14\begin{sageblock}
15    f(x) = exp(x) * sin(2*x)
16\end{sageblock}
17
18The second derivative of $f$ is
19
20$21 \frac{\mathrm{d}^{2}}{\mathrm{d}x^{2}} \sage{f(x)} = 22 \sage{diff(f, x, 2)(x)}. 23$
24
25Here's a plot of $f$ from $-1$ to $1$:
26
27\sageplot{plot(f, -1, 1)}
28
29\end{document}