I am trying to evaluate the integral, that comes from a physics problem, where i need to calculate the probability of hitting a crocodile 100 meters away from the launching point and the crocodile is 7 meters long. The initial velocity is 50ms^2. I used this integral to evaluate that but I am having a hard time with the calculus. $$ 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. I know I have to separate into intervals from 0 to pi/4 and pi/4 to pi/2, so I can perform a substitution and use the proprities of delta, but the density comes from a uniform distribution which in this case is 2/pi. So how do I evaluate what is inside the delta function? I dont know how to interpret.
I am applying what I think is the standard definition of the composition between a Dirac delta and a smooth function (see e.g. https://en.wikipedia.org/wiki/Dirac_delta_function#Composition_with_a_function , section “Composition with a function”).
Applying the formula you see in the Wikipedia’s page, you have $$ \int_0^{\pi/2}d\theta\tfrac{2}{\pi}\delta\mathopen{}\left(x-\tfrac{v_i^2\sin(2\theta)}{g}\right)\mathclose{}= \sum_{\theta_0}\int_0^{\pi/2}d\theta\tfrac{2}{\pi}\frac{\delta(\theta-\theta_0)}{|h’(\theta_0)|}, $$
where $h(\theta)= x-\tfrac{v_i^2\sin(2\theta)}{g}$ and $\theta_0$ are the points where $h(\theta_0)=0$.
You clearly have $h’(\theta)=-2\frac{v_i^2\cos(2\theta)}{g}$. Since you have $$h(\theta_0)=0\iff \sin(2\theta)=\frac{gx}{v_i^2},$$
using trigonometric formulas, you obtain $$h’(\theta_0)=\pm\frac{2v_i^2}{g}\sqrt{1-\left(\frac{gx}{v_i^2}\right)^2}.$$
At this point, we shall make clear that we have two zeroes of $h$ if $gx<v^2$, one zero of $h$ if the equality holds, and no zeroes if $gx>v_i^2$.
So, for $x>\frac{v_i^2}{g}$, $f(x)=0$, while for $x<\frac{v_i^2}{g}$ we should have $$f(x)= \frac{2}{\pi}\frac{g}{v_i^2}\frac{1}{\sqrt{1-\left(\frac{gx}{v_i^2}\right)^2}}.$$
Edit: I think that the result is consistent, as there is no chance that we get beyond $x=\frac{v_i^2}{g}$, that is precisely the formula for the maximum range. Moreover, the integral of $f$ is $1$, thus it is actually a probability distribution!