8.11.20 problem 35

Internal problem ID [888]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 5.5, Nonhomogeneous equations and undetermined coefficients Page 351
Problem number : 35
Date solved : Wednesday, February 05, 2025 at 04:37:19 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }-2 y^{\prime }+2 y&=x +1 \end{align*}

With initial conditions

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

Solution by Maple

Time used: 0.009 (sec). Leaf size: 22

dsolve([diff(y(x),x$2)-2*diff(y(x),x)+2*y(x)=x+1,y(0) = 3, D(y)(0) = 0],y(x), singsol=all)
 
\[ y = \frac {\left (4 \cos \left (x \right )-5 \sin \left (x \right )\right ) {\mathrm e}^{x}}{2}+\frac {x}{2}+1 \]

Solution by Mathematica

Time used: 0.015 (sec). Leaf size: 26

DSolve[{D[y[x],{x,2}]-2*D[y[x],x]+2*y[x]==x+1,{y[0]==3,Derivative[1][y][0] ==0}},y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \frac {1}{2} \left (x-5 e^x \sin (x)+4 e^x \cos (x)+2\right ) \]