Question: Check if '=' is or is not in an equation or function

How do i check if an equation or function does not contain an '=' sign, to convert it?

if eq:= a+b=c

If it has an  '=' I can use eq1:=lhs(eq)-rhs(eq).

If eq=d+e+f there is no lhs/rhs and checking produces an error.

eq := a*x^2 + b*x = v;
                               2          
                      eq := a x  + b x = v

eq1 := lhs(eq) - rhs(eq);
                            2          
                         a x  + b x - v

eq2 := a*x^2 + b*x - v;
                               2          
                     eq1 := a x  + b x - v

lhs(eq1);
Error, invalid input: lhs received a*x^2+b*x-v, which is not valid for its 1st argument, expr
NULL;
has(eq,'=');
Error, invalid uneval
        Typesetting:-mambiguous(hasApplyFunction(eqcomma

          Typesetting:-mambiguous((equals), 

          Typesetting:-merror("invalid uneval"))))


has(eq2, rhs(eq2));
Error, invalid input: rhs received eq2, which is not valid for its 1st argument, expr
NULL;

 

Please Wait...