code: def test_issue_11313():
      assert Integral(cos(x), x).series(x) == sin(x).series(x)
      assert Derivative(sin(x), x).series(x, n=3).doit() == cos(
          x
      ).series(x, n=3)
  
      assert Derivative(x**3, x).as_leading_term(x) == 3 * x**2
      assert Derivative(x**3, y).as_leading_term(x) == 0
      assert Derivative(sin(x), x).as_leading_term(x) == 1
      assert Derivative(cos(x), x).as_leading_term(x) == -x
  
      # This result is equivalent to zero, zero is not return because
      # `Expr.series` doesn't currently detect an `x` in its `free_symbol`s.
      assert Derivative(1, x).as_leading_term(x) == Derivative(1, x)
  
      assert Derivative(exp(x), x).series(x).doit() == exp(x).series(x)
      assert 1 + Integral(exp(x), x).series(x) == exp(x).series(x)
  
      assert Derivative(log(x), x).series(x).doit() == (1 / x).series(x)
      assert (
          Integral(log(x), x).series(x)
          == Integral(log(x), x).doit().series(x).removeO()
      )
  
imports: from sympy.core.evalf import N
  from sympy.core.function import Derivative, Function, PoleError, Subs
  from sympy.core.numbers import E, Float, Rational, oo, pi, I
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol, symbols
  from sympy.functions.elementary.exponential import LambertW, exp, log
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.trigonometric import atan, cos, sin
  from sympy.functions.special.gamma_functions import gamma
  from sympy.integrals.integrals import Integral, integrate
  from sympy.series.order import O
  from sympy.series.series import series
  from sympy.abc import x, y, n, k
  from sympy.testing.pytest import raises
  from sympy.core import EulerGamma
  from sympy.series.acceleration import richardson, shanks
  from sympy.concrete.summations import Sum
  from sympy.core.numbers import Integer
label_desc: Use image node_id 7 for calling a global function with example usage: test_issue_11313() without return types