We introduce a new second order asymptotic function which gives information on teh convexity (concavity) of the original function from its behavior at infinity. We establish several properties and calculus rules for this concept, which differs from previous notions of second order asymptotic function. Finally, we apply our new definition in order to obtain necessary and sufficient condittions for quadratic programming and quadratic fractional programming.