Ask Your Question
0

Why doesn't Sage do obvious simplifications?

asked 2017-05-15 03:55:47 +0100

cybervigilante gravatar image
 I wanted Sage to simplify 1/2*(cos(x) + sin(x))*e^x - 1/2*(cos(x) - sin(x))*e^x , which easily comes out to e^x*sin(x), but it simply gave me the original term. Why doesn't Sage combine simple terms, or is there a way to make it do that?
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-05-15 10:02:19 +0100

mforets gravatar image

i guess that you are using simplify(expr), where expr is your symbolic expression. but notice that TAB completion like expr.simplify[TAB] reveals 11 simplify flavors. several of them will produce the expected output.

for example,

sage: expr = (1/2*(cos(x) + sin(x))*e^x - 1/2*(cos(x) - sin(x))*e^x)
sage: expr.simplify_full()
e^x*sin(x)

--

the top-level simplify has the same effect as expr.simplify(), as you can check in the code (use double question mark then hit enter, simplify??).

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-05-15 03:55:47 +0100

Seen: 339 times

Last updated: May 15 '17