# Revision history [back]

My first thought would be to switch your integral to polar coordinates so you don't need the max bit at all.

sage: r = 1.5
sage: var('a')
a
1.125*pi*a
sage: solve(_==1,a)
[a == 8/9/pi]
sage: n(_[0].rhs())
0.282942121052258


I think I did the change of coordinates right - $r dr d\theta$, right?

Now, this doesn't answer the more general question of how to do this, where I would suggest using find_root - or just using Scipy in general, perhaps, since you are already using it, if you really do not need the symbolic capabilities; the syntax may end up more natural, who knows?

My first thought would be to switch your integral to polar coordinates so you don't need the max bit at all.

sage: r = 1.5

I think I did the change of coordinates right - $r dr d\theta$, right?
Now, this doesn't answer the more general question of how to do this, this with a max and a double numerical integral, where I would suggest using find_root - or just using Scipy in general, perhaps, since you are already using it, if you really do not need the symbolic capabilities; the syntax may end up more natural, who knows?