How to express the function "1/(exp(x^2)-1)"

The function 1/(exp(x^2)-1) is surely convex if x>0. Because the second derivative of this function is (2exp(x^2)(2x^2exp(x^2) - exp(x^2) + 2*x^2 + 1))/(exp(x^2) - 1)^3, which is greater than zero. How can I express this function in cvx? Thank you.


t\geq \frac{1}{e^x-1},\quad x>0

is equivalent to

1\geq e^{-x}+\frac{1}{1+t}

which can be written almost verbatim

1 >= exp(-x) + inv_pos(1+t)

However your variant with x^2 seems much harder. Maybe you can reformulate the whole model somehow to avoid the square.

Thanks a lot! This function comes from “1/xlog(1+1/y)<=z", which is equivalent to “log(1+1/y)<=t^2<=xz”. It seems that this transformation does not simplify the problem. What about the initial function "f(x,y) = 1/xlog(1+1/y)”? This function is also a convex function. Maybe there are some ideas to handle it in cvx?

1 Like

Interesting and convex on x,y>0 but I am not sure it can be done. For example one natural approach would be

z\geq \frac{1}{x}\cdot \frac{1}{s},\quad \frac{1}{s}\geq \log(1+\frac{1}{y})

but the last constraint is y\geq \frac{1}{e^{1/s}-1}. That is something we have seen asked before and generally believe that it cannot be expressed with the current cones (or nobody was clever enough to do so). I suspect your function might also end up with this status. Who knows.

I have known that this problem is difficult. Thanks for your replying!