MATLAB: How to solve improper integral ‘1/sin(x)’ at region with variables

0 denominatorimproper integralinfinite value integral

I'd like to solve
syms x h
int(1/sin(x), x, h, 1) %%when 0<h<1
But matlab can't solve it. Probably because it doesn't consider the region of 'h'. So during the calculation it has infinite value.
Contrastively, the integral works for
syms x h
int(sin(x), x, h, 1)
ans =
cos(h) - cos(1)
Is there any good method to give simply a condition for 'h'?
As a second alternative plan(not really what i prefer,though) , i tried
syms x h
h=0.2:0.2:0.8;
int(1/sin(x), x, h, 1)
But It gave me errors for different reasons. I'll appreciate for any help. Thanks

Best Answer

For rational functions of trigonometric functions use the substitution z = tan(x/2) - see for example:
Related Question