Suppose that I have a continuous function $f: [-1,1] \to \mathbb{R}$, such that $f(0) =1$. We denote with $f_+$ the function that coincides with $f$ between its first non-positive and positive roots, and vanish (i.e. it it set equal to zero) everywhere else.
Is there some simple way to plot $f_+$ in Mathematica without having to determine numerically the roots of $f$?
Is there some simple way to integrate numerically $f_+$ over [-1,1]?
(f can be any continuous function, take for example f(x) = sin(10x) if you wish)
UPDATE: added one further question
RegionFunction
$\endgroup$vanish
, does it mean it goes to 0, $-\infty$ or it simply disappears from the screen? $\endgroup$