(self, **hints)
return coeff*self.__class__(*([Mul(*rest)] + list(self.args[1:])))
Try to evaluate the transform in closed form.

        This general function handles linearity, but apart from that leaves
        pretty much everything to _compute_transform.

        Standard hints are the following:

        - ``simplify``: whether or not to simplify the result
        - ``noconds``: if True, don't return convergence conditions
        - ``needeval``: if True, raise IntegralTransformError instead of
                        returning IntegralTransform objects

        The default values of these hints depend on the concrete transform,
        usually the default is
        ``(simplify, noconds, needeval) = (True, False, False)``.
Try to evaluate the transform in closed form.
Try to evaluate the transform in closed form .
def doit(self, **hints):
        """
        Try to evaluate the transform in closed form.

        This general function handles linearity, but apart from that leaves
        pretty much everything to _compute_transform.

        Standard hints are the following:

        - ``simplify``: whether or not to simplify the result
        - ``noconds``: if True, don't return convergence conditions
        - ``needeval``: if True, raise IntegralTransformError instead of
                        returning IntegralTransform objects

        The default values of these hints depend on the concrete transform,
        usually the default is
        ``(simplify, noconds, needeval) = (True, False, False)``.
        """
        from sympy import Add, expand_mul, Mul
        from sympy.core.function import AppliedUndef
        needeval = hints.pop('needeval', False)
        try_directly = not any(func.has(self.function_variable)
                               for func in self.function.atoms(AppliedUndef))
        if try_directly:
            try:
                return self._compute_transform(self.function,
                    self.function_variable, self.transform_variable, **hints)
            except IntegralTransformError:
                pass

        fn = self.function
        if not fn.is_Add:
            fn = expand_mul(fn)

        if fn.is_Add:
            hints['needeval'] = needeval
            res = [self.__class__(*([x] + list(self.args[1:]))).doit(**hints)
                   for x in fn.args]
            extra = []
            ress = []
            for x in res:
                if not isinstance(x, tuple):
                    x = [x]
                ress.append(x[0])
                if len(x) > 1:
                    extra += [x[1:]]
            res = Add(*ress)
            if not extra:
                return res
            try:
                extra = self._collapse_extra(extra)
                return tuple([res]) + tuple(extra)
            except IntegralTransformError:
                pass

        if needeval:
            raise IntegralTransformError(
                self.__class__._name, self.function, 'needeval')

        # TODO handle derivatives etc

        # pull out constant coefficients
        coeff, rest = fn.as_coeff_mul(self.function_variable)
        return coeff*self.__class__(*([Mul(*rest)] + list(self.args[1:])))
def doit ( self , * * hints ) : from sympy import Add , expand_mul , Mul from sympy . core . function import AppliedUndef needeval = hints . pop ( 'needeval' , False ) try_directly = not any ( func . has ( self . function_variable ) for func in self . function . atoms ( AppliedUndef ) ) if try_directly : try : return self . _compute_transform ( self . function , self . function_variable , self . transform_variable , * * hints ) except IntegralTransformError : pass fn = self . function if not fn . is_Add : fn = expand_mul ( fn ) if fn . is_Add : hints [ 'needeval' ] = needeval res = [ self . __class__ ( * ( [ x ] + list ( self . args [ 1 : ] ) ) ) . doit ( * * hints ) for x in fn . args ] extra = [ ] ress = [ ] for x in res : if not isinstance ( x , tuple ) : x = [ x ] ress . append ( x [ 0 ] ) if len ( x ) > 1 : extra += [ x [ 1 : ] ] res = Add ( * ress ) if not extra : return res try : extra = self . _collapse_extra ( extra ) return tuple ( [ res ] ) + tuple ( extra ) except IntegralTransformError : pass if needeval : raise IntegralTransformError ( self . __class__ . _name , self . function , 'needeval' ) # TODO handle derivatives etc # pull out constant coefficients coeff , rest = fn . as_coeff_mul ( self . function_variable ) return coeff * self . __class__ ( * ( [ Mul ( * rest ) ] + list ( self . args [ 1 : ] ) ) )