You can use coeffs() to probe.
coeffs will error if it thinks that the input is not a polynomial, so be prepared for that. It is plausible that coeffs might not be able to prove that an expression is polynomial for sufficiently complex expressions.
If the result from coeffs 'all' has more than two entries then the expression is not linear.
If the result from coeffs 'all' has one entry then the expression is constant in the variable.
If the result from coeffs 'all' is length two then the expression is linear in the variable.
You need to know which variable to ask for. For example A^2*x + B is linear in x and in B but not in A.
There are other approaches.
c0 = subs(y, x, 0)
c1 = subs(y, x, 1)
factor = c1-c0
c2 = subs(y, x, 2)
Now if c2 - c0 is not 2*factor to within roundoff then y is not linear in x. If c2 - c0 is not factor then y is not constant in x.
But the reverse is not true: 2*factor could be satisfied by something nonlinear. For example x*(x-1)*(x-2) would be 0 at 1 and at 2, and 2*0 = 0. So these kinds of probes of values cannot prove linearity.
