  We derive a new interior solution for stellar compact objects in
$f\mathcal{(R)}$ gravity assuming a differential relation to constrain the
Ricci curvature scalar. To this aim, we consider specific forms for the radial
component of the metric and the first derivative of $f\mathcal{(R)}$. After,
the time component of the metric potential and the form of $f(\mathcal R)$
function are derived. From these results, it is possible to obtain the radial
and tangential components of pressure and the density. The resulting interior
solution represents a physically motivated anisotropic neutron star model. It
is possible to match it with a boundary exterior solution. From this matching,
the components of metric potentials can be rewritten in terms of a compactness
parameter $C$ which has to be $C=2GM/Rc^2 <<0.5$ for physical consistency.
Other physical conditions for real stellar objects are taken into account
according to the solution. We show that the model accurately bypasses
conditions like the finiteness of radial and tangential pressures, and energy
density at the center of the star, the positivity of these components through
the stellar structure, and the negativity of the gradients. These conditions
are satisfied if the energy-conditions hold. Moreover, we study the stability
of the model by showing that Tolman-Oppenheimer-Volkoff equation is at
hydrostatic equilibrium. The solution is matched with observational data of
millisecond pulsars with a withe dwarf companion and pulsars presenting
thermonuclear bursts.
