Sympy¶
In [1]:
from sympy import *
# init_printing()
x, y, z = symbols("x y z")
In [2]:
simplify(sin(x) ** 2 + cos(x) ** 2)
Out[2]:
$\displaystyle 1$
In [3]:
expand((x + 1) ** 3)
Out[3]:
$\displaystyle x^{3} + 3 x^{2} + 3 x + 1$
In [4]:
a = 3
b = 8
c = 2
y = a * x ** 2 + b * x + c
plot(y)
Out[4]:
<sympy.plotting.plot.Plot at 0x84b5910>
In [5]:
solveset(y)
Out[5]:
$\displaystyle \left\{- \frac{4}{3} - \frac{\sqrt{10}}{3}, - \frac{4}{3} + \frac{\sqrt{10}}{3}\right\}$
In [6]:
dy = y.diff(x)
plot(dy)
Out[6]:
<sympy.plotting.plot.Plot at 0x82eca30>
In [7]:
iy = integrate(y, x)
plot(iy)
Out[7]:
<sympy.plotting.plot.Plot at 0x867ea70>
Last update: September 27, 2021 09:50:41