It's 2*pi since the integral of abs(cos(x+y)) from x=0 to pi is 2
(independent of y). But here's how you can get Sage to compute a
numerical integral for you:

sage: f = lambda y: numerical_integral( lambda x: abs(cos(x+y)), 0,
pi )[0]
sage: f(0.0001)
1.9999999900000001
sage: numerical_integral( f, 0, pi)
(6.2831854397961235, 1.849638380505561e-07)
sage: N(2*pi)
6.28318530717959

Do:

numerical_integral?

for more info on the numerical_integral function.

BFJ


On Feb 7, 1:02 am, Santanu Sarkar <[email protected]>
wrote:
> How one can find integral abs(cos(x+y)) where x varies from 0 to pi
> and y varies from 0 to pi in Sage?

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to