Ask Your Question
0

Why doesn't Sage do obvious simplifications?

asked 8 years ago

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?
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 8 years ago

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??).

Preview: (hide)
link

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: 8 years ago

Seen: 381 times

Last updated: May 15 '17