Check factoring answer with imaginary solutions

Students are factoring sum/difference of cubes and I’m trying to avoid using match the latex string to check correctness. For other factoring questions I am able to use simple function and evaluate at to check the solutions of the factors the students type, but not sure how to do this with sum/difference of cubes since the trinomial factor doesn’t have real solutions.

Slide one of this activity has an example of both what I already know how to do and the type of question I’m not sure how to check.

Use a simpleFunction in terms of x and i, treating i as a variable rather than sqrt(-1):
Say (x+3+2i)(x+3-2i). Here’s a sample check for each solution:

f= simpleFunction(input.latex,"x","i")
check1= f.evaluateAt(-5,1)=0 and f.evaluateAt(-1,-1)=0
check2= f.evaluateAt(-1,1)=0 and f.evaluateAt(-5, -1)=0