@@ -1690,8 +1690,11 @@ def laplace(ex, t, s, algorithm='maxima'):
1690
1690
1691
1691
Testing SymPy::
1692
1692
1693
- sage: laplace(t^n, t, s, algorithm='sympy')
1694
- (gamma(n + 1)/(s*s^n), 0, re(n) > -1)
1693
+ sage: F, a, cond = laplace(t^n, t, s, algorithm='sympy')
1694
+ sage: a, cond
1695
+ (0, re(n) > -1)
1696
+ sage: F.simplify()
1697
+ s^(-n - 1)*gamma(n + 1)
1695
1698
1696
1699
Testing Maxima::
1697
1700
@@ -1700,17 +1703,19 @@ def laplace(ex, t, s, algorithm='maxima'):
1700
1703
1701
1704
Check that :trac:`24212` is fixed::
1702
1705
1703
- sage: laplace(cos(t^2), t, s, algorithm='sympy')
1704
- (-1/2*sqrt(pi)*(sqrt(2)*cos(1/4*s^2)*fresnel_sin(1/2*sqrt(2)*s/sqrt(pi)) -
1705
- sqrt(2)*fresnel_cos(1/2*sqrt(2)*s/sqrt(pi))*sin(1/4*s^2) - cos(1/4*pi + 1/4*s^2)),
1706
- 0, True)
1706
+ sage: F, a, cond = laplace(cos(t^2), t, s, algorithm='sympy')
1707
+ sage: a, cond
1708
+ (0, True)
1709
+ sage: F._sympy_().simplify()
1710
+ sqrt(pi)*(sqrt(2)*sin(s**2/4)*fresnelc(sqrt(2)*s/(2*sqrt(pi))) -
1711
+ sqrt(2)*cos(s**2/4)*fresnels(sqrt(2)*s/(2*sqrt(pi))) + cos(s**2/4 + pi/4))/2
1707
1712
1708
1713
Testing result from SymPy that Sage doesn't know how to handle::
1709
1714
1710
1715
sage: laplace(cos(-1/t), t, s, algorithm='sympy')
1711
1716
Traceback (most recent call last):
1712
1717
...
1713
- AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), s**2/16 )/4) into Sage
1718
+ AttributeError: Unable to convert SymPy result (=meijerg(((), ()), ((-1/2, 0, 1/2), (0,)), ... )/4) into Sage
1714
1719
"""
1715
1720
if not isinstance (ex , (Expression , Function )):
1716
1721
ex = SR (ex )
@@ -1817,8 +1822,8 @@ def inverse_laplace(ex, s, t, algorithm='maxima'):
1817
1822
1818
1823
Transform an expression involving a time-shift, via SymPy::
1819
1824
1820
- sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy')
1821
- -(log(e^(-t)) + 1)*heaviside(t - 1)
1825
+ sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy').simplify()
1826
+ (t - 1)*heaviside(t - 1)
1822
1827
1823
1828
The same instance with Giac::
1824
1829
0 commit comments