Parameterize [tex]M_1[/tex] by
[tex]\mathbf s(\theta,\phi) = \cos(\theta)\sin(\phi)\,\mathbf i + \sin(\theta)\sin(\phi)\,\mathbf j + \cos(\phi)\,\mathbf k[/tex]
with [tex]0\le \theta\le2\pi[/tex] and [tex]0\le \phi\le\frac\pi2[/tex].
The outward-pointing normal vector is
[tex]\mathbf n = \dfrac{\partial\mathbf s}{\partial \phi} \times \dfrac{\partial\mathbf s}{\partial \theta} = \cos(\theta)\sin^2(\phi)\,\mathbf i + \sin(\theta)\sin^2(\phi)\,\mathbf j + \cos(\phi)\sin(\phi)\,\mathbf k[/tex]
Evaluate [tex]\mathbf E[/tex] at [tex]\mathbf s[/tex].
[tex]\mathbf E(\mathbf s(\theta,\phi)) = 18 \left(\cos(\theta)\sin(\phi)\,\mathbf i + \sin(\theta)\sin(\phi)\,\mathbf j + \cos(\phi)\,\mathbf k\right)[/tex]
Then the integrand reduces to
[tex]\mathbf E \cdot \mathbf n = 18\cos^2(\theta)\sin(\phi)^3 + 18\sin^2(\theta)\sin^3(\phi) \\ ~~~~+ 18\cos(\phi)(\cos^2(\theta)\cos(\phi)\sin(\phi) + \sin^2(\theta)\cos(\phi)\sin(\phi)) \\\\ = 18\sin^3(v) + 18\cos^2(v)\sin(v) \\\\ = 18\sin(v) (\sin^2(v)+\cos^2(v)) = 18\sin(v)[/tex]
The flux of [tex]\mathbf E[/tex] across [tex]M_1[/tex] is then
[tex]\displaystyle \iint_{M_1} \mathbf E \cdot d\mathbf S = \int_0^{\pi/2} \int_0^{2\pi} 18\sin(v) \, du \, dv \\\\ = 36\pi \int_0^{\pi/2} \sin(v) \, dv = 36\pi[/tex]
and so the missing piece is [tex]f(\theta,\phi)=18\sin(\phi)[/tex], or in your case [tex]\boxed{18\sin(p)}[/tex].