Integral of delta function evaluated with a sine function inside 
I am trying to evaluate the integral
$$
f(x)=\int_0^{\pi/2}d\theta\tfrac{2}{\pi}\delta\mathopen{}\left(x-\tfrac{v_i^2\sin(2\theta)}{g}\right)\mathclose{}.
$$
This represents the probability of a projectile hitting a certain target 100 meters away with a given initial speed $v_i$.

I have to perform a change of variable to apply one of the properties of the delta function, but the problem is the sine function. My teacher hinted I have to integrate from $0$ to $\pi/4$ and then from $\pi/4$ to $\pi/2$, but I don't understand why or how.
 A: 
I have to integrate from $0$ to $\pi/4$ and then from $\pi/4$ to $\pi/2$.

Integrals with Dirac deltas are much easier to solve if the integration variable is present directly inside the delta, instead of encased in an underlying function: that is, $\int \delta(u-u_0)F(u)\mathrm du$ is easier to evaluate than $\int \delta(f(u)-u_0)F(u)\mathrm du$. (Having said this, the latter form is perfectly standard if you know the rules for it.)
For that reason, your integral is easier to handle if you transform the integration variable from $\theta$ to $\xi=\frac{v_i^2}{g}\sin(2\theta)$. However, for this change of variables to work when there is a Dirac delta in the integrand, you need to make sure that the transformation function is monotonic. In your case, when $\theta$ goes from $0$ to $\pi/2$, the new variable $\xi$ goes from $0$ to $v_i^2/g$ and back to $0$, which means that if you applied the transformation rules directly without thinking about it, you would get
$$
\int_{0}^{\pi/2}\mathrm d\theta 
\longrightarrow
\int_0^0 \mathrm d\xi
$$
which would give zero identically. However, if you split it into the "going up" and "going down" segments separately, you get
$$
\int_{0}^{\pi/4}\mathrm d\theta 
\longrightarrow
\int_0^{v_i^2/g} \mathrm d\xi
\qquad \text{and} \qquad
\int_{\pi/4}^{\pi/2}\mathrm d\theta 
\longrightarrow
\int_{v_i^2/g}^0 \mathrm d\xi,
$$
and each of them has a separate chance of intersecting with the Dirac delta.
