The question I need to solve is
Write the point in Cartesian coordinates $(x,y) = (-6,6 \sqrt{3})$ into a polar representation with the polar angle in the interval $\left(\frac{-\pi}{2}, \frac{\pi}{2}\right)$.
I already found the polar coordinates from the Cartesian coordinates $\left(12,-\sqrt{3}\right)$ but I'm confused with the integration of an interval. The answer my teacher provided for this example is $\left(-12,\frac{-\pi}{3}\right)$ but I'm unclear on how to proceed with the question and end up with the provided answer.
You already started from writing $$x=-6=r\cos\theta\\y=6\sqrt3=r\sin\theta$$ It looks like you squared and added the two equations: $$x^2+y^2=6^2+6^2\cdot3=144=r^2(\cos^2\theta+\sin^2\theta)=r^2$$ From here you concluded that $r=12$. Note that $r=-12$ is also a solution. For the angle, you have $$\frac yx=-\sqrt 3=\frac{r\sin\theta}{r\cos\theta}=\tan\theta$$ From here, $\theta=-\frac{\pi}3$. which is in your given interval. Notice that this $\theta$ correspond to points in the 4th quadrant, while the point you want is in the second quadrant. You can add $\pi$ to your result (notice that $\tan$ is periodic, with a period $\pi$). But then your $\theta$ is not in the $(-\pi/2,\pi/2)$ interval. The other option is to allow $r$ to be negative. It has the same effect: $$r\cos(\pi+\theta)=-r\cos\theta\\r\sin(\pi+\theta)=-r\sin\theta$$