13
$\begingroup$

Mathematica used to be easily able to solve an equation like this:

Reduce[Log[Sqrt[k p]/Log[k]] == 0, p]

(I can easily do it myself, at least I can find the solution p = log(k)^2/k.)

Now in Mathematica 12, all I get is Reduce::nsmet: This system cannot be solved with the methods available to Reduce.

I thought it might be an issue with assumptions, so I tried assuming both k and p were sufficiently large, but it didn't help.

Is there a way to get Mathematica 12 to produce useful output on the problem above?

$\endgroup$
  • 1
    $\begingroup$ Works fine with Solve instead of Reduce. A simpler version of this problem is Reduce[Sqrt[a x] == b, x], which shows how hard this problem is in all generality. $\endgroup$ – Roman Jun 10 at 13:01
  • $\begingroup$ Fwiw I don't think this is particular to V12. I tried on 11.3 and it gave up there too. $\endgroup$ – 1110101001 Jun 11 at 3:03
  • $\begingroup$ I still keep my version 9.0.1 although I also have the newest version, but in a way 9.0.1 is the last really stable version. $\endgroup$ – Yukterez Jun 11 at 3:54
  • 1
    $\begingroup$ Please do not use the bugs tag when posting new questions. See the tag description for why. $\endgroup$ – Szabolcs Jun 11 at 6:40
  • $\begingroup$ @Roman my version of Mathematica is able to solve Sqrt[a x] == b using Reduce, though it does complain about the solution containing the "unsolved equation" 0 == b - Sqrt[b^2] as an assumption. $\endgroup$ – Thomas Ahle Jun 16 at 11:09
18
$\begingroup$

Working only in the real numbers could be a solution:

Reduce[Log[Sqrt[k p]/Log[k]] == 0, p, Reals]
(*    k > 1 && p == Log[k]^2/k    *)

I think the branch cuts of the square root make this problem difficult to solve in all complex generality ($k\in\mathbb{C}$). Maybe previous versions of Mathematica were a bit less careful with these branch cuts? From what I hear there has been a lot of work done in Mathematica recently on how to deal with branch cuts.

The given solution $p=\frac{\ln^2k}{k}$ is actually valid for any $\lvert k\rvert>1$, not just for the positive real $k>1$:

ComplexPlot3D[Log[Sqrt[k p]/Log[k]] /. p -> Log[k]^2/k,
  {k, -2 - 2 I, 2 + 2 I}, PlotRange -> All, Exclusions -> None]

enter image description here

I guess it would still be nice to find a way to solve/reduce this equation that returns a solution like Abs[k] > 1 && p == Log[k]^2/k to show the most general solution.

$\endgroup$
  • 1
    $\begingroup$ Interestingly, while your answer works; Reduce[Log[Sqrt[k p]/Log[k]] == 0 && Element[{p, k}, Reals], p] does not. $\endgroup$ – Bob Hanlon Jun 10 at 13:22
  • $\begingroup$ @BobHanlon Try p>0&&k>0 . The domain Reals means the variables and functions are assumed to be real. $\endgroup$ – Michael E2 Jun 10 at 14:03
  • $\begingroup$ @Roman Doesn't the assumptions k > 0 && p > 0 imply that the variables aren't complex? Adding Reals to reduce does the trick though. Thanks! $\endgroup$ – Thomas Ahle Jun 10 at 14:25
  • 3
    $\begingroup$ @ThomasAhle yes, but the term inside the logarithm can still be negative, thereby allowing for cuts. Restricting k > 1 avoids this scenario and Reduce returns a result. Try Reduce[Log[Sqrt[k p]/Log[k]] == 0 && k > 1 && p > 0, p]. $\endgroup$ – Chip Hurst Jun 10 at 14:41
  • 1
    $\begingroup$ Also read the few lines in the docs starting here: reference.wolfram.com/language/ref/Reduce.html#26975. Using the domain spec of Reduce (its third argument) restricts all values of all function evaluations to be real. Implicitly this means Reduce[Log[Sqrt[k p]/Log[k]] == 0, p, Reals] is restricting to k > 1. $\endgroup$ – Chip Hurst Jun 10 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.