Ask Your Question
0

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

asked 2015-04-26 19:06:05 +0100

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 21:48:57 +0100

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 23:35:43 +0100 )edit

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

slelievre gravatar imageslelievre ( 2015-04-27 04:16:45 +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

Stats

Asked: 2015-04-26 19:06:05 +0100

Seen: 1,062 times

Last updated: Apr 26 '15