*2.2. Deducing Convexity*

First, we recall some well-known mathematical notions used in the rest of the paper. A function *f*(*x*) is *convex on an interval* [*a*, *b*] if

$$f(\lambda \mathbf{x}\_1 + (1 - \lambda)\mathbf{x}\_2) \le \lambda f(\mathbf{x}\_1) + (1 - \lambda)f(\mathbf{x}\_2). \tag{3}$$

for any *x*1, *x*2, *a* ≤ *x*<sup>1</sup> ≤ *x*<sup>2</sup> ≤ *b* and any *λ*, 0 ≤ *λ* ≤ 1. A function *f*(*x*) is called concave on the interval [*a*, *b*] if −*f*(*x*) is convex on [*a*, *b*].

Convexity plays an important role in optimization due to the following two observations. If a function is convex on some interval, then a minimum point of *f*(*x*) can be efficiently found by well elaborated local search techniques [43,44]. If a function *f*(*x*) is concave on [*a*, *<sup>b</sup>*], then min*x*∈[*a*,*b*] *<sup>f</sup>*(*x*) = min(*f*(*a*), *<sup>f</sup>*(*b*)).

If the function is two times differentiable, the convexity can be deduced from the second derivative. If one can prove that *f* (*x*) ≥ 0(≤ 0) on a segment [*a*, *b*], then *f*(*x*) is convex (concave) on this segment. However, if the function is nonsmooth, the convexity property should be computed in some other way. Even if *f*(*x*) is smooth, the accurate bounding of its second derivative can be a complicated task, and the convexity test becomes difficult.

The conical combination and the maximum of two functions are known to preserve convexity. The proof can be found in seminal books on convex analysis, e.g., [43]. For the sake of completeness, we reproduce these rules in the following Proposition 4.

**Proposition 4.** *Let f*(*x*) *and g*(*x*) *be convex functions on an interval* [*a*, *b*]*. Then, the following statements hold:*


The product of two convex functions is not always a convex function. For example, (*<sup>x</sup>* <sup>−</sup> <sup>1</sup>)(*x*<sup>2</sup> <sup>−</sup> <sup>4</sup>) is not convex while both *<sup>x</sup>* <sup>−</sup> 1 and *<sup>x</sup>*<sup>2</sup> <sup>−</sup> 4 are convex functions on <sup>R</sup>. In [45], it is proved that if *f* and *g* are two positive convex functions defined on an interval [*a*, *b*], then their product is convex provided that they are synchronous in the sense that

$$(f(x) - f(y))(\mathcal{g}(x) - \mathcal{g}(y)) \ge 0$$

for all *x*, *y* ∈ *I*. However checking this general property automatically is difficult. Instead, we propose the following sufficient condition that can be effectively evaluated.

**Proposition 5.** *Let f*(*x*) *and g*(*x*) *be convex positive functions on an interval* [*a*, *b*] *such that f*(*x*) *and g*(*x*) *are both nonincreasing or both nondecreasing. Then, the function h*(*x*) = *f*(*x*)*g*(*x*) *is convex on* [*a*, *b*]*.*

**Proof.** Consider *λ*, 0 < *λ* < 1 and *y* = *λa* + (1 − *λ*)*b*. Since *f*(*x*) and *g*(*x*) are convex, we get

> *f*(*y*) ≤ *f*(*b*) + *λ*(*f*(*a*) − *f*(*b*)), *g*(*y*) ≤ *g*(*b*) + *λ*(*g*(*a*) − *g*(*b*)).

Since *f*(*y*) ≥ 0 and *g*(*y*) ≥ 0, we get

$$h(y) = f(y)g(y) \le q(\lambda)\_\prime$$

where

$$q(\lambda) = (f(b) + \lambda(f(a) - f(b)))(\mathcal{g}(b) + \lambda(\mathcal{g}(a) - \mathcal{g}(b))))$$

is a quadratic function. Since *f*(*x*) and *g*(*x*) are both nonincreasing or both nondecreasing, we have that (*f*(*a*) − *f*(*b*))(*g*(*a*) − *g*(*b*)) ≥ 0. Therefore *q*(*λ*) is convex. Note that *q*(0) = *h*(*b*), *q*(1) = *h*(*a*). From convexity of *q*(*λ*), we obtain the following inequality:

$$q(\lambda) = q((1 - \lambda) \cdot 0 + \lambda \cdot 1) \le (1 - \lambda)q(0) + \lambda q(1) = \lambda h(a) + (1 - \lambda)h(b).$$

This completes the proof.

Propositions 4 and 5 can be readily reformulated for concave functions. The following Proposition gives rules for evaluating the convexity of a composite function.

**Proposition 6.** *Let f*(*x*) = *g*(*h*(*x*)) *and there be intervals* [*a*, *b*]*,* [*c*, *d*] *such that* R*h*([*a*, *b*]) ⊆ [*c*, *d*]*. Then, the following holds:*


The proof of the Proposition 6 can be found in numerous books for convex analysis, e.g., [43].

Many elementary functions are convex/concave on a whole domain of the definition, e.g., *ex*, ln *x*, *x<sup>n</sup>* for even natural *n*. For other functions, the intervals of concavity/convexity can be efficiently established as these function's behavior is well-known (Table 3).


**Table 3.** The convexity/concavity of elementary functions.

Propositions 4–6 enable an automated convexity deduction for composite functions, as the following examples show.

**Example 2.** *Consider the function <sup>f</sup>*(*x*) = <sup>2</sup>*<sup>x</sup>* <sup>+</sup> <sup>2</sup>−*<sup>x</sup> on the interval* [−1, 1]*. The function* <sup>2</sup>*<sup>x</sup> is convex on* [−1, 1] *and nondecreasing. The function* −*x is convex on* [−1, 1]*. According to the Proposition 6 function,* 2−*<sup>x</sup> is convex. Since* 2*<sup>x</sup> is also convex, we conclude (Proposition 4) that* 2*<sup>x</sup>* + 2−*<sup>x</sup> is convex.*

It is worth noting that the convexity can be proved by computing the interval bounds for the second derivative in the considered example. Indeed, *f* (*x*) = ln<sup>2</sup> (2)×2*<sup>x</sup>* <sup>+</sup> ln2 (2) 2*x* is obviously positive on [−1, 1]. Since there are plenty of tools for automatic differentiation and interval computations, the convexity can be proved automatically.

However, a convex function does not necessarily have derivatives in all points. Moreover, even if it is piecewise differentiable, locating the points where the function is not continuously differentiable can be difficult. Fortunately, the theory outlined above efficiently copes with such situations.

**Example 3.** *Consider the following function*

$$f(\mathbf{x}) = \max(\mathbf{x}, 2 - \sin(\mathbf{x})) + e^{-\mathbf{x}}$$

*on an interval* [0, *π*]*. Since* sin(*x*) *is concave on* [0, *π*]*, we conclude that* 2 − sin(*x*) *is convex on* [0, *<sup>π</sup>*]*. The convexity of <sup>e</sup>*−*<sup>x</sup> follows from the convexity of the linear function* <sup>−</sup>*<sup>x</sup> and the Proposition 6. From the convexity of x,* <sup>2</sup> <sup>−</sup> sin(*x*)*, <sup>e</sup>*−*<sup>x</sup> and Proposition <sup>4</sup> we derive that <sup>f</sup>*(*x*) *is convex.*

*Notice that automatic symbolic differentiation techniques cannot compute the derivative of f*(*x*) *because it involves computing the intersection points of x and* 2 − sin(*x*) *functions, which is a rather complex problem.*

#### **3. Application to Bounding the Function's Range**

An obvious application of the proposed techniques is the convexity/concavity test [26] that helps to eliminate the interval from the further consideration and reduce the number of steps of branch-and-bound algorithms. Consider the following problem:

$$f(\mathbf{x}) \to \min, \mathbf{x} \in [a, b]. \tag{4}$$

If the objective *f*(*x*) is concave on [*a*, *b*], then the global minimum can be easily computed as follows: *f*(*x*∗) = min(*f*(*a*), *f*(*b*)). If the concavity does not hold for the entire search region, the test can be used in branch-and-bound, interval Newton or other global minimization methods by applying it to subintervals of [*a*, *b*] processed by the algorithm.

However, if the objective is convex on [*a*, *b*], then any local minimum in [*a*, *b*] is a global minimum and can be easily found by a local search procedure. Since any continuously differentiable function is convex or concave on a sufficiently small interval, the convexity/concavity test can tremendously reduce the number of algorithm's steps by preventing excessive branching.

Another situation commonly encountered in practice occurs when a subexpression represents a convex/concave function while the entire function is not convex neither concave. For example, the function 0.5 − *cos*(*x*) is convex on interval [−*π*/2, *π*/2] while (0.5 <sup>−</sup> *cos*(*x*))<sup>3</sup> is not. In such cases, the interval cannot be discarded by the convexity/concavity test. Nevertheless, the convexity and concavity can be used to compute tight upper and lower bounds for the sub-expression yielding better bounds for the entire function.

For computing upper and lower bounds, recall that a convex function graph always lies above any of its tangents. This property and the convexity definition yield the Proposition 7.
