When the density of a static spherically symmetric perfect fluid is a function of the radial coordinate, the Oppenheimer-Volkoff (OV) equation turns into a Riccati equation- If a particular solution of the OV equation is given, it can be transformed into an integrable Bernoulli equation, we can obtain a general exact solution and an other particular solution of the OV equation- Further more, the exact interior solutions of Einstein field equation for the perfect fluid sphere are also obtained, i-e- the analytical expressions of the metric compone nts-