You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import sympy as sp
u, b, x = sp.symbols('u, b, x', real=True)
sp.integrate(sp.sinh(x / u + b / u)**2 + 1, x)
sp.integrate(sp.sinh((x + b) / u)**2 + 1, x)
SymPy evaluates the first integral but it gives back the second one unevaluated.
The only difference is that the argument of the sinh in the first integral is written as x / u + b / u and in the second one as (x + b) / u.
sympy.__version__ returns 1.12
I would expect that both expressions return the same result.
The text was updated successfully, but these errors were encountered:
The result is coming from heurisch. It's too surprising heurisch sensitive to the input format.
A good fix here would be to make powers of hyperbolic functions work in manualintegrate. The strategy should be similar to the one used for powers of regular trig functions. For example, $\sinh(x)^2 = \frac{\sinh(x)}{2} - \frac{1}{2}$ (that identity may need to be implemented somewhere, I'm not sure if it already is). Manualintegrate should handle the argument being (x + b)/u automatically via u-substitution.
Actually, I imagine quite a bit of manualintegrate's trig functionality could be extended to work with hyperbolic trig functions.
If possible, hyperbolics can be recast to normal trig functions with the Osborne transformation (private functions in fu.py), simplified, and recast to hyperbolics before integration.
Here is my code:
SymPy evaluates the first integral but it gives back the second one unevaluated.
The only difference is that the argument of the sinh in the first integral is written as
x / u + b / u
and in the second one as(x + b) / u
.sympy.__version__
returns1.12
I would expect that both expressions return the same result.
The text was updated successfully, but these errors were encountered: