Ask Your Question
1

Observation regarding integration with different algorithms

asked 2016-03-11 12:13:50 +0100

saad gravatar image

I was going through some basic tutorials and noticed this interesting behavior.

integrate(exp(x)*sin(x) + exp(x)*cos(x), x)

with algorithm='maxima' gives

1/2*(cos(x) + sin(x))*e^x - 1/2*(cos(x) - sin(x))*e^x

rather than the simplified

e^x*sin(x)

given by algorithm='sympy'. It is the same when I use maxima or sympy by itself. Why is that? Why is maxima not simplifying the expression?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-03-11 22:43:35 +0100

tmonteil gravatar image

updated 2016-03-11 22:49:24 +0100

The simplification is not automatic, you can ask explicitely for it with the .full_simplify() method:

sage: e = integrate(exp(x)*sin(x) + exp(x)*cos(x), x)
sage: e
1/2*(cos(x) + sin(x))*e^x - 1/2*(cos(x) - sin(x))*e^x
sage: e.full_simplify()
e^x*sin(x)
edit flag offensive delete link more

Comments

Thanks! This is what I needed.

saad gravatar imagesaad ( 2016-03-12 08:32:01 +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

1 follower

Stats

Asked: 2016-03-11 12:13:50 +0100

Seen: 369 times

Last updated: Mar 11 '16