#NEWLINE# def _solve_radical( f , symbol , solveset_solver ) : #NEWLINE# #INDENT# ' Helper function to solve equations with radicals ' #NEWLINE# ( eq , cov ) = unrad ( f ) #NEWLINE# if ( not cov ) : #NEWLINE# #INDENT# result = ( solveset_solver ( eq , symbol ) - Union ( * [ solveset_solver ( g , symbol ) for g in denoms ( f , [ symbol ] ) ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( y , yeq ) = cov #NEWLINE# if ( not solveset_solver ( ( y - I ) , y ) ) : #NEWLINE# #INDENT# yreal = Dummy ( 'yreal' , real = True ) #NEWLINE# yeq = yeq . xreplace ( { #NEWLINE# #INDENT# y : yreal , #NEWLINE# #UNINDENT# } ) #NEWLINE# eq = eq . xreplace ( { #NEWLINE# #INDENT# y : yreal , #NEWLINE# #UNINDENT# } ) #NEWLINE# y = yreal #NEWLINE# #UNINDENT# g_y_s = solveset_solver ( yeq , symbol ) #NEWLINE# f_y_sols = solveset_solver ( eq , y ) #NEWLINE# result = Union ( * [ imageset ( Lambda ( y , g_y ) , f_y_sols ) for g_y in g_y_s ] ) #NEWLINE# #UNINDENT# return FiniteSet ( * [ s for s in result if ( checksol ( f , symbol , s ) is True ) ] )