ODE with discontinuous function This exercise was given to me: to solve the following ODE over $[0,+\infty)$ $$y'+y=H(t),$$ where $$H(t) = \begin{cases} 
          1 & 0\leq t\leq 1 \\
          -1 & t\gt 1 
       \end{cases}
      $$
So i've multiplied both sides by $e^t$ to get that the ODE is equivalent to $$(e^ty)' = e^tH(t).$$
However RHS of this clearly doesn't satisfy IVT, so it is not the derivative of a function, therefore the ODE has no solutions. Is this correct or am i missing something?
 A: I think this can be solved individually for $0\leq t\leq 1$ and $t>1$ and then use the free constants to make the solution continuous.
For $0\leq t\leq 1$, the equation reads
$$
y'+y=1.
$$
The general solution to the equation above is
$$
y=1+c_1 e^{-t},
$$
where $c_1$ is a free constant.
In the formula above,  $y_p=1$ is a particular solution and $y_h=c_1 e^{-t}$ is the general solution of the homogenous problem.
For $t> 1$, the equation reads
$$
y'+y=-1.
$$
The general solution to the equation above is
$$
y=-1+c_2 e^{-t},
$$
where $c_2$ is another free constant.
So we have
$$
y=
\left\{
\begin{array}{ll}
1+c_1 e^{-t},&0\leq t\leq 1\\
-1+c_2 e^{-t},& t>1.
\end{array}
\right.
$$
The continuity condition reads $c_2=2+c_1$.
Thus
$$
y=
\left\{
\begin{array}{ll}
1+c_1 e^{-t},&0\leq t\leq 1\\
-1+(2+c_1) e^{-t},& t>1
\end{array}
\right.
$$
is the general solution with free constant $c_1$.
@humanStampedist is right in that this type of problem, in principle should be done in the context of distributions. However, in a case like that where only one allows the derivative to be discontinuous, the techniques covered in a first ODE course can be used as above. Alternatively, it can be solved using the Laplace Transform method. Laplace transforms are often covered in an ODE course and that would be a typical problem for the application of that method.
A: Using the Laplace transform over
$$
y'(t)+y(t) = \theta (t)-2 \theta (t-1)
$$
where $\theta(t)$ is the Heaviside $\theta$ function, we have
$$
\mathcal{L}[y] = \frac{e^{-s} \left(e^s s y_0+e^s-2\right)}{s (s+1)}
$$
with inverse (solution)
$$
y(t) = 1 + e^{-t} (2 e \theta (t-1)+y_0-1)-2 \theta (t-1)
$$
