# Separate variables in equation

I need to know is there a way to separate the desired variables in the equation at one side of the equality. For instance, the following equation

(E^(-Subscript[λ, 0]*Subscript[T, 1]) (Subscript[λ, 0]*Subscript[T, 1])^x)/x!*
(E^(-Subscript[λ, 0]*Subscript[T, 2]) (Subscript[λ, 0]*Subscript[T, 2])^y)/y!*
(E^(-(Subscript[λ, 0] + Subscript[λ, 0])*Subscript[T, 3])
((Subscript[λ, 0] + Subscript[λ, 0])*Subscript[T, 3])^z)/z! =
(E^(-Subscript[λ, 1]*Subscript[T, 1]) (Subscript[λ, 1]*Subscript[T, 1])^x)/x!*
(E^(-Subscript[λ, 1]*Subscript[T, 2]) (Subscript[λ, 1]*Subscript[T, 2])^y)/y!*
(E^(-(Subscript[λ, 1] + Subscript[λ, 1])*Subscript[T, 3])
((Subscript[λ, 1] + Subscript[λ, 1])*Subscript[T, 3])^z)/z!


can be written as

x + y + z = ((Subscript[λ, 1] - Subscript[λ, 0])*Subscript[T, 1] +
(Subscript[λ, 1] - Subscript[λ, 0])*Subscript[T, 2] +
2*(Subscript[λ, 1] - Subscript[λ, 0]) Subscript[T, 3])/
Log[Subscript[λ, 1]/Subscript[λ, 0]]


How to perform the above separation of variables in mathematica?

It could be done in one variable, but how to separate when we have more than one variable?

There is no single command that accomplishes the simplification desired. However, a string of commands can accomplish it. To begin, cast the two equations into the proper syntax by replacing = by ==. Then, name the first equation f for convenience, Divide one side of the equation by the other, take the Log of the result, FullSimplify, and divide by the Log term.

Collect[FullSimplify[Log[Divide @@ f], x > 0 && y > 0 && z > 0 &&
Subscript[T, 1] > 0 && Subscript[T, 2] > 0 && Subscript[T, 3] > 0 &&
Subscript[λ, 0] > 0 && Subscript[λ, 1] > 0]
/ Log[Subscript[λ, 0]/Subscript[λ, 1]], x + y + z]

(* x + y + z - ((Subscript[T, 1] + Subscript[T, 2] +
2 Subscript[T, 3]) (Subscript[λ, 0] - Subscript[λ, 1]))/
Log[Subscript[λ, 0]/Subscript[λ, 1]] *)


Specifying that the variables are positive is necessary so that Mathematica does not have issues with branch cuts. (Also, as noted by Jack LaVigne, "the division step created an equation with 1 on one side of the equality and then the logarithm operation converted it to zero".)

Another approach is to Subtract the Log of each side of f, FullSimplify, and Solve for x + y +z, which gives the same result as before.

Solve[(FullSimplify[Subtract @@ (Log[List @@ f]), x > 0 && y > 0 && z > 0 &&
Subscript[T, 1] > 0 && Subscript[T, 2] > 0 && Subscript[T, 3] > 0 &&
Subscript[λ, 0] > 0 && Subscript[λ, 1] > 0] /. x + y + z -> w) == 0, w][[1, 1]]
/. w -> x + y + z /. Rule -> Equal


Incidentally, I do not recommend using Subscript variables in Mathematica calculations. They may look good but sometimes cause needless problems.