Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: Testing 18.04
Views: 397
Kernel: Python 3 (system-wide)

SymPy 1.5 on CoCalc

kernel: Python 3 (system-wide)

https://github.com/sympy/sympy/wiki/Release-Notes-for-1.5

from sympy import * init_printing(use_latex='mathjax')
x, y = symbols('x y') plot_implicit((y > 2) & (y > x), x_var=x, y_var=y)
Image in a Jupyter notebook
<sympy.plotting.plot.Plot at 0x7ff9e3b0e9b0>
f2 = sin(x**2)/x * Abs(1- x) f2

sin(x2)x1x\displaystyle \frac{\sin{\left(x^{2} \right)} \left|{x - 1}\right|}{x}

f2d = f2.diff(x) f2d

2cos(x2)x1+((re(x)1)ddxre(x)+im(x)ddxim(x))sin(x2)sign(x1)x(x1)sin(x2)x1x2\displaystyle 2 \cos{\left(x^{2} \right)} \left|{x - 1}\right| + \frac{\left(\left(\operatorname{re}{\left(x\right)} - 1\right) \frac{d}{d x} \operatorname{re}{\left(x\right)} + \operatorname{im}{\left(x\right)} \frac{d}{d x} \operatorname{im}{\left(x\right)}\right) \sin{\left(x^{2} \right)} \operatorname{sign}{\left(x - 1 \right)}}{x \left(x - 1\right)} - \frac{\sin{\left(x^{2} \right)} \left|{x - 1}\right|}{x^{2}}

plot(f2, (x, -5, 5))
Image in a Jupyter notebook
<sympy.plotting.plot.Plot at 0x7ff9e3ec6ac8>
f3 = li(y*x**2) f3

li(x2y)\displaystyle \operatorname{li}{\left(x^{2} y \right)}

Integral(f3, x).doit()

{xli(x2y)xEi(3log(x)+3log(y)2)yx2fory00otherwise\displaystyle \begin{cases} x \operatorname{li}{\left(x^{2} y \right)} - \frac{x \operatorname{Ei}{\left(3 \log{\left(x \right)} + \frac{3 \log{\left(y \right)}}{2} \right)}}{\sqrt{y} \sqrt{x^{2}}} & \text{for}\: y \neq 0 \\0 & \text{otherwise} \end{cases}

solveset(f3, x)

{xxCli(x2y)=0}\displaystyle \left\{x \mid x \in \mathbb{C} \wedge \operatorname{li}{\left(x^{2} y \right)} = 0 \right\}

complex 16 in fortran 95

from sympy.utilities.codegen import codegen import sympy.utilities.codegen sympy.utilities.codegen.COMPLEX_ALLOWED = True x = Symbol('x', real=False) y = Symbol('y', real=True) result = codegen(('test', x + y), 'f95', 'test', header=False, empty=False) print(result[0][1])
COMPLEX*16 function test(x, y) implicit none COMPLEX*16, intent(in) :: x REAL*8, intent(in) :: y test = x + y end function