Given expression such as \(3+(1+x)\sin x\) or \(3+(1+x)\sin ^2 x\) use select to find any polynomial * sin^n
subexpressions.
restart; mytype_1 := ''`*`'( {polynom(And(algebraic, satisfies(u -> not has(u, I))),x), Or( 'specfunc(sin)'^integer, 'specfunc(sin)') } )'; select(type, 3+(1+x)*sin(x),mytype_1); select(type, 3+(1+x)*sin(x)^2,mytype_1);
Gives