how to find sinusoidal function if its maximum and minimum