Probability density function from the inverse of another function Given the function:
$$f(x) = 1/sin(x)$$
where x is the angular interval 0  ≤ x < 1.5708 (in radians). I want to obtain a probability density function which represents the inverse case of f(x). 
Programmatically, I can obtain a mass function which is an approximation to the desired pdf over a fixed range, 0 ≤ x < 1.5533 [0-89°], using the following hack (which is satisfactory for my code application):
% in matlab code
% find f(x) at 1 degree intervals and plot 
fx = zeros(90,1);
theta = 0;
for i = 1:90;
    fx(i) = 1/sind(theta);
    theta = theta+1;
end
plot(0:89,fx);


% hack desired pdf
fx = zeros(90,1);
theta = 0;
for i = 1:90;
    fx(i) = 1/cosd(theta);
    theta = theta+1;
end
maxi = fx(90);
% flip dimension of the reverse sign of fx
fxF = flipdim(-fx+maxi,1);
% normalize
xPDF =  fxF/sum(fxF(:)); 
% plot
plot(0:89, xPDF);


What I require is the probability density function which equates to the distribution displayed in the second graph. I am more of a programmer than a mathematician so I would appreciate it if you go easy on me!
Thanks in advance

If I understood you code correctly, you get for the second one something among the lines of 
$$
f(x) = g( \frac 1 {sin(90} - \frac 1 {sin(x)}) 
$$
Where $g$ is your flipdim function. 
If understand what it does correctly your result should be along the lines of
$$
f(x) = - \frac 1 {sin(90} + \frac 1 {sin(x)}
$$
Though if I were you, I'd use 
$$
f(x)  = \frac 1 {sin(x)} - 1
$$
