I am trying to do algebra the way we do by hand. For example,
test1=(x - b^2 + 3/(x-a)) + ((x+b)^2/((x-a)*(x+a))+z+(x+x)^3/(x-a))
test2=(x-a)*(x+a)
test3=test2*test1
output is:
(x-a)*(x+a)*(x - b^2 + 3/(x-a)) + ((x+b)^2/((x-a)*(x+a))+z+(x+x)^3/(x-a))
but it should be:
(x*(x-a)*(x+a) - b^2*(x-a)*(x+a) + 3*(x+a)) + ((x+b)^2)+z*(x-a)*(x+a)+(x+x)^3*(x+a))
I have tried Distribute, Factor, Cancel, Simplify but all of them expand everything and do not remove the denominator. It also removes the powers in terms. How to tell mathematica to eliminate denominator and without expanding numerators?
Apart[test3]orSimplify@Apart[test3]? – user1066 Jun 12 '17 at 15:38test2 # & /@ test1,Block[{test2}, Distribute[test2*test1]],Distribute[factor*test1] /. factor -> test2,Module[{p}, Distribute[test3 /. #] /. Reverse@# &[test2 -> p]]. – jkuczm Jun 13 '17 at 14:05