Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Identical answer (not full, unfortunately) to what I posted on SO.


You're probably going to have to parametrize your integration domain (circle, here). Or use a Cauchy residue type theorem.

Here is an interesting Sage cell instance by Jason Grout and Ben Woodruff that might help you get started on how to calculate some of them; unfortunately, sometimes these integrals are very tricky to do exactly. See this sage-support thread for an easier example, though I don't think in the end it fully worked because of a Maxima bug.

Relevant code:

f(x,y)=9-x^2-y^2
r(t)=(2*cos(t), 3*sin(t))
trange=(t,0,2*pi)

ds=r.diff(t).norm()
dA=f(*r(t))*ds(t)

def line_integral(integrand):
    return RR(numerical_integral(integrand, trange[1], trange[2])[0])

A = line_integral(dA)
integrate(dA, trange)

The last two lines do a numerical and exact (if possible) result, respectively.

Identical answer (not full, unfortunately) to what I posted on SO.


You're probably going to have to parametrize your integration domain (circle, here). Or use a Cauchy residue type theorem.theorem, as here.

Here is an interesting Sage cell instance by Jason Grout and Ben Woodruff that might help you get started on how to calculate some of them; unfortunately, sometimes these integrals are very tricky to do exactly. See this sage-support thread for an easier example, though I don't think in the end it fully worked because of a Maxima bug.

Relevant code:

f(x,y)=9-x^2-y^2
r(t)=(2*cos(t), 3*sin(t))
trange=(t,0,2*pi)

ds=r.diff(t).norm()
dA=f(*r(t))*ds(t)

def line_integral(integrand):
    return RR(numerical_integral(integrand, trange[1], trange[2])[0])

A = line_integral(dA)
integrate(dA, trange)

The last two lines do a numerical and exact (if possible) result, respectively.