Ask Your Question
0

simplify_trig and sorting, for example in fractions

asked 6 years ago

my_screen_name gravatar image

The output of

show((1-cos(x)^2.simplify_trig())
show((cos(x)^2-1).simplify_trig())

is

sin(x)^2
cos(x)^2-1.

Even worse, the result of

 (sin(x)^2/(1-cos(x)^2)).simplify().simplify_trig()

is

 -(sin(x)^2/(cos(x)^2-1)

when it should be 1. Is there anyway to get sagemath to simplify trigonometric expressions more intelligently?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 6 years ago

Emmanuel Charpentier gravatar image

Works for me (Sagemath 8.7):

sage: (cos(x)^2-1).simplify_trig()
-sin(x)^2

similarly :

sage: (sin(x)^2/(1-cos(x)^2)).simplify().simplify_trig()
1
sage: (sin(x)^2/(1-cos(x)^2)).simplify_trig()
1

Note that:

sage: (cos(x)^2-1).trig_reduce()
1/2*cos(2*x) - 1/2

might be more useful...

What are you using ?

Preview: (hide)
link

Comments

I upgraded to sagemath 8.6 (the latest version with binaries available for my system), and this now works. Thanks for pointing out to use newer versions.

my_screen_name gravatar imagemy_screen_name ( 6 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 6 years ago

Seen: 393 times

Last updated: Mar 24 '19