Loading AI tools
来自维基百科,自由的百科全书
SymPy是一个符号计算的Python库。它的目标是成为一个全功能的计算机代数系统,同时保持代码简洁、易于理解和扩展。它完全由Python写成,不依赖于外部库。[2]
SymPy支持符号计算、高精度计算、模式匹配、绘图、解方程、微积分、组合数学、离散数学、几何学、概率与统计、物理学等方面的功能。[2][3]
求的积分:
>>> from sympy import init_printing, integrate, log, sqrt, symbols
>>> init_printing()
>>> x = symbols('x')
>>> g = sqrt(x + log(x))
>>> f = (x ** 2 + 2 * x + 1 + (3 * x + 1) * g) / (x * g * (x + g))
>>> f
2 ____________
x + 2⋅x + ╲╱ x + log(x) ⋅(3⋅x + 1) + 1
───────────────────────────────────────
⎛ ____________⎞ ____________
x⋅⎝x + ╲╱ x + log(x) ⎠⋅╲╱ x + log(x)
>>> integrate(f, x)
____________ ⎛ ____________⎞
2⋅╲╱ x + log(x) + 2⋅log⎝x + ╲╱ x + log(x) ⎠
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.