A function \( f(x, y) \) is defined as homogeneous of degree \( n \) if \( f(tx, ty) = t^n f(x, y) \). We will now evaluate each option.
Step 1: Consider the function \( y^2 - xy \).
Upon substituting \( x = tx \) and \( y = ty \), we get \( f(tx, ty) = (ty)^2 - (tx)(ty) = t^2y^2 - t^2xy = t^2(y^2 - xy) \).
This indicates homogeneity of degree 2.
Step 2: Consider the function \( x - 3y \).
Substituting \( x = tx \) and \( y = ty \) yields \( f(tx, ty) = tx - 3(ty) = t(x - 3y) \).
This indicates homogeneity of degree 1.
Step 3: Consider the function \( \sin^2 \left( \frac{y}{x} \right) + \frac{y}{x} \).
Substituting \( x = tx \) and \( y = ty \) results in \( f(tx, ty) = \sin^2 \left( \frac{ty}{tx} \right) + \frac{ty}{tx} = \sin^2 \left( \frac{y}{x} \right) + \frac{y}{x} \).
Since the function remains unchanged, it is homogeneous of degree 1.
Step 4: Consider the function \( \tan x - \sec y \).
Substituting \( x = tx \) and \( y = ty \) gives \( f(tx, ty) = \tan(tx) - \sec(ty) \).
This function does not exhibit scaling by any power of \( t \), and thus it is not homogeneous.
Therefore, \( \tan x - \sec y \) is not homogeneous, leading to option (D) as the correct choice.