4. The function $y=a \cos x+b(a, b$ are constants $)$ has a maximum value of 1 and a minimum value of $-7, y=$ $3+a b \sin x$ has a maximum value of $\qquad$.
4. 15 . From the conditions, we know that $-|a|+b=-7, |a|+b=1, b=-3, |a|=4, y=3+a b \sin x$ has a maximum value of $|a||b|+3=15$.