A fluid has density 2 and velocity field v=xj-yi+4zk. Find the rate of flow outward through the sphere x^2+y^2+z^2=9.

Parameterize the sphere (call it [tex]S[/tex]) by
[tex]\vec s(u,v) = 3\cos(u)\sin(v)\,\vec\imath + 3\sin(u)\sin(v)\,\vec\jmath + 3\cos(v)\,\vec k[/tex]
with [tex]0\le u\le2\pi[/tex] and [tex]0\le v\le\pi[/tex].
The outward-pointing normal vector to [tex]S[/tex] is
[tex]\vec n = \dfrac{\partial\vec s}{\partial v} \times \dfrac{\partial\vec s}{\partial u} = 9\cos(u)\sin^2(v)\,\vec\imath + 9\sin(u)\sin^2(v)\,\vec\jmath + 9\cos(v)\sin(v)\,\vec k[/tex]
Evaluating [tex]\vec v[/tex] at [tex]\vec s[/tex] gives
[tex]\vec v = 3\cos(u)\sin(v)\,\vec\imath - 3\sin(u)\sin(v)\,\vec\jmath + 12\cos(v)\,\vec k[/tex]
Then the flux of [tex]\vec v[/tex] across [tex]S[/tex] is
[tex]\displaystyle \iint_S \vec v\cdot d\vec\sigma = \int_0^\pi \int_0^{2\pi} \vec v \cdot \vec n \, du \, dv[/tex]
[tex]\displaystyle = \int_0^\pi \int_0^{2\pi} \left(108\cos^2(v)\sin(v) + 27 \cos(2u) \sin^3(v)\right) \, du \, dv = 144\pi[/tex]
... if the fluid has density 1. But our fluid has density 2, which means twice as much fluid occupies a given volume,
[tex]\rho = \dfrac mV \implies V = \rho m \implies V = 2m[/tex]
so the overall flux in this case must be doubled to
[tex]\boxed{288\pi}[/tex]
Alternatively, since [tex]S[/tex] is a closed sphere, the divergence theorem applies and the flux integral (for density 1) is
[tex]\displaystyle \iint_S \vec v\cdot d\vec\sigma = \iiint_R \mathrm{div}\vec v \, dV = 4 \iiint_R dV[/tex]
where [tex]R[/tex] is the interior of [tex]S[/tex]. But that's just a ball of radius 3, and this integral is 4 times the volume of [tex]R[/tex].
[tex]\displaystyle \iint_S \vec v\cdot d\vec\sigma = 4 \times \frac{4\pi}3\times3^3 = 144\pi[/tex]
and we get the same result.