  The $f(R)$ theory of gravity can be expressed as a scalar tensor theory with
a scalar degree of freedom $\phi$. By a conformal transformation, the action
and its Gibbons-York-Hawking boundary term are written in the Einstein frame
and the field equations are found. An effective potential is defined from part
of the trace of the field equations in such a way that it can be calculated as
an integral of a purely geometric term. This potential as well as the scalar
potential are found, plotted and analyzed for some viable models of $f(R)$ and
for two other proposed new, shown viable, models.
