%load_ext sage a = 1/2 + 1/3 a # view(a) view に相当するものは? from IPython.display import display, Math def my_show(obj): return display(Math(latex(obj))) #y = 1 / (x^2+1) my_show(a) x = var('x') # f = x^3 -x^2 - 2*x f = x**3 -x**2 - 2*x #view(f) f my_show(f) factor(f) from IPython.display import display, Image plot(f, -2.5, 2.5, figsize=4).save("fig.png") display(Image('fig.png')) df = diff(f, x); df my_show(df) sol = solve(df, x); sol my_show(sol) plot(df, [x,-2.5,2.5], figsize=4).save('fig.png') display(Image('fig.png')) print find_root(df, -2, 0), find_root(df, 0, 2) Change an input cell into a markdown cell and then you may use latex: from IPython.display import display, Math def my_show(obj): return display(Math(latex(obj))) y = 1 / (x^2+1) my_show(y) #from IPython.display import Math Math(r'F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx') %matplotlib inline import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, 3*np.pi, 500) plt.plot(x, np.sin(x**2)) plt.title('A simple chirp'); sphere().save('fig3D.png') #display(Image('fig3D.png')) import os os.system('convert -resize 350x fig3D.png fig3Ds.png') display(Image('fig3Ds.png'))