Hot answers tagged

11

To find the intervals for which f[x] is positive f[x_] = -x^3 + x^2 + 7*x; g[x_] = Piecewise[{{f[x], f[x] > 0}}, I]; Plot[{f[x], g[x]}, {x, -3, 4}, PlotStyle -> {Directive[Red, Dashed], Blue}] FunctionDomain[g[x], x] (* x < (1/2)*(1 - Sqrt[29]) || 0 < x < (1/2)*(1 + Sqrt[29]) *) % // N (* x < -2.19258 || 0. < x < ...


10

tl;dr If these functions cannot decide, they will simply return False. A False result means that the selected equality testing method wasn't able to prove equality, but it does not mean that it was able to prove inequality. Interpret the result relative to the used SameTest option value. I will try to explain what I think is happening, though some of ...


7

I like the answers using Reduce and FunctionDomain. Here's a numerical possibility that uses Minimize to find the global minimum on the domain and tests to see if it's positive. f[x_] = -x^3 + x^2 + 7*x; 0 <= First@Minimize[{f[x], 0 <= x <= 4}, x] (* False *) Alternatively, if needed, you can use NMinimize: NMinimize[{f[x], 0 <= x <= 4}, ...



Only top voted, non community-wiki answers of a minimum length are eligible