# sympy/sympy

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

# Laplace transform of Piecewise doesn't work even though SymPy can compute the integral #10354

Open
opened this Issue Jan 4, 2016 · 6 comments

Projects
None yet
3 participants
Member

### asmeurer commented Jan 4, 2016

 Reported on Gitter: ```In [27]: u2=Piecewise((1.,t<1),(0.5,t>=1)) In [28]: print(laplace_transform(u2, t, s)) LaplaceTransform(Piecewise((1.00000000000000, t < 1), (0.500000000000000, t >= 1)), t, s) In [29]: laplace_transform(u2, t, s).rewrite(Integral).doit() Out[29]: -s 1.0 0.5⋅ℯ ─── - ─────── s s```

### ronanpaixao commented Jan 5, 2016

 Got a different, still unevaluated result: ``````In[34]: u2=Piecewise((1.,t<1),(0.5,t>=1)) In[35]: print(laplace_transform(u2, t, s)) LaplaceTransform(Piecewise((1.00000000000000, t < 1), (0.500000000000000, t >= 1)), t, s) In[36]: laplace_transform(u2, t, s).rewrite(Integral).doit() Out[36]: Integral(Piecewise((1.0*exp(-s*t), t < 1), (0.5*exp(-s*t), t >= 1)), (t, 0, oo)) In[37]: sympy.__version__ Out[37]: '0.7.6.1' ``````
Member

### asmeurer commented Jan 5, 2016

 I ran mine on master so that's probably why.
Contributor

### nishnik commented Mar 9, 2016

 @asmeurer You got the right results. And it is not coming the same when I tried to replicate it: ``````In [3]: u2=Piecewise((1.,t<1),(0.5,t>=1)) In [4]: laplace_transform(u2, t, s).rewrite(Integral).doit() Out[4]: Integral(Piecewise((1.0*exp(-s*t), t < 1), (0.5*exp(-s*t), t >= 1)), (t, 0, oo)) In [5]: sympy.__version__ Out[5]: '1.0.1.dev' `````` What needs to be done here ?
Member

### asmeurer commented Mar 10, 2016

 It isn't working for me anymore either. Something recent must have broken it.
Member

### asmeurer commented Mar 10, 2016

 I didn't try super hard, but I can't find a commit where it works. Not sure what happened. Is the answer I "got" above correct?
Contributor

### nishnik commented Mar 10, 2016

 Yeah! That's correct. Then, let me try `git bisect` again and see if I can find which commit broke it.
to join this conversation on GitHub. Already have an account? Sign in to comment