How to check if a function is convex?

112 Views Asked by At

Are the following functions convex?

$$\dfrac{1}{x-y} \tag{1}$$

$$\dfrac{(z-0.5x-0.5y)}{(0.866y-0.866x)^{2}+(z-0.5x-0.5y)^{2}} \tag{2}$$

Notice that for function $(1)$ the $[x,y]H[x,y]^{T}$ (where $H$ is the Hessian matrix) is as follow

$$\dfrac{2x^{2}+2y^{2}}{(x-y)^{3}}$$

so if $x<y$ then $[x,y]H[x,y]^{T}<0$ is this means that it is not convex?

These are constraints in my optimization problem and I want to check if my problem is convex or not.