23.1.10 problem 1(j)

Internal problem ID [4100]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 2. First order equations. Exercises at page 14
Problem number : 1(j)
Date solved : Monday, January 27, 2025 at 08:08:45 AM
CAS classification : [[_linear, `class A`]]

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

Solution by Maple

Time used: 0.002 (sec). Leaf size: 18

dsolve(diff(y(x),x)+y(x)=x^2+2,y(x), singsol=all)
 
\[ y \left (x \right ) = x^{2}-2 x +4+{\mathrm e}^{-x} c_{1} \]

Solution by Mathematica

Time used: 0.086 (sec). Leaf size: 21

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