ordinary differential equations – Solving Inhomogeneous Nonlinear First Order ODE with Power on the Derivative and Factors into Two Linear ODEs

I was recently playing around with a problem for fun(as one does in grad school) and came across an inhomogeneous nonlinear ODE and I’m hoping someone can explain how to solve it:
$$
y^{2}-left(1+f(x)right)yfrac{dy}{dx}+f(x)frac{dy}{dx}^{2} = left( y-frac{dy}{dx} right) left( y-f(x)frac{dy}{dx} right)=k
$$

I’ve looked through most of my books that I would think touch on it… 2 different undergrad ODE books(Zill and Haberman), 2 Dynamical Systems books (Verhulst and Sternberg), and Nonlinear ODEs by Jordan and Smith… but with no luck.

I’m really at a loss on this. I just don’t know how to go about solving an ODE of this form. Nor, it appears, do my textbooks.

For w/e it’s worth, thus far, Dr. Google has only delivered answers for how to solve cases without a power on the derivative. Which the profs in my dept, whom I’ve asked thus far, also scratched their heads at.

Any help would be greatly appreciated.