Find the volume of the region outside cone and inside sphere.

Find the volume of region outside the cone $\varphi = \frac{\pi}{4}$ and inside the sphere $\rho =4cos(\varphi)$.

Solution Attempt: I can visualize the surfaces and see that the volume is two spherical caps at the edges of the cone but am not sure how to set up the integral.

In spherical coordinates, you are looking for the volume of the following region: $$E=\{(\rho,\theta,\phi)\;|\;0\le \rho\le 4\cos\phi,0\le \theta \le2\pi, 0\le \phi\le\frac{\pi}{4}\}$$ So your volume equals $$V(E)=\iiint_E \rho^2\sin\phi\; d\rho d\theta d\phi$$