2
$\begingroup$

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$?

$\endgroup$
  • 2
    $\begingroup$ Check Reduce $\endgroup$ – Anjan Kumar Nov 24 '17 at 15:27
  • $\begingroup$ Surely you don't need Mathematica to solve this, because $f(x, 2, 1) = -2+3x$. $\endgroup$ – murray Nov 24 '17 at 15:51
  • $\begingroup$ Thank you so much sir, Anjan Kumar. $\endgroup$ – Dauood Saleem Nov 24 '17 at 15:57
  • $\begingroup$ Murray sir, I used just a small arbitrary example for understanding. $\endgroup$ – Dauood Saleem Nov 24 '17 at 15:58
  • $\begingroup$ @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. $\endgroup$ – aardvark2012 Nov 25 '17 at 10:45
2
$\begingroup$
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

$\endgroup$
1
$\begingroup$

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)))) 
*)
$\endgroup$
  • $\begingroup$ Thank you so much sir. $\endgroup$ – Dauood Saleem Nov 24 '17 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.