Right. But you're just going to use the $\displaystyle y=\frac{\sin x + \cos x}{2} + Ce^{-x}$ part of $\displaystyle y.$
I don't get $\displaystyle C=6-2e^{-\pi/2}.$ Can you post your work?
sorry i was wrong. at $\displaystyle x=\pi/2$, we have $\displaystyle y=3-e^{-\pi/2}$. so putting this values, we get $\displaystyle (3-e^{-\pi/2})e^{\pi/2} = \frac{e^{\pi/2}}{2}(\sin {\pi/2} + \cos {\pi/2}) + C$ ie, $\displaystyle C = e^{\pi/2}(3-e^{-\pi/2} -1/2)$
The DE is...
$\displaystyle y^{'} + y = g(t)$ , $\displaystyle y(0)=2$ (1)
... and now, in order to clarify what I ment in my post, let's suppose that is...
$\displaystyle g(t)=\left\{\begin{array}{ll}3 ,\,\,0 < t < \frac{\pi}{2}\\{}\\0 ,\,\, x>\frac{\pi}{2}\end{array}\right.$ (2)
... or , which is the same, ...
$\displaystyle g(t)= 3\ \{\mathcal {H} (t) - \mathcal {H} (t-\frac{\pi}{2})\}$ (3)
... where $\displaystyle \mathcal{H} (*)$ is the so called 'Heavyside Step Function'. The (2)-(3) is what I called 'head' of g(t). Now if we write (1) in term of Laplace Transform we have...
$\displaystyle \displaystyle s\ Y(s) - 2 + Y(s)= 3\ \frac{1-e^{-s \frac{\pi}{2}}}{s}$ (4)
... and from (4)...
$\displaystyle \displaystyle Y(s) = \frac{2}{s+1} + 3\ \frac{1-e^{-s \frac{\pi}{2}}}{s\ (s+1)} = - \frac{1-3\ e^{-s \frac{\pi}{2}}}{s+1} + 3\ \frac{1-e^{-s \frac{\pi}{2}}}{s} $ (5)
Now we can derive y(t) performing the inverse LT of (5)...
$\displaystyle \displaystyle y(t) = \mathcal{L}^{-1} \{Y(s)\} = (3-e^{-t})\ \mathcal{H} (t) -3\ (1- e^{-(t-\frac{\pi}{2})})\ \mathcal {H} (t-\frac{\pi}{2})$ (6)
... and it is evident in (6) that the 'queue' of the y(t) when we take into account the only 'head' of g(t) doesn't vanish after $\displaystyle t= \frac{\pi}{2}$. The initial problem is of course more complex because we have to consider also the 'queue' of g(t) that is...
$\displaystyle \displaystyle g_{q} (t) = \cos t\ \mathcal{H} (t-\frac{\pi}{2})$ (7)
Kind regards
$\displaystyle \chi$ $\displaystyle \sigma$
Reply to chisigma,
I still don't understand the term 'queue'. It seems that by 'head' you mean 'the rule of association' corresponding to a function.
The function
$\displaystyle \displaystyle y(t)=\begin{cases}
3-e^{-t},\quad 0<t<\pi/2\\
\frac{\sin(t) + \cos(t)}{2} +e^{-t} (\frac{5}{2}\,e^{\pi/2}-1),\quad\pi/2\le t
\end{cases}$
satisfies the DE and all initial conditions, and is also continuous. Therefore, it solves the IVP in the OP. Am I missing something here?