Evaluating a surface integral

I'm trying to compute the integral $$\int_S x^2+z^2\,{\rm d}S,$$where $S$ is the surface $$S\colon~ \frac{x^2}{2} + \frac{y^2}{3} + \frac{z^2}{2} = 1, \quad y \geq 0.$$

One possible parametrization is: $${\bf x}(u,v) = (\sqrt{2} \cos u \cos v, \sqrt{3} \cos u \sin v, \sqrt{2}\sin u),$$ with $-\frac \pi 2 \leq u \leq \frac \pi 2, 0 \leq v \leq \pi$. Then I make:

X[u_,v_] :=  {Sqrt[2] Cos[u] Cos[v], Sqrt[3] Cos[u] Sin[v], Sqrt[2] Sin[u]}

f[{x_, y_, z_}] := x^2 + z^2

Integrate[f[X[u, v]] Norm[Cross[D[X[u, v], u], D[X[u, v], v]]], {u, -π/2, π/2}, {v, 0 , π}]


but Mathematica just won't compute it (keeps running on and on). What is an efficient way to do this? Thanks.

• What if you replace Norm with (Sqrt[#.#] &)? Jul 14, 2015 at 13:59
• Shows the integral but doesn't compute it.. Jul 14, 2015 at 14:21
• This isn't so much a Mathematica problem as it is a parametrization problem. I got the integral to evaluate using the parametrization $\mathbf{x} = (\sqrt{2} \cos u \cos v, \sqrt{3} \sin u, \sqrt{2} \cos u \sin v)$. Note that this exploits the symmetry between $x$ and $z$ more effectively. Jul 14, 2015 at 14:35

Solution with NIntegrate

NIntegrate[f[X[u, v]] Norm[Cross[D[X[u, v], u], D[X[u, v], v]]], {u, -π/2, π/2}, {v, 0, π}]
(* 19.8097 *)


An alternative approach to the problem is

s = ImplicitRegion[{x^2/2 + y^2/3 + z^2/2 == 1 && y > 0}, {x, y, z}];
Chop[NIntegrate[x^2 + z^2, {x, y, z} ∈ s], 10^-7]


which, of course, yields the same answer.

Added: Solution with Integrate

Consider the calculation in cylindrical coordinates with the axis along y. Integrating about the axis of symmetry then leaves the integral of 2 π r^3 over the 1D region,

s1 = ImplicitRegion[{r^2/2 + y^2/3 == 1 && r > 0 && y > 0}, {r, y}];
2 π Integrate[r^3, {r, y} ∈ s1]
(* 1/2 π (10 + 3 Sqrt[2] ArcCot[Sqrt[2]]) *)


with the numerical value given earlier.

In v13.3 SurfaceIntegrate is introduced, and the problem can be solved as follows:

reg =
ParametricRegion[{Sqrt[2] Sin[u] Cos[v], Sqrt[3] Sin[u] Sin[v],
Sqrt[2] Cos[u]}, {{u, 0, Pi}, {v, 0, Pi}}];

SurfaceIntegrate[x^2 + z^2, {x, y, z} ∈ reg]
(* π (5 + (3 ArcCsc[Sqrt[3]])/Sqrt[2]) *)


Well, actually SurfaceIntegrate isn't necessary in this case, we can directly use Integrate:

Integrate[x^2 + z^2, {x, y, z} ∈ reg]
(* π (5 + (3 ArcCsc[Sqrt[3]])/Sqrt[2]) *)


Sadly the followings don't give correct result for the moment:

SurfaceIntegrate[
x^2 + z^2, {x, y, z} ∈
ImplicitRegion[x^2/2 + y^2/3 + z^2/2 == 1 && y > 0, {x, y, z}]]
(* 0 <- Incorrect! *)

Integrate[
x^2 + z^2, {x, y, z} ∈
ImplicitRegion[x^2/2 + y^2/3 + z^2/2 == 1 && y > 0, {x, y, z}]]
(* 0 <- Incorrect! *)

• Am I missing something - 13.3 isn't out yet - is it? Jun 27, 2023 at 18:31
• @1729taxi, it is already out in Wolfram Cloud :) Jun 27, 2023 at 19:42