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()
thanks
Both of your suggestions work!!!
Asked: 9 years ago
Seen: 1,165 times
Last updated: Apr 26 '15