0
$\begingroup$

I have a function of multiple variables (5 to be exact). I would like to know if this function is positive or negative given certain constraints on each of the 5 variables. Here is a simplified example:

f[a_,b_,c_,d_,e_] := (2a-b+(c^2)+d-(e*a)) / ((b+c-e)^2)

Is this positive or negative, given a>=1, b>=1, c>=1, 0<=d<=1, 0<=e<=1

I know there are tests such as Positive, but I'm unsure how to add constraints into those given that this is a mess of variables.

My example is relatively easy to do by hand, but the reality of my particular formula is much more complex. I feel that there is a way to do this, and further, for Mathematica to tell me if there is a range of each variable value over which the function is positive or negative.

Thank you for any assistance you can provide!

$\endgroup$
1
$\begingroup$

You can try something aling the lines of

Simplify[
 f[a, b, c, d, e] > 0,
 {a >= 1, b >= 1, c >= 1, 0 <= d <= 1, 0 <= e <= 1}
 ]

c^2 + d > b + a (-2 + e)

This means that it is undecidable with the current information whether f[a, b, c, d, e] is positive.

$\endgroup$
1
$\begingroup$

For this part of the question

"for Mathematica to tell me if there is a range of each variable value over which the function is positive or negative"

Maybe something like this, to get constraints on one variable, in terms of the other variables, that yield positive f?

Reduce[{f[a, b, c, d, e] > 0, b >= 1, c >= 1, 0 <= d <= 1, 0 <= e <= 1}, a]

c >= 1 && 0 <= e <= 1 && b >= 1 && 0 <= d <= 1 && a > (-b + c^2 + d)/(-2 + e)

$\endgroup$

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.