If we start with:
$$\dfrac{1-\cos(2\theta)}{\sin^2(2\theta)}\;,$$
we can simplify that to , $$\dfrac{1-(1-2\sin^2(\theta)}{4\sin^2(\theta)\cos^2(\theta)}\;,$$
which simplifies further to
$$\dfrac{\sin^2(\theta)}{2\sin^2(\theta)\cos^2(\theta)}\;.$$
Now, I can divide both sides by $\sin^2(\theta)$, (given that it doesnt equal $0$), and arrive at the answer $\dfrac{1}{2}$$\sec^2(\theta)$.
Now, surely the domain resitriction I must apply is all the values of $\theta$ for which $\sin^2(\theta)$ equals $0$, such as $\pi$.
Now this is the bit that makes little sense, if I put $\pi$ into the first equation, I get an undefined answer, but in $\dfrac{1}{2}$$\sec^2(\theta)$, I get $0.5$, which is what desmos plots.
So my question is, what is happening here?