Python | sympy.expand_trig() method
With the help of sympy.expand_trig() method, we can expand any trigonometric expression to its lowest form.
expression – It is the trigonometric expression which will be expanded.
Returns: Returns the trigonometric expression after its expansion.
In this example we can see that by using sympy.expand_trig() method, we can expand any trigonometric expression.
Before Trigonometric Expansion : sin(2*x) + cos(2*x) After Trigonometric Expansion : 2*sin(x)*cos(x) + 2*cos(x)**2 - 1
Before Trigonometric Expansion : -sin(3*y) + cos(3*x) After Trigonometric Expansion : 4*sin(y)**3 - 3*sin(y) + 4*cos(x)**3 - 3*cos(x)
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course