Ask Your Question
0

simplify_trig and sorting, for example in fractions

asked 2019-03-24 12:55:31 +0100

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-03-24 13:46:53 +0100

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 ?

edit flag offensive delete link more

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 ( 2019-03-25 23:51:51 +0100 )edit

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: 2019-03-24 12:55:31 +0100

Seen: 361 times

Last updated: Mar 24 '19