infei2006
(Lingfei Li)
September 7, 2023, 8:42am
1
Here, I want to simplify the polynomial P1
P1 == \[Beta] (\[Omega]1 l2 + \[Omega]2 l1) +
2 \[Gamma] \[Omega]1 \[Omega]2 + k1 (\[Omega]2 + 4 k2^3) +
k2 (\[Omega]1 + 4 k1^3) + 6 k1^2 k2^2 +
6 l1 l2 + (k1^4 + k2^4 + k1 \[Omega]1 + k2 \[Omega]2 + 3 l1^2 +
3 l2^2 + \[Beta] (\[Omega]1 l1 + \[Omega]2 l2) + \[Gamma] (\
\[Omega]1^2 + \[Omega]2^2))
under the conditions mentioned below
Conditions :
k1 \[Omega]1 + k1^4 +
3 l1^2 + \[Gamma] \[Omega]1^2 + \[Beta] \[Omega]1 l1 == 0 &&
k2 \[Omega]2 + k2^4 +
3 l2^2 + \[Gamma] \[Omega]2^2 + \[Beta] \[Omega]2 l2 == 0
My code is
Assuming[
k1 \[Omega]1 + k1^4 +
3 l1^2 + \[Gamma] \[Omega]1^2 + \[Beta] \[Omega]1 l1 == 0 &&
k2 \[Omega]2 + k2^4 +
3 l2^2 + \[Gamma] \[Omega]2^2 + \[Beta] \[Omega]2 l2 == 0,
Simplify[(\[Omega]1 + \[Omega]2) (k1 + k2) + (k1 + k2)^4 +
3 (l1 + l2)^2 + \[Gamma] (\[Omega]1 + \[Omega]2)^2 + \[Beta] (\
\[Omega]1 + \[Omega]2) (l1 + l2)]]
It is obvious that the conditions make
(k1^4 + k2^4 + k1 \[Omega]1 + k2 \[Omega]2 + 3 l1^2 +
3 l2^2 + \[Beta] (\[Omega]1 l1 + \[Omega]2 l2) + \[Gamma] (\[Omega]1^2 + \
\[Omega]2^2))" equal to zero.
Therefore, P1 should become "\[Beta] (\[Omega]1 l2 + \[Omega]2 l1) + 2 \[Gamma] \[Omega]1 \[Omega]2 +
k1 (\[Omega]2 + 4 k2^3) + k2 (\[Omega]1 + 4 k1^3) + 6 k1^2 k2^2 + 6 l1 l2
However, the output looks different. How can I do such thing?
It is also posted at https://mathematica.stackexchange.com/questions/289866/using-exisiting-conditions-to-simplify-the-certain-part-of-polynomial
question2023.8.31.nb (9.54 KB)
mroge02
(Michael Rogers)
September 7, 2023, 12:56pm
2
I don’t have a solution for you, but I can explain why you cannot expect the desired output from Simplify[]. Simplify[] uses certain transformations to minimize the Simplify`SimplifyCount[] of the transformed expression. The count for the actual output is 35 and for the desired output is 45. So, if the input is ever transformed to the desired output, the transformation would be rejected in favor of the actual output.
Assuming[
k1 \[Omega]1 + k1^4 +
3 l1^2 + \[Gamma] \[Omega]1^2 + \[Beta] \[Omega]1 l1 == 0 &&
k2 \[Omega]2 + k2^4 +
3 l2^2 + \[Gamma] \[Omega]2^2 + \[Beta] \[Omega]2 l2 == 0,
Simplify[(\[Omega]1 + \[Omega]2) (k1 + k2) + (k1 + k2)^4 +
3 (l1 + l2)^2 + \[Gamma] (\[Omega]1 + \[Omega]2)^2 + \[Beta] (\
\[Omega]1 + \[Omega]2) (l1 + l2)]] // Simplify`SimplifyCount
\[Beta] (\[Omega]1 l2 + \[Omega]2 l1) +
2 \[Gamma] \[Omega]1 \[Omega]2 + k1 (\[Omega]2 + 4 k2^3) +
k2 (\[Omega]1 + 4 k1^3) + 6 k1^2 k2^2 +
6 l1 l2 // Simplify`SimplifyCount
(*
35
45
*)
There are options that might possibly be used (ComplexityFunction, TransformationFunctions) to attempt to get the desired output, but I don’t have ideas about how to do that successfully.
infei2006
(Lingfei Li)
September 7, 2023, 1:17pm
3
Thanks for your reply. It is an enlightening answer. Syed also replied this question at StackExchange(see the link attached above) that might be a solution.
Here is a way:
P1 = \[Beta] (\[Omega]1 l2 + \[Omega]2 l1) +
2 \[Gamma] \[Omega]1 \[Omega]2 + k1 (\[Omega]2 + 4 k2^3) +
k2 (\[Omega]1 + 4 k1^3) + 6 k1^2 k2^2 + 6 l1 l2 +
(k1^4 + k2^4 + k1 \[Omega]1 + k2 \[Omega]2 + 3 l1^2 +
3 l2^2 + \[Beta] (\[Omega]1 l1 + \[Omega]2 l2) +
\[Gamma] (\[Omega]1^2 + \[Omega]2^2));
conditions =
k1 \[Omega]1 + k1^4 +
3 l1^2 + \[Gamma] \[Omega]1^2 + \[Beta] \[Omega]1 l1 == 0 &&
k2 \[Omega]2 + k2^4 +
3 l2^2 + \[Gamma] \[Omega]2^2 + \[Beta] \[Omega]2 l2 == 0;
goal = \[Beta] (\[Omega]1 l2 + \[Omega]2 l1) +
2 \[Gamma] \[Omega]1 \[Omega]2 + k1 (\[Omega]2 + 4 k2^3) +
k2 (\[Omega]1 + 4 k1^3) + 6 k1^2 k2^2 + 6 l1 l2;
subst = {k1^4 -> k14, k2^4 -> k24};
sol = Solve[conditions /. subst, {k14, k24}]
P1 /. subst /. sol[[1]] /. Map[Reverse, subst]
% == goal // Simplify