Write the integral $\int_{0}^{1}\int_{x}^{x\sqrt{3}}f(\sqrt{x^2+y^2})\,dy\,dx$ in polar coordinates with respect to $\theta$ first I know how to to do this problem by writing the integral in polar coordinates with respect to $r$ first and $\theta$ second:
$$\int_{\pi/4}^{\pi/3}\int_{0}^{1/\cos(\theta)}f(r)\,r\,dr\,d\theta,$$
but I've never seen an example of writing it with respect to $\theta$ first and $r$ second, so I'm unsure how to proceed. Any help would be appreciated.
Edit: Aiming to use Fubini's theorem on the original integral, using the following picture (please excuse the bluriness, the lower triangle is labelled $D_1$ and the upper, smaller one is labelled $D_2$) I have that $D_1=\{y/\sqrt{3}\leq x\leq y,\,\,0\leq y\leq ?\}$ and $D_2=\{y/\sqrt{3}\leq x\leq 1,\,\,?\leq y\leq \sqrt{3}\}$. How do I figure out the value of $y$ at the blue line? And once I've determined this, how does this help with the original question?

 A: The representation of the triangles $D_{1}$ and $D_{2}$ is not necessary to switch the order of the polar coordinates, especially because triangles aren't too nice in polar. We can work mainly from your iterated integral $$\int_{\pi/4}^{\pi/3}\int_{0}^{1/\cos\theta}f\left(r\right)r\,\mathrm{d}r\,\mathrm{d}\theta\text{.}$$
To integrate with respect to $r$ second, we need the absolute bounds for $r$. Since $r$ can start at $0$ in the iterated integral and $1/\cos\theta$ is positive for $\pi/4\le\theta\le\pi/3$, the minimum value of $r$ is $0$. The highest value of $r$ is when $1/\cos\theta$ is maximized, which is when $\cos\theta$ is minimized, at $\theta=\pi/3$ so $r=1/\cos\left(\pi/3\right)=2$. (We could also have seen this in your diagram with $\left(1,\sqrt{3}\right)$ being furthest from the origin, at distance $2$.) Our new iterated integral will look something like $$\int_{0}^{2}\int_{\theta_{1}\left(r\right)}^{\theta_{2}\left(r\right)}f\left(r\right)r\,\mathrm{d}\theta\,\mathrm{d}r\text{.}$$
We now need to find the bounds for $\theta$ in terms of $r$. Rather than splitting the region into two triangles $D_{1}$ and $D_{2}$, it's helpful to break up the region into a sector $A_{1}$ and the remainder $A_{2}$ (image created with Desmos):

When $r$ is small, as in, less than $\sqrt{2}$, $\theta$ can range from $\pi/4$ to $\pi/3$. But when $r$ is larger than $\sqrt{2}$, the vertical line $x=1$ restricts $\theta$, and so we must solve $r=1/\cos\theta$ to find $\theta=\arccos\left(1/r\right)$ as the minimum value, and $\pi/3$ is still the maximum. Even without the image above, we could have seen this split algebraically by noting that when $r<\sqrt{2}$, $\arccos\left(1/r\right)<\pi/4$, so that the boundary $r=1/\cos\theta$ does not constrain the original range for $\theta$ of $\left[\pi/4,\pi/3\right]$.
Either way, we have:
$$\int_{0}^{2}\int_{\max\left(\pi/4,\arccos(1/r)\right)}^{\pi/3}f\left(r\right)r\,\mathrm{d}\theta\,\mathrm{d}r$$
$$=\int_{0}^{\sqrt{2}}\int_{\pi/4}^{\pi/3}f\left(r\right)r\,\mathrm{d}\theta\,\mathrm{d}r+\int_{\sqrt{2}}^{2}\int_{\arccos(1/r)}^{\pi/3}f\left(r\right)r\,\mathrm{d}\theta\,\mathrm{d}r\text{.}$$
