I am having trouble in evaluating the following double integral:
Clearly the oscillating nature of the cos function is causing these issues. As I increase f and g to larger numbers, matlab complains of the singularities and the integration being unsuccessful.
(3 - 2*cos(y).*cos(f*x+g*y) - cos((f-1)*x + g*y)) ./ (4 - 2*cos(y).*(cos(y) + cos(x))) dxdy
Over limits -pi to pi for x and -pi to pi for y.
I have been using:
quad2d(@(x,y)my_func(x,y,f,g),-pi,pi,-pi,pi)
Any help or ideas please???