Open In App

sympy.integrals.trigonometry.trigintegrate() in python

Improve
Improve
Like Article
Like
Save
Share
Report

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.

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)


Output :

1/cos(x)

Example #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)


Output :

x


Last Updated : 10 Jul, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads