  We show that the effective brane-world and the loop quantum cosmology
background expansion histories can be reproduced from a modified gravity
perspective in terms of an $f(R)$ gravity action plus a $g(R)$ term
non-minimally coupled with the matter Lagrangian. The reconstruction algorithm
that we provide depends on a free function of the matter density that must be
specified in each case and allows to obtain analytical solutions always. In the
simplest cases, the function $f(R)$ is quadratic in the Ricci scalar, $R$,
whereas $g(R)$ is linear. Our approach is compared with recent results in the
literature. We show that working in the Palatini formalism there is no need to
impose any constraint that keeps the equations second-order, which is a key
requirement for the successful implementation of the reconstruction algorithm.
