# Python | sympy.expand_trig() method

With the help of `sympy.expand_trig(expn)` method, we are able to expand the trigonometric equations.

Syntax : `sympy.expand_trig(expn)`
Return : Return the expanded trigonometric expression.

Example #1 :
In this example we can see that by using `sympy.expand_trig(expn)` method, we are able to find the expanded form of trigonometric function.

 `# Import sympy ` `from` `sympy ``import` `*` ` `  `# Define symbols and trigo expression ` `x, y ``=` `symbols(``'x y'``) ` `expn ``=` `sin(``2` `*` `x) ``+` `cos(``2` `*` `x) ` ` `  `# Use sympy.expand_trig(expn) method ` `gfg ``=` `expand_trig(expn) ` ` `  `print``(gfg) `

Output :

2*sin(x)*cos(x) + 2*cos(x)**2 – 1

Example #2 :

 `# Import sympy ` `from` `sympy ``import` `*` ` `  `# Define symbols and trigo expression ` `x, y ``=` `symbols(``'x y'``) ` `expn ``=` `sin(``2` `*` `x)``*``*``2` `+` `cos(``2` `*` `x)``*``*``2` ` `  `# Use sympy.expand_trig(expn) method ` `gfg ``=` `expand_trig(expn) ` ` `  `print``(gfg) `

Output :

(2*cos(x)**2 – 1)**2 + 4*sin(x)**2*cos(x)**2

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.