Repository navigation
Exponential & logarithmic equations #214
Description
Activity
@MomoDeve wanna be an assignee for this one?
a ^ f(x) + b ^ g(x) + ... + t = 0can be solved only if all functions are linear or can be converted to linear by substitution: for example,2^(x^2 + 1) + 2^(2*x^2 - 1) + 1 = 0can be solved, but2^(x + 1) + 2^(2*x^2 - 1) + 1 = 0cannot.- where are no exponential parsers. I have an idea how to solve such equations, but it requires a lot of dirty work just to determine if an equation is solvable and which substitution to choose
- added a commit that references this issue
on Aug 4, 2026 - added a commit that references this issue
on Aug 8, 2026 - addedAcceptedFor proposals, which were approved and will be implementedFor proposals, which were approved and will be implemented
on Aug 11, 2026 Measured on
masterata45a7256— this looks substantially done, including the general form the body asks for.So that
a ^ f(x) + b ^ g(x) + ... = 0could be solved. And, likewise, a logarithmic oneequation answer 2^x - 8{ 3 }2^x + 2^(-x) - 5/2{ 1, -1 }e^(2x) - 3e^x + 2{ 0, ln(2) }2^x + 3^x - 5{ 1 }— different bases, which is the general form2^(2x) - 5*2^x + 6{ 1, ln(3 ^ (1 / ln(2))) }4^x - 3*2^x + 2{ 0, 1 }ln(x) - 2{ e ^ 2 }ln(x)^2 - 3*ln(x) + 2{ e, e ^ 2 }log(2,x) + log(4,x) - 3{ 4 }@MomoDeve's analysis in the thread — that these are solvable where the exponents are linear or become linear under a substitution — is what the solver now does, and the mixed-base case works too.
Two things are imperfect rather than missing, and I would suggest they are separate and smaller than this issue:
2^(2x) - 5*2^x + 6answersln(3 ^ (1 / ln(2)))wherelog(2, 3)says the same thing far more plainly. Correct, ugly.ln(x) + ln(x+1)answers0.6180339887...— a decimal, where the exact root is(sqrt(5) - 1) / 2. That is a loss of exactness rather than a formatting complaint, and of the two it is the one I would actually file.
Happy to open (2) as its own issue if you want it tracked; otherwise this one looks closeable.
Measured on
masterat6b93b401(2.3.0), .NET 10. Both halves of this issue are answered —a^f(x) + b^g(x) + … = 0and the logarithmic mirror of it:2^x - 8 -> { 3 } 2^x + 3^x - 5 -> { 1 } 2^(2x) - 5*2^x + 4 -> { 0, 2 } e^x - e^(-x) - 1 -> { ln((1 - sqrt(5))/2), ln((1 + sqrt(5))/2) } 5^x - 7^x -> { 0 } ln(x) + ln(x - 1) - ln(6) -> { 3 } log(2, x) + log(2, x - 2) - 3 -> { 4 } ln(x)^2 - 3*ln(x) + 2 -> { e, e^2 }The implementation is
Sources/AngouriMath/Functions/Continuous/Solvers/EquationSolver/ExponentialSolver.cs(SolveLinear,SolveMultiplicative,GetConstantOutOfLogarithm) together with the fresh-variable substitution inAnalyticalEquationSolver, and it is pinned bySources/Tests/UnitTests/Algebra/AcceptedProposalsAlreadyImplementedTest.cs— so it is covered rather than merely working today. #246, the logarithmic half filed separately, is already closed.One residual, filed separately as #1007 rather than left in this thread: a mixed-base exponential comes back with a
doublewhere an exact form exists —3^(x+1) - 2^(x-1)givesln(0.04674569822628630438…^(1/ln(2)))where the answer is-ln(6)/ln(3/2), agreeing to 17 significant figures and then diverging. That is a precision defect in one branch, not this proposal being unimplemented.Closing on the measurement, per #746 item 1. This is one of the "open issues that are already done" that a sweep keeps turning up — the third today.
So that
a ^ f(x) + b ^ g(x) + ... = 0could be solved. And, likewise, a logarithmic one