5.1 problem 1

Internal problem ID [5069]

Book: Ordinary differential equations and calculus of variations. Makarets and Reshetnyak. Wold Scientific. Singapore. 1995
Section: Chapter 2. Linear homogeneous equations. Section 2.3.4 problems. page 104
Problem number: 1.
ODE order: 2.
ODE degree: 1.

CAS Maple gives this as type [[_2nd_order, _exact, _linear, _nonhomogeneous]]

Solve \begin {gather*} \boxed {y^{\prime \prime }+x y^{\prime }+y-2 x \,{\mathrm e}^{x}+1=0} \end {gather*}

Solution by Maple

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

dsolve(diff(y(x),x$2)+x*diff(y(x),x)+y(x)=2*x*exp(x)-1,y(x), singsol=all)
 

\[ y \relax (x ) = {\mathrm e}^{-\frac {x^{2}}{2}} \erf \left (\frac {i \sqrt {2}\, x}{2}\right ) c_{1}+{\mathrm e}^{-\frac {x^{2}}{2}} c_{2}+\left (2 i \sqrt {\pi }\, {\mathrm e}^{-\frac {1}{2}} \sqrt {2}\, \erf \left (\frac {i \sqrt {2}\, x}{2}+\frac {i \sqrt {2}}{2}\right )-{\mathrm e}^{\frac {x^{2}}{2}}+2 \,{\mathrm e}^{\frac {1}{2} x^{2}+x}\right ) {\mathrm e}^{-\frac {x^{2}}{2}} \]

Solution by Mathematica

Time used: 0.129 (sec). Leaf size: 53

DSolve[y''[x]+x*y'[x]+y[x]==2*x*Exp[x]-1,y[x],x,IncludeSingularSolutions -> True]
 

\begin{align*} y(x)\to e^{-\frac {x^2}{2}} \left (\int _1^xe^{\frac {K[1]^2}{2}} \left (c_1+2 e^{K[1]} (K[1]-1)-K[1]\right )dK[1]+c_2\right ) \\ \end{align*}