I have the following simple expression
Exp[(Log[1 + x]^2 - Log[x]^2)/Log[1 + 1/x]] - x^2
that can be shown to simplify to x for positive x (and same for $x < -1$ if principal branch of log is taken, $\log (x) = i \pi + \log (-x)$). However, none of the following
Simplify[Exp[(Log[1 + x]^2 - Log[x]^2)/Log[1 + 1/x]] - x^2]
FullSimplify[Exp[(Log[1 + x]^2 - Log[x]^2)/Log[1 + 1/x]] - x^2]
Simplify[Exp[(Log[1 + x]^2 - Log[x]^2)/Log[1 + 1/x]] - x^2,
Assumptions -> {x > 0}]
FullSimplify[Exp[(Log[1 + x]^2 - Log[x]^2)/Log[1 + 1/x]] - x^2,
Assumptions -> {x > 0}]
finds this simplification. Why is that? To show that the expression simplifies accordingly, use $a^2 - b^2 = (a+b)(a-b)$ formula inside the exponential and in the denominator $\log (1+1/x) = \log (1+x) - \log(x)$. Some stuff cancels out and you'll be left with $\exp \log (x+x^2) - x^2 = x$. I have no clue why MMA didn't choose to go down this route, I assumed that the common formulas like $a^n - b^n$ are known to it. I tried Simplify[Log[1 + 1/x] + Log[x], Assumptions -> {x > 0}] and it correctly returned log[1+x], so this might not be the issue here.
This specific expression came up in some wider context, I frequently use MMA to simplify expressions after integration to get some nicer form and was surprised that this couldn't be simplified.
Mapleand it can do it. – Mariusz Iwaniuk Jan 03 '21 at 10:09Simplifyat leastReduce[Exp[(Log[1+x]^2-Log[x]^2)/Log[1+1/x]]-x^2==x && x>0,x]returns0<x<Infinitybut it says it cannot accomplish this when givenx < -1which I am guessing is because of the principal branch issue. – Bill Jan 03 '21 at 10:12LogContract[Exp[(Log[1 + x]^2 - Log[x]^2)/Log[1 + 1/x]], Assumptions -> x > 0]Fail ? – Mariusz Iwaniuk Jan 03 '21 at 11:28Expand[Exp[ FullSimplify[ FunctionExpand[(Log[1 + x]^2 - Log[x]^2)/Log[1 + 1/x], Assumptions -> x > 0], Assumptions -> x > 0]] - x^2]which results inxin version 12.2? – user64494 Jan 03 '21 at 11:32PowerExpand[Factor[#]]&//@exseems to work, whereexis your expression. – Simon Woods Jan 03 '21 at 11:32PowerExpand@*Factor //@ f– rmw Jan 03 '21 at 14:53