Section 15.3: Example 1: Domain D = {(r*cos(theta),r*sin(theta)): 1 < r < 2, 0 < theta < %pi}

f(x,y) := 3*x+4*y^2;

'integrate('integrate(f(r*cos(theta),r*sin(theta))*r,r,1,2),theta,0,%pi);

wxplot2d([[parametric,cos(theta),sin(theta),[theta,0,%pi]],[parametric,2*cos(theta),2*sin(theta),[theta,0,%pi]]],[legend,"r=1","r=2"]);

integrate(integrate(f(r*cos(theta),r*sin(theta))*r,r,1,2),theta,0,%pi);

Example 4: Domain D = {(r*cos(theta),r*sin(theta)): -%pi/2 < theta < %pi/2, 0 < r < 2*cos(theta)}

f(x,y) := x^2 + y^2;

'integrate('integrate(f(r*cos(theta),r*sin(theta))*r,r,0,2*cos(theta)),theta,-%pi/2,%pi/2);

'integrate('integrate(trigsimp(f(r*cos(theta),r*sin(theta))*r),r,0,2*cos(theta)),theta,-%pi/2,%pi/2);

wxplot2d([parametric,2*cos(theta)*cos(theta),2*cos(theta)*sin(theta),[theta,-%pi/2,%pi/2]]);

integrate(integrate(f(r*cos(theta),r*sin(theta))*r,r,0,2*cos(theta)),theta,-%pi/2,%pi/2);