How to modify the domain of an equation?

18 Views Asked by At

How can I modify the equation of say $y=sin(x)$ s.t
for $x<a, y<0$,
for $a<x<b, y=sin(x)$
and for $x>b, y<0$?

Basically I want an equation to only appear on the interval $[a;b]$. In other words, shrinking down the domain to the $[a;b]$ interval by modifying the equation itself.