Even though x/(x+1)^2 is not convex on the whole real line, it can be shown that it is convex for x>=2.

How can i formulate let’s say the following problem in CVX?

‘minimize x/(x+1)^2

subject to 2<=x<=3’

Even though x/(x+1)^2 is not convex on the whole real line, it can be shown that it is convex for x>=2.

How can i formulate let’s say the following problem in CVX?

‘minimize x/(x+1)^2

subject to 2<=x<=3’

1/x^2 (convex using DCP)

You cannot, I’m afraid. CVX requires convexity over the entire natural domain of the function.

I’m marking this with the “nonconvex” tag. You are indeed correct that the function is convex for x \geq 2. But it still bumps up against the limitations of CVX that are explained in the FAQ. In particular, the most straightforward representation of this function in terms of CVX “atoms” is f(x) = 1/(x+1) - 1/(x+1)^2, the difference of two convex functions, and CVX cannot handle that.