Solving trigonometric equations on a given interval