Python中的sympy.integrals.trigonometry.trigintegrate()
借助trigintegrate()方法,我们可以使用模式匹配计算三角函数的积分,并使用该方法返回积分函数。
Syntax : trigintegrate(f, x, conds=’piecewise’)
Return : Return the integrated function
示例 #1:
在这个例子中我们可以看到,通过使用trigintegrate()方法,我们可以使用模式匹配得到函数的积分值。
Python3
# import trigintegrate
from sympy import Symbol, sin, cos, tan, sec, csc, cot
from sympy.integrals.trigonometry import trigintegrate
from sympy.abc import x
# Using trigintegrate() method
gfg = trigintegrate(tan(x)/cos(x), x)
print(gfg)
Python3
# import trigintegrate
from sympy import Symbol, sin, cos, tan, sec, csc, cot
from sympy.integrals.trigonometry import trigintegrate
from sympy.abc import x
# Using trigintegrate() method
gfg = trigintegrate(tan(x)*cot(x), x)
print(gfg)
输出 :
1/cos(x)
示例 #2:
Python3
# import trigintegrate
from sympy import Symbol, sin, cos, tan, sec, csc, cot
from sympy.integrals.trigonometry import trigintegrate
from sympy.abc import x
# Using trigintegrate() method
gfg = trigintegrate(tan(x)*cot(x), x)
print(gfg)
输出 :