# reset all previously defined varibles
%reset -f
# import everything from sympy moduleb
from sympy import *
# pretty math formatting
init_printing() # latex
x,y,z = symbols('x y z')
## Example 1
f = 2*x**3 # define function
f # print function
## Example 2
g = x**2 + x*y**2 # define function
g # print function
# f(0)
f.subs(x,0)
# f(1)
f.subs(x,1)
# g(x=2,y=3)
g.subs([(x,2),(y,3)])
## Graph of f = x^2
f = x**2
plot(f)
<sympy.plotting.plot.Plot at 0x7f5b50e6a410>
## multiple graph in same window
f = x**2
g = x**3
p = plot(f,g, (x, -2, 2),show=False, legend=True )
p[0].line_color = 'blue'
p[1].line_color = 'green'
p[0].label = 'f(x)'
p[1].label = 'g(x)'
p.show()
## undocking plots out of browser
%matplotlib qt
f = x**2
plot(f)
<sympy.plotting.plot.Plot at 0x7f5b173ce850>
## forcing plots inside browser
%matplotlib inline
f = x**2
plot(f)
<sympy.plotting.plot.Plot at 0x7f5b2c0869d0>