# Simplify expressions with constraints

I have the following expression to simplify

$$k_1 c_1^4 + k_{12} c_1^2c_2^2 + k_2 c_2^4$$

using the conditions

$$c_1^2 = c_{11}$$ $$c_2^2 = c_{22}$$ $$c_1 c_2 = c_{12}$$

and I would like to write the expression above as

$$k_1 c_{11}^2 + k_{12} c_{12} + k_2 c_{22}^2$$

How can I do it with Mathematica?

One way:

eqs = {f == k1 c1^4 + k12 c1^2 c2^2 + k2 c2^4,c1^2 == c11, c2^2 == c22, c1 c2 == c12};
Reduce[Eliminate[eqs, {c1, c2}], f]


(c22 == 0 && c12 == 0 && f == c11^2 k1) || (c22 != 0 && c11 == c12^2/c22 && f == c11^2 k1 + c12^2 k12 + c22^2 k2)

Simplify[%, c22 != 0]


c12^2 == c11 c22 && f == c11^2 k1 + c12^2 k12 + c22^2 k2

Try this:

expr = k1 c1^4 + k12 c1^2 c2^2 + k2 c2^4;
expr /. {c1 -> Sqrt[c11], c2 -> Sqrt[c22], c1^2*c2^2 -> c12^2}

(*  c11^2 k1 + c12^2 k12 + c22^2 k2  *)


Have fun!

• Is this right though? what if $c_1\vee c_2<0$? – Feyre Aug 12 '16 at 11:16
• @ Feyre I see no problem in this case. – Alexei Boulbitch Aug 12 '16 at 11:46
• From $c_{1}^2=c_{11}$ follows $\left| c_1\right|=\sqrt{c_1}$. It's a matter of proper proof. – Feyre Aug 12 '16 at 13:09
• @Feyre And the result of the transformation in question will be different? – Alexei Boulbitch Aug 12 '16 at 13:33
• Well, no. Just that I'd be cautious of doing something like that. – Feyre Aug 12 '16 at 13:56