1

How can one test a condition on an expression throughout a range? My true expression is rather complicated, but consider this minimal example:

Is the function $2 - x^2$ positive throughout the range $0<x<1$?

I thought this might work:

Assuming[0<x<1,
Positive[2 - x^2]]

but it just returned Positive[2 - x^2] when the solution I seek is True.

The best I've been able to find is:

Simplify[Sign[2-x^2], 0<x<1]

which might suffice for simple functions, but doesn't for my complicated one (which involves hypergeometric functions).

My function is, incidentally:

1/2 y (Sqrt[(1+2 (-1+y) y)/(-1+y)^2]+(3-6 y) Hypergeometric2F1[-(1/2),1/4,5/4,-(y^2/(-1+y)^2)])

There are lots of ugly hacks, such as trying to FindInstance that the function is ever negative in that range, trying to Solve for the value being $0$, and so on, but I'm sure there's a more elegant solution.

The linked similar problems are very helpful (thanks @Nasser), but they do not work on my real problem:

Reduce[ForAll[y, 0 <= y <= 1 \[Implies] 1/2 y (Sqrt[(1+2 (-1+y) y)/(-1+y)^2]+(3-6 y) Hypergeometric2F1[-(1/2),1/4,5/4,-(y^2/(-1+y)^2)])> 0]]
David G. Stork
  • 41,180
  • 3
  • 34
  • 96
  • 1
    ClearAll[x] f[x_] := 2 - x^2; Reduce[ForAll[x, 0 < x < 1, f[x] > 0]] gives True. see duplicate question where this is shown. – Nasser Jul 04 '21 at 06:15
  • Thanks so much for the link, but alas, the linked solutions do not work with my complicated expression, so I'm still at a loss. – David G. Stork Jul 04 '21 at 06:23
  • f[y] = (1/ 2 y (Sqrt[(1 + 2 (-1 + y) y)/(-1 + y)^2] + (3 - 6 y) Hypergeometric2F1[-(1/2), 1/4, 5/4, -(y^2/(-1 + y)^2)])); Minimize[{f[y], 0 <= y <= 1}, y] – cvgmt Jul 04 '21 at 07:33

1 Answers1

4

You could use FunctionRange:

FunctionRange[{2 - x^2, 0 < x < 1}, x, z]

1 < z < 2

For your more complicated example:

f = 1/2 y (Sqrt[(1+2 (-1+y) y)/(-1+y)^2]+(3-6 y) Hypergeometric2F1[-(1/2),1/4,5/4,-(y^2/(-1+y)^2)]);

FunctionRange[{f, 0 < y < 1}, y, z]

0 < z < 1/8 (-4 + (9 Gamma[3/4])/Gamma[7/4])

Carl Woll
  • 130,679
  • 6
  • 243
  • 355