# 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.

This

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