Hi, All I have a function f(y) = (x'Ax + 2yx'a_i+y^2*a_ii)/(x'Bx + 2yx'b_i+y^2*b_ii), where A and B are known square matrix, a_i are the ith row of matrix A, a_ii are the ith row/column element of matrix A. what can I do to find a y to minize/maximize the ratio? Do optimize function? can I do a matrix decomposition, a more elegant solution? Thanks Pat