I need to express in CVX the function ((1/x) -(1/y))^(-1) which is convex in x and y, for y > x > 0.

However, after trying many methods, CVX still failed to recognize it.

Is there any possible way?

Section 3.2.7 “Harmonic mean” of Mosek Modeling Cookbook https://docs.mosek.com/modeling-cookbook/cqo.html#conic-quadratic-modeling . You’ve got a factor of n = 2 to adjust vs.that.

Do you mean represent it as the tranformation of harmonic mean?

If so, this does no match my case.

The function ((1/x) -(1/y))^(-1) is actually convex for y > x > 0, while the harmonic mean is concave.

I’m afraid your suggestion may not work.

Whoop, I misread the - as +

Your expression equals \frac{x^2}{y-x} +x with positive denominator so quad-over-lin does the job.

Great! Thanks so much!