1 | initial version |
For you concrete example, you can use unit_step
instead of piecewise
:
sage: f(x) = 10*unit_step(x)
sage: u = function('u')(x)
sage: eqn = 2*diff(u,x) + u == f(x)
sage: u = desolve(eqn, u, ivar=x)
sage: u
(5*(e^(1/2*x) - 1)*sgn(x) + _C + 5*e^(1/2*x) - 5)*e^(-1/2*x)