<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _costfcn(self, x):
 """ Evaluates the objective function, gradient and Hessian for OPF. """

        f = self._f(x)
        df = self._df(x)
        d2f = self._d2f(x)

        return f, df, d2f