How can I determine convexity of the function f = Log[ x, 1 + (x^a - 1) (x^b - 1)/(x - 1)] with the parameters $a,\,b$ belonging to the interval $(0,1)$ in Mathematica?
- 115,881
- 13
- 203
- 453
- 26,149
- 4
- 27
- 56
1 Answers
Let's define the function f suitably:
f[x_, a_, b_] := Log[x, 1 + (x^a - 1)*(x^b - 1)/(x - 1)]
We would have defined f with appropriate conditions (I recommend to examine this post: Placement of Condition /; expressions), e.g. f[x_, a_, b_] /; 0 < a < 1 && 0 < b < 1 && x > 0 := ... however since we are to deal with certain symbolic capabilities of the system I would rather choose the former way.
In order to test convexity of the function f we are interested in positivity of its second derivative with respect to x: D[ f[x, a, b], {x, 2}].
In such cases I'd use Reduce with certain assumptions, e.g.
Reduce[ D[ f[x, a, b], {x, 2}] <= 0 && 0 < a < 1 && 0 < b < 1 && x > 0, x]
nevertheless the second derivative of f is slightly involved and even restricting the domain of interest, symbolic treatment of the function with Reduce may appear to be too memory consuming ending up with:
No more memory available. Mathematica kernel has shut down. Try quitting other applications and then retry.
Alternatively we would exploit another approach using numerical estimates (see e.g. this answer Prove (or check) an expression is positive given constraints on variables?), since we expect that the second derivative should be positive wherever the constraint 0 < a < 1 && 0 < b < 1 && x > 0 is satisfied we would make use of NMinimize[{ f[x, a, b] ,cons},{ x, a, b}] finding a global minimum of f subject to the constraints given:
NMinimize[{ D[ f[ x, a, b], { x, 2}], 0 < a < 1, 0 < b < 1, x > 0}, {x, a, b}]
{0., { x -> 0.382136, a -> 0.85969, b -> 0.}}
We have found that the global minimum of the function is zero ( however the constraint 0 < b < 1 is satisfied numercally) thus we have demonstrated that f is convex at the domain of interest.
Another way would exploit FindMinimum, e.g.
FindMinimum[{ D[ f[ x, a, b], {x, 2}], 0 < a < 1, 0 < b < 1, x > 0},
{{x, 1/2}, {a, 1/2}, {b, 1/2}}]
{ 4.6312*10^-10, { x -> 3.10181, a -> 0.999902, b -> 0.999902}}
but one has to use it carefully since FindMinimum can search only local minimum of f.
NMinimizeapproach does not proof anything in terms of convexity. But if you are less interested in a real proof than in a numerical estimate that gives you an idea about the function being convex or not on the given intervals, you might want to compute the global Minimum of the second derivative on the given interval usingNMinimize. If this minimum is greater or equal to zero the function should be convex on the given domain. – Wizard Apr 24 '15 at 07:58