Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: math480-2016
Views: 2223
1
\documentclass{article}
2
\title{Problem 3: The Sage Zone}
3
\author{UW Student who knows SageTex!}
4
\date{2016-04-22}
5
\usepackage{sagetex}
6
7
\begin{document}
8
\maketitle
9
10
\section{Factoring Years\label{years}}
11
Sage says\footnote{These factorization are
12
computed using sagetex!} that $2016=\sage{factor(2016)}$ and
13
$2017=\sage{factor(2017)}$.
14
15
\section{Plotting a Function\label{plotting}}
16
Here is a plot of $\sin(x^2)$ made using sagetex. Your
17
plot should be about this size (not enormous).
18
\vspace{.5in}
19
20
\sageplot[width=.7\textwidth]{plot(sin(x^2), 0, pi)}
21
22
\section{Deriving a Formula\label{formula}}
23
24
Sage can find a formula for
25
$
26
f(n) = \sin(1) + \sin(2) + \cdots + \sin(n).
27
$
28
Just enter this code into Sage (in sagetex use the sageblock environment):
29
\begin{sageblock}
30
var('k, n')
31
f = sum(sin(k), k, 1, n)
32
\end{sageblock}
33
and find that
34
{\tiny
35
$$
36
f = \sage{f}
37
$$
38
}
39
40
Here is a plot of the formula above from $0$ to $100$:
41
42
\sageplot[width=\textwidth]{plot(f, 0, 100, color='red')}
43
44
\end{document}
45
46