Symbolic expression simplification and shortening
I have an extremely long symbolic expression after simplification which I am unable to simplify further. I want to know how to reduce the expression further, or to find repeating sub expressions inside the expression which can be replaced by another variable?
For an example, my expression looks somewhat like this:
U =
108*A^2*e^7*e1^3*e2^7*h2^4 + 153*A^2*e^7*e1^5*e2^7*h2^2 + 108*A^2*e^7*e1^7*e2^3*h3^4 + 153*A^2*e^7*e1^7*e2^5*h3^2 +…
24*B^2*e^3*e1^7*e2^7*h1^4 + 95*B^2*e^5*e1^7*e2^7*h1^2 + 24*B^2*e^7*e1^3*e2^7*h2^4 + 95*B^2*e^7*e1^5*e2^7*h2^2 + …
24*B^2*e^7*e1^7*e2^3*h3^4 + 95*B^2*e^7*e1^7*e2^5*h3^2 + 9*A^2*e^2*e1^7*h1^5*h3^7 + 9*A^2*e^2*e2^7*h1^5*h2^7 +…
9*A^2*e1^2*e2^7*h1^7*h2^5 + 9*A^2*e^7*e1^2*h2^5*h3^7 + 9*A^2*e^7*e2^2*h2^7*h3^5 + 9*A^2*e1^7*e2^2*h1^7*h3^5 -…
41*B^2*e^2*e1^7*h1^5*h3^7 – 41*B^2*e^2*e2^7*h1^5*h2^7 – 12*B^2*e^4*e1^7*h1^3*h3^7 – 12*B^2*e^4*e2^7*h1^3*h2^7 -….
41*B^2*e1^2*e2^7*h1^7*h2^5 – 12*B^2*e1^4*e2^7*h1^7*h2^3 – 41*B^2*e^7*e1^2*h2^5*h3^7 – 12*B^2*e^7*e1^4*h2^3*h3^7 – …
41*B^2*e^7*e2^2*h2^7*h3^5 – 12*B^2*e^7*e2^4*h2^7*h3^3 – 41*B^2*e1^7*e2^2*h1^7*h3^5 – 12*B^2*e1^7*e2^4*h1^7*h3^3 -…
504*A^2*e^3*h1^4*h2^7*h3^7 + 9*A^2*e^5*h1^2*h2^7*h3^7 – 504*A^2*e1^3*h1^7*h2^4*h3^7 + 9*A^2*e1^5*h1^7*h2^2*h3^7 -…
504*A^2*e2^3*h1^7*h2^7*h3^4 + 9*A^2*e2^5*h1^7*h2^7*h3^2 + 2860*B^2*e^3*h1^4*h2^7*h3^7 – 377*B^2*e^5*h1^2*h2^7*h3^7 +…
2860*B^2*e1^3*h1^7*h2^4*h3^7 – 377*B^2*e1^5*h1^7*h2^2*h3^7 + 2860*B^2*e2^3*h1^7*h2^7*h3^4 – 377*B^2*e2^5*h1^7*h2^7*h3^2 +…
162*A*B*e^7*e1^7*e2^7 – 6*A*B*e^7*h2^7*h3^7 – 6*A*B*e1^7*h1^7*h3^7 – 6*A*B*e2^7*h1^7*h2^7 + 1944*A^2*e*h1^6*h2^7*h3^7 + …
1944*A^2*e1*h1^7*h2^6*h3^7 + 1944*A^2*e2*h1^7*h2^7*h3^6 – 5400*B^2*e*h1^6*h2^7*h3^7 – 5400*B^2*e1*h1^7*h2^6*h3^7 -…
245*B^2*e^6*e1^7*e2^4*h1*h3^3 + 147*B^2*e^7*e1*e2^3*h2^6*h3^4 + 48*B^2*e^7*e1*e2^5*h2^6*h3^2 – 60*B^2*e^7*e1^2*e2^6*h2^5*h3 + …
147*B^2*e^7*e1^3*e2*h2^4*h3^6 – 245*B^2*e^7*e1^4*e2^6*h2^3*h3 + 48*B^2*e^7*e1^5*e2*h2^2*h3^6 – 60*B^2*e^7*e1^6*e2^2*h2*h3^5 -…
where e , e1, e2, h1, h2, h3, A, B are the symbolic variables.I have an extremely long symbolic expression after simplification which I am unable to simplify further. I want to know how to reduce the expression further, or to find repeating sub expressions inside the expression which can be replaced by another variable?
For an example, my expression looks somewhat like this:
U =
108*A^2*e^7*e1^3*e2^7*h2^4 + 153*A^2*e^7*e1^5*e2^7*h2^2 + 108*A^2*e^7*e1^7*e2^3*h3^4 + 153*A^2*e^7*e1^7*e2^5*h3^2 +…
24*B^2*e^3*e1^7*e2^7*h1^4 + 95*B^2*e^5*e1^7*e2^7*h1^2 + 24*B^2*e^7*e1^3*e2^7*h2^4 + 95*B^2*e^7*e1^5*e2^7*h2^2 + …
24*B^2*e^7*e1^7*e2^3*h3^4 + 95*B^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^6 – 5400*B^2*e*h1^6*h2^7*h3^7 – 5400*B^2*e1*h1^7*h2^6*h3^7 -…
245*B^2*e^6*e1^7*e2^4*h1*h3^3 + 147*B^2*e^7*e1*e2^3*h2^6*h3^4 + 48*B^2*e^7*e1*e2^5*h2^6*h3^2 – 60*B^2*e^7*e1^2*e2^6*h2^5*h3 + …
147*B^2*e^7*e1^3*e2*h2^4*h3^6 – 245*B^2*e^7*e1^4*e2^6*h2^3*h3 + 48*B^2*e^7*e1^5*e2*h2^2*h3^6 – 60*B^2*e^7*e1^6*e2^2*h2*h3^5 -…
where e , e1, e2, h1, h2, h3, A, B are the symbolic variables. I have an extremely long symbolic expression after simplification which I am unable to simplify further. I want to know how to reduce the expression further, or to find repeating sub expressions inside the expression which can be replaced by another variable?
For an example, my expression looks somewhat like this:
U =
108*A^2*e^7*e1^3*e2^7*h2^4 + 153*A^2*e^7*e1^5*e2^7*h2^2 + 108*A^2*e^7*e1^7*e2^3*h3^4 + 153*A^2*e^7*e1^7*e2^5*h3^2 +…
24*B^2*e^3*e1^7*e2^7*h1^4 + 95*B^2*e^5*e1^7*e2^7*h1^2 + 24*B^2*e^7*e1^3*e2^7*h2^4 + 95*B^2*e^7*e1^5*e2^7*h2^2 + …
24*B^2*e^7*e1^7*e2^3*h3^4 + 95*B^2*e^7*e1^7*e2^5*h3^2 + 9*A^2*e^2*e1^7*h1^5*h3^7 + 9*A^2*e^2*e2^7*h1^5*h2^7 +…
9*A^2*e1^2*e2^7*h1^7*h2^5 + 9*A^2*e^7*e1^2*h2^5*h3^7 + 9*A^2*e^7*e2^2*h2^7*h3^5 + 9*A^2*e1^7*e2^2*h1^7*h3^5 -…
41*B^2*e^2*e1^7*h1^5*h3^7 – 41*B^2*e^2*e2^7*h1^5*h2^7 – 12*B^2*e^4*e1^7*h1^3*h3^7 – 12*B^2*e^4*e2^7*h1^3*h2^7 -….
41*B^2*e1^2*e2^7*h1^7*h2^5 – 12*B^2*e1^4*e2^7*h1^7*h2^3 – 41*B^2*e^7*e1^2*h2^5*h3^7 – 12*B^2*e^7*e1^4*h2^3*h3^7 – …
41*B^2*e^7*e2^2*h2^7*h3^5 – 12*B^2*e^7*e2^4*h2^7*h3^3 – 41*B^2*e1^7*e2^2*h1^7*h3^5 – 12*B^2*e1^7*e2^4*h1^7*h3^3 -…
504*A^2*e^3*h1^4*h2^7*h3^7 + 9*A^2*e^5*h1^2*h2^7*h3^7 – 504*A^2*e1^3*h1^7*h2^4*h3^7 + 9*A^2*e1^5*h1^7*h2^2*h3^7 -…
504*A^2*e2^3*h1^7*h2^7*h3^4 + 9*A^2*e2^5*h1^7*h2^7*h3^2 + 2860*B^2*e^3*h1^4*h2^7*h3^7 – 377*B^2*e^5*h1^2*h2^7*h3^7 +…
2860*B^2*e1^3*h1^7*h2^4*h3^7 – 377*B^2*e1^5*h1^7*h2^2*h3^7 + 2860*B^2*e2^3*h1^7*h2^7*h3^4 – 377*B^2*e2^5*h1^7*h2^7*h3^2 +…
162*A*B*e^7*e1^7*e2^7 – 6*A*B*e^7*h2^7*h3^7 – 6*A*B*e1^7*h1^7*h3^7 – 6*A*B*e2^7*h1^7*h2^7 + 1944*A^2*e*h1^6*h2^7*h3^7 + …
1944*A^2*e1*h1^7*h2^6*h3^7 + 1944*A^2*e2*h1^7*h2^7*h3^6 – 5400*B^2*e*h1^6*h2^7*h3^7 – 5400*B^2*e1*h1^7*h2^6*h3^7 -…
245*B^2*e^6*e1^7*e2^4*h1*h3^3 + 147*B^2*e^7*e1*e2^3*h2^6*h3^4 + 48*B^2*e^7*e1*e2^5*h2^6*h3^2 – 60*B^2*e^7*e1^2*e2^6*h2^5*h3 + …
147*B^2*e^7*e1^3*e2*h2^4*h3^6 – 245*B^2*e^7*e1^4*e2^6*h2^3*h3 + 48*B^2*e^7*e1^5*e2*h2^2*h3^6 – 60*B^2*e^7*e1^6*e2^2*h2*h3^5 -…
where e , e1, e2, h1, h2, h3, A, B are the symbolic variables. symbolic, expr, collect, simplify MATLAB Answers — New Questions