Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
2020 views
1
\documentclass{article}
2
3
\usepackage[utf8]{inputenc}
4
\usepackage{amsmath}
5
\usepackage{sagetex}
6
\usepackage{url}
7
8
\begin{document}
9
10
\section{This is a test}
11
12
Testing $\frac{1}{178} = \sage{n(1/178)}$.
13
14
\section{plotting}
15
16
is always fun ...
17
18
\sageplot[width=.5\textwidth]{plot(sin(x), (x,-10,10))}
19
20
\section{This is a test}
21
22
Testing $(1-x-x^2)^3 = \sage{((1-x-x^2)^2).expand()}$.
23
24
Using Sage\TeX, one can use Sage to compute things and put them into
25
your \LaTeX{} document. For example, there are
26
$\sage{number_of_partitions(1269)}$ integer partitions of $1269$.
27
You don't need to compute the number yourself, or even cut and paste
28
it from somewhere.
29
30
Here's some Sage code:
31
32
\begin{sageblock}
33
f(x) = sin(cos(2*x)^2 / (2+x))
34
\end{sageblock}
35
36
The first derivative of $f$ is $\sage{diff(f,x)}$.
37
38
The second derivative of $f$ is
39
40
\[
41
\frac{\mathrm{d}^{2}}{\mathrm{d}x^{2}} \sage{f(x)} =
42
\sage{diff(f, x, 2)(x)}.
43
\]
44
45
Here's a plot of $f$ from $-1$ to $10$:
46
47
\sageplot[width=.5\textwidth]{plot(f, -1, 10)}
48
49
\section{AMS Math}
50
51
$$P\left(A=2\middle|\frac{A^2}{B}>4\right)$$
52
53
Matrix:
54
55
\begin{equation*}
56
A_{m,n} =
57
\begin{pmatrix}
58
a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
59
a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\
60
\vdots & \vdots & \ddots & \vdots \\
61
a_{m,1} & a_{m,2} & \cdots & a_{m,n}
62
\end{pmatrix}
63
\end{equation*}
64
65
More here: \url{https://en.wikibooks.org/wiki/LaTeX/Mathematics}.
66
67
68
\end{document}
69
70