from sympy import *
p = Function('p')
t, a = symbols('t a')
b = symbols('b', nonzero=True)
eq = Eq(Derivative(p(t), t), -a * p(t) + exp(-(a + b) * t))
dsolve(eq)
SymPy - Problems when using to many parameters in dsolve