In many physical problems the nonhomogencous term may be specified by
different formulas in different time periods. As an example, determine the
solution \(y=\phi(t)\) of
$$
y^{\prime \prime}+y=\left\\{\begin{array}{ll}{t,} & {0 \leq t \leq \pi} \\\
{\pi e^{x-t},} & {t>\pi}\end{array}\right.
$$
$$
\begin{array}{l}{\text { satisfying the initial conditions } y(0)=0 \text {
and } y^{\prime}(0)=1 . \text { Assume that } y \text { and } y^{\prime} \text
{ are also }} \\ {\text { continuous at } t=\pi \text { . Plot the
nonhomogencous term and the solution as functions of time. }} \\ {\text {
Hint: First solve the initial value problem for } t \leq \pi \text { ; then
solve for } t>\pi \text { , determining the }} \\ {\text { constants in the
latter solution from the continuity conditions at } t=\pi \text { .
}}\end{array}
$$