def chain_1(df_dg, dg_dx):
if np.all(dg_dx==<NUM_LIT:1.>):<EOL><INDENT>return df_dg<EOL><DEDENT>return df_dg * dg_dx<EOL>
Generic chaining function for first derivative

.. math::
    \\frac{d(f . g)}{dx} = \\frac{df}{dg} \\frac{dg}{dx}