Somewhere along the way I forgot how to do math apparently. I can't figure this one out but I'm enjoying puzzling over it. This problem has only nerd appeal, so don't post how physics is stupid.
I am modeling an imaginary physical situation. What I have here in my brain, is a flat, small-area photo sensor in a dark room, pointed squarely at the room's only window, from some distance away. Actually the window is a diffuse, translucent hemispheric dome, 'doming' outward from the room. It is perfectly diffuse, so all parts of it are the same brightness. I need to figure out how close to the window I should hold the sensor, to achieve the maximum reading from the sensor.
I consider the effect on the sensor of an infinitesimal area element of the dome--a point source--so that I can integrate over the whole dome later. The light falling on the sensor from such an element of the dome falls off as a function of the distance from said element (1/r^2), and as a function of the angle between that element and the center of the window/sensor axis (the sensor is a "small area source" in reverse so sensitivity at any nonzero angle theta equals the on-axis sensitivity divided by sin(theta)). I have already done all this, and this is not the problem.
The problem is that I can integrate over the whole dome at any given distance from the window and obtain a "brightness factor" for that distance from the window. Doing so involves integrating over a range of distances becaues of the radius of the hemispherical window, though. Now, what I need is that (now calculable for any distance!) brightness factor as a function of distance from the window. Basically what I need to do is do that integral over the dome surface for every distance from touching the inside of the hemispheric window to infinity. And I don't know how to do that.
In real life what I would do is use a spreadsheet to calculate the integral for a 'lot' of 'closely-spaced' distances, make an XY plot, and pick what looks like the peak. I have already done that. However, I want to be able to do this analytically. But I don't know how to express the value of a definite integral as a function of one of the integrated variables.