Use the ** integrate ** method of sympy to find the analytical solution of the indefinite integral, definite integral, and improper integral of the elementary function.
from sympy import *
x=Symbol('x') #letter'x'Is defined as the variable x
y=Symbol('y') #letter'y'Is defined as the variable y
"""
Integral:
Use integrate
"""
#Indefinite integral
integrate(6*x**5, x) # 6 x^Indefinite integral of 5
integrate(log(x), x) # log(x)
#Definite integral
integrate(x**3, (x, -1, 1)) # x^3 of[-1,1]Integral up to
integrate(sin(x), (x, 0, pi/2)) # sin(x)of[0,pi/2]までof積分
#Improper integral
integrate(exp(-x**2), (x, -oo, oo)) #Exp(-x^2)of-From ∞+∞までof積分。ガウス積分。
From top to bottom, it is as follows.
Recommended Posts