This is my homework assignment. It has $\sin(x) + \cos(x^\pi)$ latex...
{{{id=22|
///
}}}
{{{id=24|
f = integrate(sin(x^2),x); f
///
1/8*((I - 1)*sqrt(2)*erf((1/2*I - 1/2)*sqrt(2)*x) + (I + 1)*sqrt(2)*erf((1/2*I + 1/2)*sqrt(2)*x))*sqrt(pi)
}}}
{{{id=25|
latex(f)
///
\frac{1}{8} \, {\left(\left(i - 1\right) \, \sqrt{2} \text{erf}\left(\left(\frac{1}{2} i - \frac{1}{2}\right) \, \sqrt{2} x\right) + \left(i + 1\right) \, \sqrt{2} \text{erf}\left(\left(\frac{1}{2} i + \frac{1}{2}\right) \, \sqrt{2} x\right)\right)} \sqrt{\pi}
}}}
{{{id=26|
show(f)
///
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{1}{8} \, {\left(\left(i - 1\right) \, \sqrt{2} \text{erf}\left(\left(\frac{1}{2} i - \frac{1}{2}\right) \, \sqrt{2} x\right) + \left(i + 1\right) \, \sqrt{2} \text{erf}\left(\left(\frac{1}{2} i + \frac{1}{2}\right) \, \sqrt{2} x\right)\right)} \sqrt{\pi}
}}}
{{{id=4|
2 + 2
///
4
}}}
{{{id=18|
2^3
///
8
}}}
{{{id=27|
2**3
///
8
}}}
{{{id=19|
1/3
///
1/3
}}}
{{{id=20|
%python
print 2^3
print 1/2
///
1
0
}}}
{{{id=1|
factor(2012)
///
2^2 * 503
}}}
{{{id=28|
x + y
///
Traceback (most recent call last):
File "", line 1, in
File "_sage_input_14.py", line 10, in
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("eCArIHk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single')
File "", line 1, in
File "/tmp/tmpXWK1IF/___code___.py", line 2, in
exec compile(u'x + y' + '\n', '', 'single')
File "", line 1, in
NameError: name 'y' is not defined
}}}
{{{id=30|
while True:
pass
///
Traceback (most recent call last):
File "", line 1, in
File "_sage_input_18.py", line 10, in
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("d2hpbGUgVHJ1ZToKICAgIHBhc3M="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single')
File "", line 1, in
File "/tmp/tmpL_aI_O/___code___.py", line 2, in
exec compile(u'while True:\n pass' + '\n', '', 'single')
File "", line 2, in
File "/sagenb/flask/sage-4.6.2/local/lib/python2.6/site-packages/sage/interfaces/get_sigs.py", line 9, in my_sigint
raise KeyboardInterrupt
KeyboardInterrupt
__SAGE__
}}}
{{{id=29|
for i in range(10):
print i
sleep(1)
///
0
1
2
3
4
5
6
7
8
9
}}}
{{{id=2|
var('x,y')
factor(x^2 - 4*sin(y)^2)
///
(x - 2*sin(y))*(x + 2*sin(y))
}}}
{{{id=3|
latex(factor(x^2 - 4*sin(y)^2))
///
{\left(x - 2 \, \sin\left(y\right)\right)} {\left(x + 2 \, \sin\left(y\right)\right)}
}}}
{{{id=5|
f = integrate(e^x * sin(x), x); f
///
1/2*(sin(x) - cos(x))*e^x
}}}
{{{id=6|
g = diff(f, x); g
///
1/2*(sin(x) - cos(x))*e^x + 1/2*(sin(x) + cos(x))*e^x
}}}
{{{id=7|
g.expand()
///
e^x*sin(x)
}}}
{{{id=8|
@interact
def f(thickness=(1..20)):
P = plot(sin(x) + (1-x^2), (x, 0, 2),
color='green', thickness=thickness)
P.show()
///
}}}
{{{id=9|
plot(sin(x) + (1-x^2), (x, 0, 2)).save('plot1.pdf')
///
}}}
{{{id=10|
find_root(sin(x) + (1-x^2), 0, 2)
///
1.4096240040025754
}}}
{{{id=11|
lisp('(+ 2 3)')
///
5
}}}
{{{id=12|
lisp("(defun factorial(n) (if (= n 1) 1 (* n (factorial (- n 1)))))")
///
FACTORIAL
}}}
{{{id=13|
lisp('(factorial 10)')
///
3628800
}}}
{{{id=33|
lisp.factorial(10)
///
3628800
}}}
{{{id=17|
magma_free("Factorisation(2012)")
///
[ <2, 2>, <503, 1> ]
}}}
{{{id=21|
%python
def f(n):
return n*n
///
}}}
{{{id=31|
f(10)
///
100
}}}
{{{id=32|
///
}}}