martes, 22 de abril de 2014

Integrando Con Sympy- Python

isra@linuxmint ~ $ python
Python 2.7.4 (default, Sep 26 2013, 03:20:56) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy import*
>>> ## integrando con sympy
>>> x=Symbol('x')
>>> y=Symbol('y')
>>> integrate(cos(x))
sin(x)
>>> integrate(log(x),x)
^[[1~x*log(x) - x
>>> integrate(log(x),x)
x*log(x) - x
>>> integrate(x**2 + cosh(x))
x**3/3 + sinh(x)
>>> ## integrales definidas
... 
>>> integrate(x**3,(x,-1,1))
0
>>> integrate(sin(x),(x,-pi/2,pi/2))
0
>>> integrate(cos(x),(x,-pi/2,pi/2))
2
>>> ## al infinito 
... 
>>> integrate(cos(x),(x,-pi/2,pi/2))
2
>>> integrate(x**3,(x,-1,+oo))
oo
>>> integrate(exp(-x**2),(x,-oo,+oo))
sqrt(pi)

No hay comentarios:

Publicar un comentario