def solve_undetermined_coeffs(equ, coeffs, sym, **flags):
 if isinstance(equ, Equality):
  equ = (equ.lhs - equ.rhs)
 equ = cancel(equ).as_numer_denom()[0]
 system = list(collect(equ.expand(), sym, evaluate=False).values())
 if (not any((equ.has(sym) for equ in system))):
  return solve(system, *coeffs, **flags)
 else:
  return None

def solve_undetermined_coeffs ( equ , coeffs , sym , ** flags ) : if isinstance ( equ , Equality ) : equ = ( equ . lhs - equ . rhs ) equ = cancel ( equ ) . as_numer_denom ( ) [ 0 ] system = list ( collect ( equ . expand ( ) , sym , evaluate = False ) . values ( ) ) if ( not any ( ( equ . has ( sym ) for equ in system ) ) ) : return solve ( system , * coeffs , ** flags ) else : return None
solve equation of a type p == q(x) where both p .