76.15.35 problem 37

Internal problem ID [17676]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 4. Second order linear equations. Section 4.5 (Nonhomogeneous Equations, Method of Undetermined Coefficients). Problems at page 260
Problem number : 37
Date solved : Tuesday, January 28, 2025 at 10:53:53 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&=\left \{\begin {array}{cc} t & 0\le t \le \pi \\ \pi \,{\mathrm e}^{\pi -t} & \pi <t \end {array}\right . \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=0\\ y^{\prime }\left (0\right )&=1 \end{align*}

Solution by Maple

Time used: 1.556 (sec). Leaf size: 41

dsolve([diff(y(t),t$2)+y(t)=piecewise(0<=t and t<=Pi,t,t>Pi,Pi*exp(Pi-t)),y(0) = 0, D(y)(0) = 1],y(t), singsol=all)
 
\[ y = \left \{\begin {array}{cc} \sin \left (t \right ) & t <0 \\ t & t <\pi \\ -\sin \left (t \right )-\frac {\sin \left (t \right ) \pi }{2}-\frac {\cos \left (t \right ) \pi }{2}+\frac {\pi \,{\mathrm e}^{\pi -t}}{2} & \pi \le t \end {array}\right . \]

Solution by Mathematica

Time used: 0.096 (sec). Leaf size: 47

DSolve[{D[y[t],{t,2}]+y[t]==Piecewise[{  {t,0<=t<=Pi}, {Pi*Exp[Pi-t],t>Pi} }],{y[0]==0,Derivative[1][y][0] == 1}},y[t],t,IncludeSingularSolutions -> True]
 
\[ y(t)\to \begin {array}{cc} \{ & \begin {array}{cc} \sin (t) & t\leq 0 \\ t & 0<t\leq \pi \\ \frac {1}{2} \left (-\pi \cos (t)-(2+\pi ) \sin (t)+e^{\pi -t} \pi \right ) & \text {True} \\ \end {array} \\ \end {array} \]