# How to integrate a function of a direction, over the hemisphere

The Mathematica documentation Integrate over Regions gives an example of how to simply integrate over a sphere (surface):

Integrate[1, {x, y, z} ∈ Sphere[]]


Although it seems there is an Hemisphere object in Mathematica, it does not seem possible to easily integrate over all the directions that it includes.

Is there an elegant way to similarly compute the integral of a function over all the directions in an hemisphere?

An example of an application of this would be solving rendering equations

• Hemisphere objects in Mathematica are geographical, not geometric region objects. Nonetheless, you can construct more complex regions and use them on Integrate, for instance: Integrate[1, {x, y, z} ∈ RegionIntersection[Sphere[], ImplicitRegion[x > 0, {x, y, z}]]], which takes the parts of the sphere surface where x > 0. Commented Sep 25, 2015 at 4:00
• ... and in v10.2, you can also use HalfSpace. Commented Sep 25, 2015 at 4:12
• You referenced an article about hemispheres in MathWorld. Although MathWorld is a Wolfram site, it discussed mathematics, not Mathematica. In particular, the hemisphere it discusses is not a built-in Mathematica object. Commented Sep 25, 2015 at 4:23
• @m_goldberg Thank you, I updated the question.
– wip
Commented Sep 25, 2015 at 6:27
• @wil My implied intent was that you can use HalfSpace instead of explicitly written ImplicitRegion to specify which hemisphere of Sphere to use. Maybe it even gets treated more efficiently as an abstraction on some future version of Mma! Commented Sep 25, 2015 at 11:13

These drawing and formula can be found in the Global Illumination Compendium (P.15):

The integral can therefore be computed as:

Integrate[f[φ, θ] Sin[θ], {φ,0,2π}, {θ, 0, π/2}]


One can do it changing the integrand:

Integrate[1 Boole[x > 0], {x, y, z} ∈ Sphere[]]

• Or one can specify the domain completely as a region, just as kirma indicates in the comments to the question. Commented Aug 5, 2017 at 19:34

Edit: Just realized this was in the comments already, but here it is written explicitly:

You can construct the region yourself, e.g.

hemisphere = RegionIntersection[Sphere[],HalfSpace[{-1,0,0},0]];


Then the following will work:

Integrate[1,{x,y,z}\[Element] hemisphere]