Function: bothcoef (<expr>, <x>) Returns a list whose first member is the coefficient of <x> in <expr> (as found by
ratcoef if <expr> is in CRE form otherwise by
coeff) and whose second member is the remaining part of <expr>. That is,
[A, B] where
<expr> = A*<x> + B.
(%i1) islinear (expr, x) := block ([c], c: bothcoef (rat (expr, x), x), is (freeof (x, c) and c # 0))$ (%i2) islinear ((r^2 - (x - r)^2)/x, x); (%o2) true
(%o1) true (%i2)
expr: z^3 + a1*z*w + ...
expr : subst (expr,z,...
bothcoef (expand (exp...