# Writing geo_mean( (1+x/y) ^x )

Dear All,
I want to write a constraint in this form (x>0 and y>0): geo_mean( (1+x/y) ^x )
I think the objective function is convex: (1+x/y)^x
Is it possible to write this constraint in cvx?
Thanks alot

geo_mean takes a vector as its argument. What vector is the argument of geo_mean?

Then are you claiming convexity, or concavity of that expression, and do you have a proof?

Anyhow, presuming you don’t intend to have geo_mean at all, and are interested in the convex expression, `(1+x/y)^x`, that can be handled as
`(1+x/y)^x = exp(x*log((1+x/y))) = exp(rel_entr(x+y,y) + rel_entr(y,x+y))`
where the latter makes use of the result by @Michal_Adamaszek
`x*log(1+x/y) = rel_entr(x+y,y) + rel_entr(y,x+y)` in your previous question Writing x*log(1+x/y) .

You can use either `exp(rel_entr(x+y,y) + rel_entr(y,x+y))` or `rel_entr(x+y,y) + rel_entr(y,x+y)`, depending on which you want, and avoid CVX’s successive approximation method. To do so, install CVXQUAD https://github.com/hfawzi/cvxquad and its `exponential.m` replacement for CVX’s version, as described on the CVXQUAD page.
Instances of `rel_entr` will then be handled through CVXQUAD’s Pade approximant, which seems in my experience to be much faster and more robust than CVX’s successive approximation method,