Here's a procedure for it. Since I suspect that you only want to exclude the integral if the special function depends on the variable of integration, I included an optional second parameter for a variable name or set of variable names. The procedure is constructed with **subs** so that the calls to **FunctionAdvisor **and the construction of the set are only done once.

**has_special_math_function:= subs(
_F= {(op@FunctionAdvisor)~(FunctionAdvisor("class_members", "quiet"), "quiet")[]}
minus {FunctionAdvisor("elementary", "quiet")[]},
proc(e::algebraic, x::{name, set(name)}:= {})
hastype(e, And(specfunc(_F), dependent(x)))
end proc
);**
has_special_math_function := **proc** (e::algebraic, x::{name, set(name)} := {})
hastype(e, And(specfunc({AiryAi, AiryBi,
AngerJ, BellB, BesselI, BesselJ, BesselK, BesselY, Beta,
Chi, Ci, Dirac, Ei, GAMMA, HeunB, HeunC, HeunD, HeunG,
HeunT, Im, JacobiP, KummerM, KummerU, Li, MeijerG, Psi, Re,
Shi, Si, Ssi, StruveH, StruveL, WeberE, Zeta, abs, dawson,
dilog, erf, erfc, erfi, euler, fourier, hankel, hilbert,
laplace, lnGAMMA, max, mellin, min, polylog, signum,
unwindK, AppellF1, AppellF2, AppellF3, AppellF4, ChebyshevT,
ChebyshevU, CompleteBellB, CoulombF, CylinderD, CylinderU,
CylinderV, EllipticCE, EllipticCK, EllipticCPi, EllipticE,
EllipticF, EllipticK, EllipticModulus, EllipticNome,
EllipticPi, FresnelC, FresnelS, Fresnelf, Fresnelg,
GaussAGM, GegenbauerC, HankelH1, HankelH2, Heaviside,
HermiteH, HeunBPrime, HeunCPrime, HeunDPrime, HeunGPrime,
HeunTPrime, IncompleteBellB, InverseJacobiAM, InverseJacobiCD,
InverseJacobiCN, InverseJacobiCS, InverseJacobiDC,
InverseJacobiDN, InverseJacobiDS, InverseJacobiNC,
InverseJacobiND, InverseJacobiNS, InverseJacobiSC,
InverseJacobiSD, InverseJacobiSN, JacobiAM, JacobiCD,
JacobiCN, JacobiCS, JacobiDC, JacobiDN, JacobiDS, JacobiNC,
JacobiND, JacobiNS, JacobiSC, JacobiSD, JacobiSN,
JacobiTheta1, JacobiTheta2, JacobiTheta3, JacobiTheta4,
JacobiZeta, KelvinBei, KelvinBer, KelvinHei, KelvinHer,
KelvinKei, KelvinKer, LaguerreL, LambertW, LegendreP,
LegendreQ, LerchPhi, LommelS1, LommelS2, MathieuA, MathieuB,
MathieuC, MathieuCE, MathieuCEPrime, MathieuCPrime,
MathieuExponent, MathieuFloquet, MathieuS, MathieuSE,
MathieuSEPrime, MathieuSPrime, MultiPolylog, MultiZeta,
NielsenPolylog, SphericalY, Stirling1, Stirling2,
WeierstrassP, WeierstrassZeta, WhittakerM, WhittakerW,
Wrightomega, argument, bernoulli, binomial, conjugate,
doublefactorial, factorial, fouriercos, fouriersin,
harmonic, hypergeom, invfourier, invhilbert, invlaplace,
invmellin, multinomial, piecewise, pochhammer, GeneralizedPolylog,
MathieuFloquetPrime, WeierstrassPPrime, WeierstrassSigma}),
dependent(x)))
**end proc
**

You may want to exclude some functions such as **signum**, **abs**, **Re**, **Im**, **argument**, etc. from that set.