# Solving a set of equations containing sums of logarithms

I'm trying to solve a set of $J+1$ equations for variables $x,y_1,\ldots,y_J$. The equations are as follows: \begin{align*} \sum_j\sum_i\frac{1}{a_{ij}}\log\left(\frac{a_{ij}}{x+y_j}\right)&=MN\\ \left(N-\sum_i\frac{1}{a_{ij}}\log\left(\frac{a_{ij}}{x+y_j}\right)\right)y_j&=0,\,\,j=1,\ldots,J \end{align*} where each $a_{ij}>0$ and $x>0, y_j\ge0$. The logarithms are base $e$. Note that we cannot divide the second set of equations by $y_j$ because some may be zero. I've tried rearranging the equations using $\log\left(\frac{a_{ij}}{x+y_j}\right) = \log(a_{ij}) - \log(x+y_j)$ but it doesn't seem to help. Any ideas?

Attempt:

Using properties of logarithm and exponential functions, I've managed to write the equations as \begin{align*} \prod_j\prod_i\left(\frac{a_{ij}}{{x+y_j}}\right)^{1/a_{ij}}&=\exp(MN)\\ \prod_i\left(\frac{a_{ij}}{{x+y_j}}\right)^{y_j/a_{ij}}&=\exp(Ny_j),\,\,j=1,\ldots,J \end{align*} This looks nicer, but it doesn't appear to lead anywhere.

An alternate approach:

Based on N74's comments, by defining $z_j = \log(x+y_j)$, we can alternatively write the equations as \begin{align*} \sum_j\sum_i\left[\frac{\log(a_{ij})}{a_{ij}}-\frac{z_j}{a_{ij}}\right]&=MN\\ \left(N-\sum_i\left[\frac{\log(a_{ij})}{a_{ij}}-\frac{z_j}{a_{ij}}\right]\right)(\exp(z_j)-x)&=0 \end{align*} Defining $A = N-\sum_i\frac{\log(a_{ij})}{a_{ij}}$, $B = \sum_j\sum_i\frac{\log(a_{ij})}{a_{ij}}-MN$, and $c_j=\sum_i\frac{1}{a_{ij}}>0$, we have \begin{align*} \sum_jc_jz_j &= B\\ (A+c_jz_j)(\exp(z_j)-x)&=0,\,\,j=1,\ldots,J \end{align*} This is where I run into trouble.

• Did you try using $z_i=\log (x+y_i)$? – N74 Jun 9 '18 at 21:22
• @N74 I did not, but just gave it a shot. I get $\sum_j\sum_i\frac{1}{a_{ij}}\log\left(\frac{a_{ij}}{z_j}\right)=MN$ and $(N-\sum_i\frac{1}{a_{ij}}\log\left(\frac{a_{ij}}{z_j}\right))(\exp(z_j)-x)=0$. Trying to see where I can go from here. Perhaps I can look at cases with the second set of equations? – jonem Jun 9 '18 at 21:39
• Be careful: the $z_i$ are outside of the logarithms. The first equation and the factor inside the parentheses are linear combinations of $z_i$. – N74 Jun 9 '18 at 21:48
• @N74 Right. So the correct set of equations are $\sum_j\sum_i\left[\frac{\log(a_{ij})}{a_{ij}}-\frac{z_j}{a_{ij}}\right]=MN$ and $\left(N-\sum_i\left[\frac{\log(a_{ij})}{a_{ij}}-\frac{z_j}{a_{ij}}\right]\right)(\exp(z_j)-x)=0$. – jonem Jun 9 '18 at 21:54
• Now it seems possible to find the solutions (as much as $2^J$ solutions): to satisfy the $0$ equality you have either $x=e^{z_j}$ or ${z_j=q_j}$, with $q_j$ a combination of the coefficients. – N74 Jun 9 '18 at 22:11

Using your definitions: $$z_j = \log(x+y_j)$$ $$A = N-\sum_i\frac{\log(a_{ij})}{a_{ij}}$$ $$B = \sum_j\sum_i\frac{\log(a_{ij})}{a_{ij}}-MN$$ $$c_j=\sum_i\frac{1}{a_{ij}}>0,$$ we want to solve: \begin{align*} \sum_jc_jz_j &= B\\ (A+c_jz_j)(\exp(z_j)-x)&=0,\,\,j=1,\ldots,J \end{align*}. To make null a product we need that one of the factors is null, so we have a solution when $z_j=\log x$ and another solution for $z_j=-{A\over c_j}$, for each $j$ in $[1,J]$.
1. All $y_j$ are null: In this case $z_j=\log x$ so $$\sum_jc_j\log x = B$$ $$x=\exp {B \over \sum_jc_j}$$
2. Only $y_{j^*}$ is not null: In this case $z_j=\log x$ for $j\neq j_*$ and $c_{j^*}z_{j^*}=-A$ so $$\sum_{j\neq j^*}c_j\log x = B+A$$ $$x=\exp {B+A \over \sum_{j\neq {j^*}}c_j}$$ $$y_{j^*}=\exp {-A \over c_{j^*}}-x$$
3. All $y_j$ are not null: In this case $c_jz_j = -A$ so the first equation becomes $$-JA=B.$$ This equation doesn't depend on the unknowns, so the system is either impossible (${B\neq -JA}$), or undetermined ($x$ cannot be fixed).
Obviously you can find all the other solutions by just fixing how many $y_j$are not null.