Para Una Mejor Visualización de Ecuaciones: From Import
Para Una Mejor Visualización de Ecuaciones: From Import
Expandir
>>> ((x+y)**2).expand()
x**2 + 2*x*y + y**2
Sustituir
>>> ((x+y)**2).subs(x, y)
4*y**2
>>> ((x+y)**2).subs(x, 1-y)
1
Apartar
>>> 1/( (x+2)*(x+1) )
1
--------------(x + 1)*(x + 2)
>>> apart(1/( (x+2)*(x+1) ), x)
11
- ----- + ----x+2x+1
>>> (x+1)/(x-1)
x+1
----x-1
>>> apart((x+1)/(x-1), x)
2
1 + ----x1
Juntar
>>> from sympy import together
>>> together(1/x + 1/y + 1/z)
x*y + x*z + y*z
--------------x*y*z
>>> together(apart((x+1)/(x-1), x), x)
x+1
----x-1
>>> together(apart(1/( (x+2)*(x+1) ), x), x)
1
---------------
sympy.solvers.solvers.
>>> from sympy import Matrix
>>> from sympy.abc import x, y, z
>>> from sympy.solvers.solvers import solve_linear_system_LU
>>> solve_linear_system_LU(Matrix([
... [1, 2, 0, 1],
... [3, 2, 2, 1],
... [2, 0, 0, 1]]), [x, y, z])
{x: 1/2, y: 1/4, z: -1/2}
Derivadas
>>> from sympy import diff, Symbol, sin, tan
>>> x = Symbol(x)
>>> diff(sin(x), x)
cos(x)
>>> diff(sin(2*x), x)
2*cos(2*x)
>>> diff(tan(x), x)
2
tan (x) + 1
Integrales
>>> from sympy import integrate, erf, exp, sin, log, oo, pi, sinh, symbols
>>> x, y = symbols(x,y)