how to find sum of variable c1 + c2 + c3 for expression combinations:

a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3 == 45

a1 + a2 == 10

b1 + b2 == 3

a3 + b3 == 14

then find c1+c2+c3 by looking it this should give ans like c1 + c2 + c3 = 18 all variable and >0 integer only I also want to do more combination if possible.

=================

2

Eliminate[{a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3 == 45, a1 + a2 == 10 , b1 + b2 == 3, a3 + b3 == 14}, {a1, a2, a3, b1, b2, b3}]?

– kglr

Apr 22 at 20:36

it shows 18 – c2 – c3 == c1 and not this c1+c2+c3=18

– Mahesh Malva

Apr 22 at 20:38

try Simplify[c1 + c2 + c3, Assumptions -> Eliminate[{a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3 == 45, a1 + a2 == 10 , b1 + b2 == 3, a3 + b3 == 14}, {a1, a2, a3, b1, b2, b3}]]

– kglr

Apr 22 at 20:38

What if i what to find possibility of c1 c2 c3 separately or all variable

– Mahesh Malva

Apr 22 at 20:42

Maybe you require Reduce? Reduce[{a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3 == 45 && a1 + a2 == 10 && b1 + b2 == 3 && a3 + b3 == 14}][[1]] gives c1 == 18 – c2 – c3

– tomd

Apr 23 at 10:01

=================

2 Answers

2

=================

You could also do:

y /. ToRules@Reduce[{a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3 == 45,

a1 + a2 == 10,

b1 + b2 == 3,

a3 + b3 == 14,

c1 + c2 + c3 == y

}, {y}]

yields 18 (=c1+c2+c3=y)

Try this:

eq1 = a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3 == 45;

eq2 = a1 + a2 == 10;

eq3 = b1 + b2 == 3;

eq4 = a3 + b3 == 14;

Then

rule = {a1 -> x – a2, b1 -> y – b2, c1 -> z – c2 – c3, a3 -> t – b3};

Then

Solve[{eq1 /. rule, eq2 /. rule, eq3 /. rule, eq4 /. rule}, {x, y, z,

t}]

(* {{x -> 10, y -> 3, z -> 18, t -> 14}} *)

Done, have fun!