Ask Your Question
1

Observation regarding integration with different algorithms

asked 2016-03-11 05:13:50 -0500

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 15:43:35 -0500

tmonteil gravatar image

updated 2016-03-11 15:49:24 -0500

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 01:32:01 -0500 )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 05:13:50 -0500

Seen: 74 times

Last updated: Mar 11 '16