50.17.23 problem 5 solved directly

Internal problem ID [8094]
Book : Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section : Chapter 4. Power Series Solutions and Special Functions. Section 4.2. Series Solutions of First-Order Differential Equations Page 162
Problem number : 5 solved directly
Date solved : Monday, January 27, 2025 at 03:43:38 PM
CAS classification : [[_linear, `class A`]]

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

With initial conditions

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

Solution by Maple

Time used: 0.005 (sec). Leaf size: 11

dsolve([diff(y(x),x)=x-y(x),y(0) = 0],y(x), singsol=all)
 
\[ y = x -1+{\mathrm e}^{-x} \]

Solution by Mathematica

Time used: 0.028 (sec). Leaf size: 13

DSolve[{D[y[x],x]==x-y[x],{y[0]==0}},y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to x+e^{-x}-1 \]