Subject: Best way to solve equations with logarithms?
From: Stavros Macrakis
Date: Thu, 9 Oct 2003 12:39:07 -0400
> still fail to find a general way to solve simple equations
> involving logarithms.
>
> (C2) eq: 2*log(3*x + 5) - 2*log(x) = y$
> (C3) solve(ev(eq/2, ratsimp, logcontract), x);
> (D3) [x = 5/(%E^(y/2)-3)]
There are two issues here:
1) Why doesn't solve(eq,x) give a useful result?
2) Why does solve(logcontract(eq),x) yield an apparently spurious
solution?
I'll start with the second issue.
The solution solve(logcontract(eq),x) yields
[x = -(5*%E^(y/2)-15)/(%E^y-9),
x = (5*%E^(y/2)+15)/(%E^y-9)]
The first solution is spurious if you interpret the log's in your
equation as principal values. But if you interpret them as multivalued,
it is not. By using logcontract, you have implicitly asserted that you
are treating them as multivalued, since the logcontract identities are
only true for the multivalued log function, not for the principal value.
For example, log((-1)^2)=0 but log(-1)*2 = 2*%i*%pi.
To check whether the solution is valid for the principal value
interpretation, you can substitute back.
Unfortunately, Maxima is not consistent or complete in dealing with
either principal-value-log or multiple-valued-log. (If any computer
algebra system is, I would like to know how they do it.)
The quasispurious solution explains why Solve does not use logconract
automatically. It normally gives a warning message when using
multivalued inverses when the multiple values are real --
solve(sin(x)=0,x) -- but not when they are complex -- solve(exp(x)=1,x).
It is very leery of introducing spurious solutions in general --
solve(sqrt(x)=x,x).
-s
Maxima 5.9.0 gcl 2.5.0 W2k