Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I know the function $$f(x,y)=\frac{y^2}{xy+1}$$ with $x>0$,$y>0$ is convex or not?

share|cite|improve this question
Have you looked at the Hessian matrix? If it is positive semidefinite, $f$ is convex. – Michael Greinecker Mar 12 '12 at 20:37
I checked the Hessian matrix, but unfortunately it is indefinite. – Xiangyu Meng Mar 12 '12 at 20:51
So the two eigenvalues of the Hessian have opposite signs, meaning one eigenvalue is negative. The function will be concave in the direction of the corresponding eigenspace. – Harald Hanche-Olsen Mar 12 '12 at 21:18
Thanks for your answer. I think it is a good suggestion. – Xiangyu Meng Mar 12 '12 at 22:13
up vote 13 down vote accepted

Consider $y=x$ then we have $\displaystyle g(x)=\frac{x^2}{x^2+1}=1-\frac 1{x^2+1}$

The second derivative of this is $g''(x)=\frac{2-6x^2}{(1+x^2)^3}$ and will change sign around $x=\frac 1{\sqrt{3}}$ so that $g$ is convex in $(0,\frac 1{\sqrt{3}})$ and concave in $(\frac 1{\sqrt{3}},\infty)$.

Your function is clearly not convex nor concave on $(\mathbb{R^{+*}})^2$ but you could search more restricted sets if needed...

Here is a picture (from below) of your function (convex near $y=0$ and concave when $y$ becomes larger at least in the x=y direction, in the x=-y direction it looks convex...) :


share|cite|improve this answer
Thanks very much! – Xiangyu Meng Mar 12 '12 at 22:25

The book "Convex Optimization" by Boyd, available free online here, describes methods to check.

The standard definition is if f(θx + (1 − θ)y) ≤ θf(x) + (1 − θ)f(y) for 0≤θ≤1 and the domain of x,y is also convex.

So if you could prove that for your function, you would know it's convex.

The Hessian being positive semi-definite, as mentioned in comments, would also show that the function is convex.

See page 67 of the book for more.

share|cite|improve this answer
Your answer is not useful. I think checking the eigenvalue of the Hessian matrix maybe a good approach. – Xiangyu Meng Mar 12 '12 at 22:13
It is a very good book on the subject if you wish to go deeper than simple calculus. – Nick Alger Mar 12 '12 at 22:26
Using the standard definition is almost always completely useless. The only time it is useful is if you have a function which is not continuous in its second derivative (or it doesn't exist) then you can rule out it is convex if you can numerically find a counter-example simply by randomly evaluating SEVERAL points. But this isn't generally practical or fun, nor can it ever prove a function IS convex, only that it isn't if you happen to find a counter-example. – Squirtle Jul 29 '13 at 23:47

The Hessian of $\frac{y^2}{1+xy}$ is $$ H = \frac1{(1+xy)^3}\begin{bmatrix} 2y^4&-y^2(3+xy)\\[12pt] -y^2(3+xy)&2 \end{bmatrix} $$ and $$ \begin{bmatrix} u&v \end{bmatrix} H \begin{bmatrix} u\\v \end{bmatrix} =\frac2{(1+xy)^3}(v-uy^2)^2-\frac1{(1+xy)^2}uvy^2 $$ Setting $\begin{bmatrix}u&v\end{bmatrix}=\begin{bmatrix}1&y^2\end{bmatrix}$ gives $$ \begin{bmatrix} 1&y^2 \end{bmatrix} H \begin{bmatrix} 1\\y^2 \end{bmatrix} =-\frac{y^4}{(1+xy)^2} $$ so $\frac{y^2}{1+xy}$ is not convex as long as $y\ne0$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.