How to get partial expression from symbolic expression containing specific variable MAPLE?
问题 I have a symbolic expressions as below y1 = (1/a)-(b/a^2)+x*a*b-x/b y2 = a*b+a*x+b*sqrt(x) now I need to get the partial expressions which have specific term. Like xFunction(y1, x) # should return x*a*b-x/b xFunction(y2,x) # should return a*x+b*sqrt(x) any suggestions or idea are very healpful Thank you 回答1: restart; y1 := (1/a)-(b/a^2)+x*a*b-x/b: y2 := a*b+a*x+b*sqrt(x): K := (ee,x) -> `if`(ee::`+`,select(depends,ee,x),ee): K( y1, x ); x x a b - - b K( y2, x ); (1/2) a x + b x # # Leave