As nikoliazekter explained, you'd have to calculate the integral over the surface of polygon P. To solve this integral, you'd probably use a numerical approximation. I don't think it is realistic to do this in a real-time application, due to the complexity of this calculation.
While solutions might exist for some specific shapes, they don't for polygons P of any arbitrary shape. If you still want to use area lights, I think you can do either of two things.
Approach 1: Raytracing
You could opt for a raytracing renderer rather than a standard rasterizer. A raytracer works by "shooting" rays from the camera and checking where these rays end up. They might hit a diffuse surface, bounce of a reflective surface, hit a light source or something else. You might shoot several rays per pixel, to obtain multiple samples to determine the pixel's color.
A raytracer is a lot more flexible than a standard rasterizer, but this comes at the cost of complexity. This option might not be suitable for real-time applications.
Pathtracing is a specific type of raytracing where the full path of a ray is calculated, instead of only calculating direct light bounces (ie. bounces directed towards light sources) when the rays from the camera hit a surface. This technique is a global lighting solution. When calculating the color of a pixel, the entire scene is considered as a whole, as light rays can bounce between objects. Thus, effects such as shadow casting, color bleeding etc will be simulated.
Approach 2: Approximate the area light with point lights
Alternatively, you could approximate your area light with multiple standard point lights. While your render will not be physically correct, it is possible to closely approximate the area light. This way, you can make use of standard rasterization.
Rasterization is less flexible than raytracing, but it is much faster. This makes it suitable for real-time rendering.
Rasterization (in its basic form, using a simple illumination model such as Phong illumination) is a local lighting solution. When a polygon is being rasterized into fragments, only the fragment itself is considered. The entire rest of the scene is considered non-existant at that point. You are just calculating angles relative to the normal, camera and light sources, ignoring shadow casting, reflecting of light rays etc.
In summary, area lights are a lot more difficult to calculate than point lights, using a standard rasterizer. If your use-case is non-time-critical (e.g. an offline renderer for videos), you could look into raytracing as a rendering technique. If your use-case is time-critical (e.g. a video game), you might be more interested in approximating your area light using multiple point lights.
I'm not an expert at lighting equations, so I can't provide you with the exact mathematical solution unfortunately. I may have also butchered some of the lighting and rendering related terminology.