With the help of trigintegrate() method, we can compute the integral of a trigonometric functions using pattern matching and return the integrated function by using this method.
Syntax : trigintegrate(f, x, conds='piecewise')
Return : Return the integrated function
Example #1 :
In this example we can see that by using trigintegrate() method, we are able to get the integrated value of trigonometric function using pattern matching.
# 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)
Output :
1/cos(x)
Example #2 :
# 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)
Output :
x