For 0<t<π, the denominator is at least sin2t>0, so the defining integral is finite. Let w(x)=1−cos2tsin2x1. Since w(π−x)=w(x), substituting x↦π−x and adding gives f(t)=π∫0πw(x)dx.
By symmetry about 2π, ∫0πw(x)dx=2∫0π/21−cos2tsin2xdx. With u=tanx, the latter integral is ∫0∞1+sin2tu2du=2sintπ, because sint>0.
Therefore f(t)=sintπ2. The requested integral, interpreted by the right-hand limit at t=0, is ∫0π/2sintdt=1.