# Finding the range of variable over which a function is negative

How can I find the range of variable $x$ (between 0 and 1) such that the value of a certain function is negative?

For example, let $f(x,y,z)=xy+xz-y$. How do I determine the sub-interval of $(0,\,1)$ such that $f(x,y,z) < 0,\ y=2,\ z=1$?

• Check Reduce – Anjan Kumar Nov 24 '17 at 15:27
• Surely you don't need Mathematica to solve this, because $f(x, 2, 1) = -2+3x$. – murray Nov 24 '17 at 15:51
• Thank you so much sir, Anjan Kumar. – Dauood Saleem Nov 24 '17 at 15:57
• Murray sir, I used just a small arbitrary example for understanding. – Dauood Saleem Nov 24 '17 at 15:58
• @DauoodSaleem Are you aware that you can upvote and accept answers if they solve your problem? It's the best way to say thanks to the people who took the time to help you. Check this link for more details. – aardvark2012 Nov 25 '17 at 10:45

f[x_, y_, z_] := x y + x z - y

Reduce[f[x, 2, 1] < 0 && 0 <= x <= 1]
Simplify[f[x, 2, 1] < 0 && 0 <= x <= 1]
Simplify @ Resolve[f[x, 2, 1] < 0 && 0 <= x <= 1]


all give

0 <= x < 2/3

As suggested:

Reduce[x y + x z - y < 0 && 0 < x < 1, x]

(*
(y < 0 && z < 0 && y/(y + z) < x < 1) || (y == 0 && z < 0 && 0 < x < 1)
|| (y > 0 && ((z <= 0 && 0 < x < 1) || (z > 0 && 0 < x < y/(y + z))))
*)

• Thank you so much sir. – Dauood Saleem Nov 24 '17 at 16:24