Ask Your Question
0

integral(abs(cos(x)),(x,0,pi))

asked 2015-04-26 12:06:05 -0600

Vangelis gravatar image

this is for sure 2, however it evaluates to -1 !!! Is there anything wrong with the statement itself? Any suggestion?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2015-04-26 14:48:57 -0600

calc314 gravatar image

It is my understanding that Maxima has a difficult time with absolute values in integrals. You can get the answer using a numerical approximation via:

numerical_integral(abs(cos(x)),0,pi)

Or via sympy you can use:

import sympy
print sympy.integrals.integrate(abs(cos(x)),(x,0,pi)).n()
edit flag offensive delete link more

Comments

thanks

Both of your suggestions work!!!

Vangelis gravatar imageVangelis ( 2015-04-26 16:35:43 -0600 )edit

@Vangelis: you can mark the answer as accepted: click the check mark on the left.

slelievre gravatar imageslelievre ( 2015-04-26 21:16:45 -0600 )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

Stats

Asked: 2015-04-26 12:06:05 -0600

Seen: 465 times

Last updated: Apr 26 '15