Discussion
sinh( arccosh(x) )
hnarayanan: This is a general pattern in CAS. For a more basic case, it’s not obvious sqrt(square(x)) will simplify to x without any further assumptions on x.
burnt-resistor: That's not what it simplifies to using a real or complex number domains for x, it's abs(x). CAS need type inference assumptions and/or type qualifiers to be more powerful.Edit: Fixed stuff.
jstanley: Right, that's why you need further assumptions on x in order for that simplification to hold.
contubernio: It's not a simplification, it's wrong. Sqrt(square(x)) equals abs(x).
MForster: It also equals x with appropriate assumptions (x > 0).
yorwba: For x = -i, square(x) = -1, sqrt(square(x)) = i. Meanwhile, abs(x) = 1. You're right that it simplifies to abs(x) for real x, but that no longer holds for arbitrary complex values.
bryango: I really wish Mathematica would open-source the heuristics behind these core functions (including common mathematical functions, Simplify, Integrate, etc.). The documentation is good, but it still lags behind the actual implementation. It would be much easier if we could peek inside the black box.
MinimalAction: That blackbox being their entire moat, I would assume they'd never want to open-source any function. Mathematica as a front-end has innumerable frustrating bugs, but its CAS is top-notch. Especially combined with something like Rubi for integration, for me nothing comes close to Mathematica for algebraic computations.
eulerboiler: Many functions source ate viewable. Use https://resources.wolframcloud.com/FunctionRepository/resour...
gdelfino01: Many built-in functions are open source too. Use the "PrintDefinitions" ResourceFunction to see the code of functions that are implemented in Wolfram Language itself.
exe34: so there's an unconditionally correct answer (it's also equal to abs(x) for x>0), and then there is an answer that is only correct for half the domain, which requires an additional assumption.
noosphr: More generally it's not at all clear what 'simplify' means.Is x*x simpler than x^2? Probably? Is sqrt(5)^3 simpler than 5^(3/2)? I don't know.It entirely depends on what you're going to be doing with the expression later.
jmyeet: I think "simplify" is pretty clear here. For trigonometric functions you would expect a trig function and an inverse trig function to be simplified. We all know what we'd expect if we saw sin(arcsin(x)) (ie x). If we saw cos(arcsin(x)) I'll spoil it for you: it simplifies to sqrt(1-x^2).Hyperbolic functions aren't used as much but the same principle applies. Here the core identity is cosh^2(x) = sinh^2(x) = 1 so: sinh(arccosh(x)) = sqrt(1 + cosh^2(arccosh(x)) = sqrt(1 + x^2) You should absolutely expect that from "simplify".
notarget137: Well, then sin(x) = x if x is infinitely small