71.15.4 problem 4 (d)

Internal problem ID [14546]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 5. The Laplace Transform Method. Exercises 5.4, page 265
Problem number : 4 (d)
Date solved : Tuesday, January 28, 2025 at 06:43:14 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-2 y^{\prime }+y&=\left \{\begin {array}{cc} 0 & 0\le x <1 \\ x^{2}-2 x +3 & 1\le x \end {array}\right . \end{align*}

Using Laplace method With initial conditions

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

Solution by Maple

Time used: 12.087 (sec). Leaf size: 43

dsolve([diff(y(x),x$2)-2*diff(y(x),x)+y(x)=piecewise(0<=x and x<1,0,1<=x,x^2-2*x+3),y(0) = 0, D(y)(0) = 1],y(x), singsol=all)
 
\[ y = \left \{\begin {array}{cc} {\mathrm e}^{x} x & x <1 \\ {\mathrm e}+8 & x =1 \\ {\mathrm e}^{x} x +5+4 \left (x -3\right ) {\mathrm e}^{x -1}+x^{2}+2 x & 1<x \end {array}\right . \]

Solution by Mathematica

Time used: 0.025 (sec). Leaf size: 39

DSolve[{D[y[x],{x,2}]-2*D[y[x],x]+y[x]==Piecewise[{ {0,0<=x<1},{x^2-2*x+3,x>=1}}],{y[0]==0,Derivative[1][y][0] ==1}},y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \begin {array}{cc} \{ & \begin {array}{cc} e^x x & x\leq 1 \\ x^2+e^x x+2 x+4 e^{x-1} (x-3)+5 & \text {True} \\ \end {array} \\ \end {array} \]