code: def remove_redundant_sols(sol1, sol2, x):
      """
      Helper function to remove redundant
      solutions to the differential equation.
      """
      # If y1 and y2 are redundant solutions, there is
      # some value of the arbitrary constant for which
      # they will be equal
  
      syms1 = sol1.atoms(Symbol, Dummy)
      syms2 = sol2.atoms(Symbol, Dummy)
      num1, den1 = [
          Poly(e, x, extension=True)
          for e in sol1.together().as_numer_denom()
      ]
      num2, den2 = [
          Poly(e, x, extension=True)
          for e in sol2.together().as_numer_denom()
      ]
      # Cross multiply
      e = num1 * den2 - den1 * num2
      # Check if there are any constants
      syms = list(e.atoms(Symbol, Dummy))
      if len(syms):
          # Find values of constants for which solutions are equal
          redn = linsolve(e.all_coeffs(), syms)
          if len(redn):
              # Return the general solution over a particular solution
              if len(syms1) > len(syms2):
                  return sol2
              # If both have constants, return the lesser complex solution
              elif len(syms1) == len(syms2):
                  return (
                      sol1
                      if count_ops(syms1) >= count_ops(syms2)
                      else sol2
                  )
              else:
                  return sol1
  
imports: from itertools import product
  from sympy.core import S
  from sympy.core.add import Add
  from sympy.core.numbers import oo, Float
  from sympy.core.function import count_ops
  from sympy.core.relational import Eq
  from sympy.core.symbol import symbols, Symbol, Dummy
  from sympy.functions import sqrt, exp
  from sympy.functions.elementary.complexes import sign
  from sympy.integrals.integrals import Integral
  from sympy.polys.domains import ZZ
  from sympy.polys.polytools import Poly
  from sympy.polys.polyroots import roots
  from sympy.solvers.solveset import linsolve
label_desc: Use image node_id 21 for calling a global function with example usage: remove_redundant_sols(sol1, sol2, x) and returns: sol2, unknown, sol1