code: def test_integrate():
      x = symbols("x")
      R, Dx = DifferentialOperators(ZZ.old_poly_ring(x), "Dx")
      p = expr_to_holonomic(sin(x) ** 2 / x, x0=1).integrate((x, 2, 3))
      q = "0.166270406994788"
      assert sstr(p) == q
      p = expr_to_holonomic(sin(x)).integrate((x, 0, x)).to_expr()
      q = 1 - cos(x)
      assert p == q
      p = expr_to_holonomic(sin(x)).integrate((x, 0, 3))
      q = 1 - cos(3)
      assert p == q
      p = expr_to_holonomic(sin(x) / x, x0=1).integrate((x, 1, 2))
      q = "0.659329913368450"
      assert sstr(p) == q
      p = expr_to_holonomic(sin(x) ** 2 / x, x0=1).integrate((x, 1, 0))
      q = "-0.423690480850035"
      assert sstr(p) == q
      p = expr_to_holonomic(sin(x) / x)
      assert p.integrate(x).to_expr() == Si(x)
      assert p.integrate((x, 0, 2)) == Si(2)
      p = expr_to_holonomic(sin(x) ** 2 / x)
      q = p.to_expr()
      assert p.integrate(x).to_expr() == q.integrate((x, 0, x))
      assert p.integrate((x, 0, 1)) == q.integrate((x, 0, 1))
      assert expr_to_holonomic(1 / x, x0=1).integrate(
          x
      ).to_expr() == log(x)
      p = (
          expr_to_holonomic((x + 1) ** 3 * exp(-x), x0=-1)
          .integrate(x)
          .to_expr()
      )
      q = (-(x**3) - 6 * x**2 - 15 * x + 6 * exp(x + 1) - 16) * exp(
          -x
      )
      assert p == q
      p = (
          expr_to_holonomic(cos(x) ** 2 / x**2, y0={-2: [1, 0, -1]})
          .integrate(x)
          .to_expr()
      )
      q = -Si(2 * x) - cos(x) ** 2 / x
      assert p == q
      p = expr_to_holonomic(sqrt(x**2 + x)).integrate(x).to_expr()
      q = (
          x ** Rational(3, 2) * (2 * x**2 + 3 * x + 1)
          - x * sqrt(x + 1) * asinh(sqrt(x))
      ) / (4 * x * sqrt(x + 1))
      assert p == q
      p = expr_to_holonomic(sqrt(x**2 + 1)).integrate(x).to_expr()
      q = (sqrt(x**2 + 1)).integrate(x)
      assert (p - q).simplify() == 0
      p = expr_to_holonomic(1 / x**2, y0={-2: [1, 0, 0]})
      r = expr_to_holonomic(1 / x**2, lenics=3)
      assert p == r
      q = expr_to_holonomic(cos(x) ** 2)
      assert (r * q).integrate(x).to_expr() == -Si(2 * x) - cos(
          x
      ) ** 2 / x
  
imports: from sympy.holonomic import DifferentialOperator, HolonomicFunction, DifferentialOperators, from_hyper, from_meijerg, expr_to_holonomic
  from sympy.holonomic.recurrence import RecurrenceOperators, HolonomicSequence
  from sympy.core import EulerGamma
  from sympy.core.numbers import I, Rational, pi
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol, symbols
  from sympy.functions.elementary.exponential import exp, log
  from sympy.functions.elementary.hyperbolic import asinh, cosh
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.trigonometric import cos, sin
  from sympy.functions.special.bessel import besselj
  from sympy.functions.special.beta_functions import beta
  from sympy.functions.special.error_functions import Ci, Si, erf, erfc
  from sympy.functions.special.gamma_functions import gamma
  from sympy.functions.special.hyper import hyper, meijerg
  from sympy.printing.str import sstr
  from sympy.series.order import O
  from sympy.simplify.hyperexpand import hyperexpand
  from sympy.polys.domains.integerring import ZZ
  from sympy.polys.domains.rationalfield import QQ
  from sympy.polys.domains.realfield import RR
label_desc: Use image node_id 17 for calling a global function with example usage: test_integrate() without return types