# How to solve this system with logarithms?

I mean a symbolic solution of $$\frac{\log \left(x^2+10 x+25\right)}{\log (y-10)}+\frac{\log \left(y^2-20 y+100\right)}{\log (x+5)}=4\land \frac{\log (2 x+9)}{\log (y-10)}+\frac{\log (23-2 y)}{\log (x+5)}=2$$ over the reals. The Reduce command fails with it:

Reduce[Log[x + 5, y^2 - 20 y + 100] + Log[y - 10, x^2 + 10 x + 25] == 4 &&
Log[x + 5, -2 y + 23] + Log[y - 10, 2 x + 9] == 2, {x,y}, Reals]


Reduce::nsmet: This system cannot be solved with the methods available to Reduce.

The ContourPlot command performs only one curve.

ContourPlot[{Log[x + 5, y^2 - 20 y + 100] +
Log[y - 10, x^2 + 10 x + 25] == 4, Log[x + 5, -2 y + 23] + Log[y - 10, 2 x + 9] == 2},
{x, -4.5, 10}, {y, 10, 11.5}, WorkingPrecision -> 15, PlotPoints -> 50]


Numerical commands fail too.

NSolve[Log[x + 5, y^2 - 20 y + 100] + Log[y - 10, x^2 + 10 x + 25] ==  4 &&
Log[x + 5, -2 y + 23] + Log[y - 10, 2 x + 9] == 2, {x, y}]


NSolve::nsmet: This system cannot be solved with the methods available to NSolve.

FindRoot[Log[x + 5, y^2 - 20 y + 100] +
Log[y - 10, x^2 + 10 x + 25] == 4 &&
Log[x + 5, -2 y + 23] + Log[y - 10, 2 x + 9] == 2, {{x, 5}, {y,10.5}}, AccuracyGoal -> 3]


FindRoot::cvmit: Failed to converge to the requested accuracy or precision within 100 iterations. {x -> -3.83392*10^101 - 1.89741*10^97 I, y -> 2.84399*10^101 - 1.92551*10^97 I}

• FindRoot[{one, two}, {{x, -3.9}, {y, 11.2}}]delivers a result (one and two are your equations) Oct 22, 2018 at 9:53
• @mgamer: Thank you. It is useful. Oct 22, 2018 at 10:05
• An exact solution is $\left\{ x=-{\frac{22}{5}},y={\frac{53}{5}} \right\}$. Oct 22, 2018 at 15:50

eqns = Log[x + 5, y^2 - 20 y + 100] + Log[y - 10, x^2 + 10 x + 25] == 4 &&
Log[x + 5, -2 y + 23] + Log[y - 10, 2 x + 9] == 2 // Simplify;


Constrain the arguments of the logs to be positive

cons = And @@ Cases[eqns, Log[z_] :> z > 0, Infinity] //
Simplify[#, Element[{x, y}, Reals]] &

(* 10 < y < 23/2 && 9 + 2 x > 0 *)


Simplify the equations using these constraints

eqns2 = eqns // Simplify[#, cons] &;


The solution is then

sol = Solve[eqns2 && cons, {x, y}, Reals]

(* {{x -> -(22/5), y -> 53/5}} *)


Plotting

ContourPlot[Evaluate[List @@ eqns2],
{x, -9/2, -3}, {y, 10, 23/2},
WorkingPrecision -> 20,
PlotPoints -> 50,
Epilog -> {Red, AbsolutePointSize[5],
Point[{x, y} /. sol[[1]]]}]


EDIT: To see the discontinuity at x == -4

eqns2 /. x -> -4


And zoom in on the plot

ContourPlot[Evaluate[List @@ eqns2],
{x, -4.02, -3.98}, {y, 10.96, 11.04},
WorkingPrecision -> 20,
PlotPoints -> 50,
Epilog -> {Red, AbsolutePointSize[5], Point[{x, y} /. sol[[1]]]}]


The discontinuity is a single point, i.e., a single pixel.

• +1. Thank you. However, your plot shows one more solution. Am I not right? Can you kindly explain that? Nov 10, 2019 at 15:30
• No, when you zoom in you'll see a hole, see my plot in red rectangle. Nov 10, 2019 at 15:33
• @OkkesDulgerci: I don't see a hole in your picture. Thank you anyway. Nov 10, 2019 at 15:36
• Shouldn't the Reduce command analyze the domains of the logarithms over the reals automatically? Nov 10, 2019 at 16:01
• It would be good if Reduce did; however, Reduce concluded that it could not solve the equations and reported that. Reduce did not provide an inaccurate result. Nov 10, 2019 at 16:10

ContourPlot and simplified equations show you, you get into complexes for x < -5 && y < 10 . Therefore PowerExpand under these conditions and Solve does a easy job.

eq2=eq//FullSimplify//PowerExpand[#, Assumptions->x>-5 && y>10] &


{ (2 Log[5 + x])/Log[-10 + y] + (2 Log[-10 + y])/Log[5 + x] == 4 &&

Log[23 - 2 y]/Log[5 + x] + Log[9 + 2 x]/Log[-10 + y] == 2 }

sol = Solve[eq2, {x, y}, Reals]


{ {{x -> -(22/5), y -> 53/5}} }

• Thank you. What are eq and eq2? Nov 10, 2019 at 15:16

We simply first equation as follow:

We have $$\log \left(y^2-20 y+100\right)=2 \log (y-10)$$ and

$$\log \left(x^2+10x+25\right)=2\log \left(x+5\right)$$

And so $$\dfrac{\log (x+5)}{\log (y-10)}+\dfrac{\log (y-10)}{\log (x+5)}=2$$

$$\dfrac{a}{b}+\dfrac{b}{a}=2\Longrightarrow a^2-2ab+b^2=0\Longrightarrow(a-b)^2=0\Longrightarrow a=b$$

$$\Longrightarrow\log (x+5)=\log (y-10),\Longrightarrow y = x+15$$

  Solve[{y == x+15,Log[2 x + 9]/Log[y - 10] + Log[23 - 2 y]/Log[x + 5] == 2},
{x,  y}, Reals]


$$\left\{\left\{x\to -\frac{22}{5},y\to \frac{53}{5}\right\}\right\}$$

ContourPlot[{y == x+15,
Log[23 - 2 y]/Log[5 + x] + Log[9 + 2 x]/Log[-10 + y] ==
2}, {x, -4.9, -3}, {y, 10.1, 12}, PlotPoints -> 50]


Let's substitute first equation into second.

   Log[23 - 2 y]/Log[5 + x] + Log[9 + 2 x]/Log[-10 + y] == 2 /.
y -> x + 15 // FullSimplify


$$\dfrac{\log (-2 x-7)+\log (2 x+9)}{\log (x+5)}=2$$

$$\log (-2 x-7)+\log (2 x+9)-2 \log (x+5)$$

Plot[Log[-7 - 2 x] + Log[9 + 2 x] - 2 Log[5 + x], {x, -4.9, -3},
Frame -> True, PlotRange -> {-1, 1}]


Solve[Log[-7 - 2 x] + Log[9 + 2 x] - 2 Log[5 + x] == 0, x]


$$\left\{\left\{x\to -\frac{22}{5}\right\},\{x\to -4\}\right\}$$

Note that $$x=-4$$ is NOT a solution of original problem since it makes denominator zero.

Alternatively we can use FunctionDomain without any restating equation.

 eq = { Log[x^2 + 10 x + 25]/Log[y - 10] + Log[y^2 - 20 y + 100]/Log[x + 5] - 4,
Log[2 x + 9]/Log[y - 10] + Log[23 - 2 y]/Log[x + 5] - 2};
dom = FunctionDomain[eq, {x, y}];
eq2 = And @@ Thread[eq == 0] && dom // FullSimplify;
Solve[eq2, {x, y}, Reals]


$$\left\{\left\{x\to -\frac{22}{5},y\to \frac{53}{5}\right\}\right\}$$

Or use Reduce

Reduce[eq2, {x, y}, Reals]


x == -(22/5) && y == 53/5

• Can you kindly base "Your problem can be restated as..."? Nov 10, 2019 at 15:19
• Sorry, I can't follow you. Nov 10, 2019 at 15:34
• Can you kindly ground your statement "Your problem can be restated as..."? Nov 10, 2019 at 15:37