docstr: Checks that integration result can be differentiated.
docstr_tok: ["Checks","that","integration","result","can","be","differentiated","."]
code: def _test_gradient(self, integrate_function, args):
      """Checks that integration result can be differentiated."""
  
      # We consider I(a) = int_0^1 cos(ax) dx.
      # Then dI/da = (a*cos(a) - sin(a))/a^2.
      def integral(a):
          return integrate_function(
              lambda x: tf.cos(a * x),
              0.0,
              1.0,
              dtype=tf.float64,
              **args,
          )
  
      a = tf.constant(0.5, dtype=tf.float64)
      di_da = tff.math.fwd_gradient(integral, a)
  
      true_di_da = lambda a: (a * np.cos(a) - np.sin(a)) / (a**2)
      self.assertAllClose(self.evaluate(di_da), true_di_da(0.5))
  
imports: import collections
  import math
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
  from tf_quant_finance.math.integration import adaptive_update
label_desc: Use image node_id 6 for calling the IntegrationTest obj's underlying member method code with example usage: obj._test_gradient(integrate_function, args) and returns: integrate_function