Ask Your Question

# Why doesn't Sage do obvious simplifications?

 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 close merge delete

## 1 Answer

Sort by » oldest newest most voted

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

more

## Your Answer

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

Add Answer

## Stats

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

Seen: 115 times

Last updated: May 15 '17