MATLAB: How to simplify this complex equation using matlab

large equationsimplify

I am begineer user of Matlab. My friend recommend me to use matlab to solve large calculation. So, I start using it. Can someone give me advice how to solve this problem as shown below. Thank you very much. I'm looking forward to see your advice.
9*a^6*l – ((a^2*l*(b – 1)*(720*b^4*e^2 – 1440*b^3*e^2 + 720*b^2*e^2))/5 – (a^2*l*r*(b – 1)*(120*a^2*b^2*e – 120*a^2*b*e + 1440*b^4*e^2 + 120*b^4*e – 2880*b^3*e^2 – 360*b^3*e + 1440*b^2*e^2 + 240*b^2*e))/5)/r^2 – (9*a^7*l)/5 – a*l*(3*a + a*(a^2 – 1) – 12*a*e*(1/r – 1)*(b – 1)^2)^2 + 6*a^3*l*(3*a + a*(a^2 – 1) – 12*a*e*(1/r – 1)*(b – 1)^2) + b*l*(3*a + a*(a^2 – 1) – 12*a*e*(1/r – 1)*(b – 1)^2)^2 – a^3*l^3*((12*a^2)/l^2 + (2*a*(3*a + a*(a^2 – 1) – 12*a*e*(1/r – 1)*(b – 1)^2))/l^2) + b^3*l^3*((12*a^2)/l^2 + (2*a*(3*a + a*(a^2 – 1) – 12*a*e*(1/r – 1)*(b – 1)^2))/l^2) – 9*a^2*b^4*l + (9*a^2*b^5*l)/5 + a*l*(a*(a – 1)*(a – 2) + 12*a*e*(1/r – 1)*(b – 1)^2)^2 + (9*a^5*l*(a – 1)^2)/5 + 2*a^3*l*(a*(a – 1)*(a – 2) + 12*a*e*(1/r – 1)*(b – 1)^2)*(a – 1) – 6*a*b^2*l*(3*a + a*(a^2 – 1) – 12*a*e*(1/r – 1)*(b – 1)^2) – (a^2*l*(b – 1)*(5*a^4 + 120*a^2*b^2*e + 10*a^2*b^2 – 120*a^2*b*e – 20*a^2*b + 720*b^4*e^2 + 120*b^4*e + 9*b^4 – 1440*b^3*e^2 – 360*b^3*e – 36*b^3 + 720*b^2*e^2 + 240*b^2*e + 44*b^2 – 16*b + 4))/5

Best Answer

  • syms a b e l r
    Eq = 9*a^6*l - ((a^2*l*(b - 1)*(720*b^4*e^2 - 1440*b^3*e^2 + 720*b^2*e^2))/5 - (a^2*l*r*(b - 1)*(120*a^2*b^2*e - 120*a^2*b*e + 1440*b^4*e^2 + 120*b^4*e - 2880*b^3*e^2 - 360*b^3*e + 1440*b^2*e^2 + 240*b^2*e))/5)/r^2 - (9*a^7*l)/5 - a*l*(3*a + a*(a^2 - 1) - 12*a*e*(1/r - 1)*(b - 1)^2)^2 + 6*a^3*l*(3*a + a*(a^2 - 1) - 12*a*e*(1/r - 1)*(b - 1)^2) + b*l*(3*a + a*(a^2 - 1) - 12*a*e*(1/r - 1)*(b - 1)^2)^2 - a^3*l^3*((12*a^2)/l^2 + (2*a*(3*a + a*(a^2 - 1) - 12*a*e*(1/r - 1)*(b - 1)^2))/l^2) + b^3*l^3*((12*a^2)/l^2 + (2*a*(3*a + a*(a^2 - 1) - 12*a*e*(1/r - 1)*(b - 1)^2))/l^2) - 9*a^2*b^4*l + (9*a^2*b^5*l)/5 + a*l*(a*(a - 1)*(a - 2) + 12*a*e*(1/r - 1)*(b - 1)^2)^2 + (9*a^5*l*(a - 1)^2)/5 + 2*a^3*l*(a*(a - 1)*(a - 2) + 12*a*e*(1/r - 1)*(b - 1)^2)*(a - 1) - 6*a*b^2*l*(3*a + a*(a^2 - 1) - 12*a*e*(1/r - 1)*(b - 1)^2) - (a^2*l*(b - 1)*(5*a^4 + 120*a^2*b^2*e + 10*a^2*b^2 - 120*a^2*b*e - 20*a^2*b + 720*b^4*e^2 + 120*b^4*e + 9*b^4 - 1440*b^3*e^2 - 360*b^3*e - 36*b^3 + 720*b^2*e^2 + 240*b^2*e + 44*b^2 - 16*b + 4))/5
    Eqs = simplify(Eq, 'Steps', 250)
    Eqs =
    (24*a^2*e*l*(b - 1)^2*(4*a - 2*b - 12*b*e + 12*b^2*e - 7*a^2 + 4*a^3 + b^2))/r - (4*a^2*l*(2*a^4 + 120*a^3*b^2*e - 240*a^3*b*e + 120*a^3*e - 6*a^3 - 210*a^2*b^2*e + 420*a^2*b*e - 210*a^2*e + 5*a^2 + 120*a*b^2*e - 240*a*b*e + 120*a*e + 180*b^4*e^2 + 30*b^4*e - 540*b^3*e^2 - 120*b^3*e + 540*b^2*e^2 + 150*b^2*e - 180*b*e^2 - 60*b*e - 1))/5 - (144*a^2*b*e^2*l*(b - 1)^3)/r^2