Skip to content

Exponential & logarithmic equations #214

Description

@WhiteBlackGoose

So that a ^ f(x) + b ^ g(x) + ... = 0 could be solved. And, likewise, a logarithmic one

Activity

  1. WhiteBlackGoose commented on Sep 21, 2020

    @WhiteBlackGoose
    MemberAuthor

    @MomoDeve wanna be an assignee for this one?

  2. MomoDeve commented on Sep 21, 2020

    @MomoDeve
    Member
    1. a ^ f(x) + b ^ g(x) + ... + t = 0 can 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 = 0 can be solved, but2^(x + 1) + 2^(2*x^2 - 1) + 1 = 0 cannot.
    2. 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
  3. added this to the 1.2.1 milestone on Sep 30, 2020
  4. modified the milestones: 1.3, 1.4 on Mar 14, 2021
  5. added
    AcceptedFor proposals, which were approved and will be implemented
    on Aug 11, 2026
  6. Rafael-SOWNet commented on Aug 16, 2026

    @Rafael-SOWNet
    Member

    Measured on master at a45a7256 — this looks substantially done, including the general form the body asks for.

    So that a ^ f(x) + b ^ g(x) + ... = 0 could be solved. And, likewise, a logarithmic one

    equation 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 form
    2^(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:

    1. 2^(2x) - 5*2^x + 6 answers ln(3 ^ (1 / ln(2))) where log(2, 3) says the same thing far more plainly. Correct, ugly.
    2. ln(x) + ln(x+1) answers 0.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.

  7. Rafael-SOWNet commented on Aug 23, 2026

    @Rafael-SOWNet
    Member

    Measured on master at 6b93b401 (2.3.0), .NET 10. Both halves of this issue are answered — a^f(x) + b^g(x) + … = 0 and 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 in AnalyticalEquationSolver, and it is pinned by Sources/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 double where an exact form exists — 3^(x+1) - 2^(x-1) gives ln(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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AcceptedFor proposals, which were approved and will be implemented

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions