code: def rs_compose_add(p1, p2):
      """
      compute the composed sum ``prod(p2(x - beta) for beta root of p1)``
  
      Examples
      ========
  
      >>> from sympy.polys.domains import QQ
      >>> from sympy.polys.rings import ring
      >>> from sympy.polys.ring_series import rs_compose_add
      >>> R, x = ring('x', QQ)
      >>> f = x**2 - 2
      >>> g = x**2 - 3
      >>> rs_compose_add(f, g)
      x**4 - 10*x**2 + 1
  
      References
      ==========
  
      .. [1] A. Bostan, P. Flajolet, B. Salvy and E. Schost
             "Fast Computation with Two Algebraic Numbers",
             (2002) Research Report 4579, Institut
             National de Recherche en Informatique et en Automatique
      """
      R = p1.ring
      x = R.gens[0]
      prec = p1.degree() * p2.degree() + 1
      np1 = rs_newton(p1, x, prec)
      np1e = rs_hadamard_exp(np1)
      np2 = rs_newton(p2, x, prec)
      np2e = rs_hadamard_exp(np2)
      np3e = rs_mul(np1e, np2e, x, prec)
      np3 = rs_hadamard_exp(np3e, True)
      np3a = (np3[(0,)] - np3) / x
      q = rs_integrate(np3a, x)
      q = rs_exp(q, x, prec)
      q = _invert_monoms(q)
      q = q.primitive()[1]
      dp = p1.degree() * p2.degree() - q.degree()
      # `dp` is the multiplicity of the zeroes of the resultant;
      # these zeroes are missed in this computation so they are put here.
      # if p1 and p2 are monic irreducible polynomials,
      # there are zeroes in the resultant
      # if and only if p1 = p2 ; in fact in that case p1 and p2 have a
      # root in common, so gcd(p1, p2) != 1; being p1 and p2 irreducible
      # this means p1 = p2
      if dp:
          q = q * x**dp
      return q
  
imports: from sympy.polys.domains import QQ, EX
  from sympy.polys.rings import PolyElement, ring, sring
  from sympy.polys.polyerrors import DomainError
  from sympy.polys.monomials import monomial_min, monomial_mul, monomial_div, monomial_ldiv
  from mpmath.libmp.libintmath import ifac
  from sympy.core import PoleError, Function, Expr
  from sympy.core.numbers import Rational
  from sympy.core.intfunc import igcd
  from sympy.functions import sin, cos, tan, atan, exp, atanh, tanh, log, ceiling
  from sympy.utilities.misc import as_int
  from mpmath.libmp.libintmath import giant_steps
  import math
label_desc: Use image node_id 47 for calling a global function with example usage: rs_compose_add(p1, p2) and returns: q