integral(abs(cos(x)),(x,0,pi))
this is for sure 2, however it evaluates to -1 !!! Is there anything wrong with the statement itself? Any suggestion?
add a comment
this is for sure 2, however it evaluates to -1 !!! Is there anything wrong with the statement itself? Any suggestion?
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()
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2015-04-26 19:06:05 +0100
Seen: 1,062 times
Last updated: Apr 26 '15