71.2.2 problem 2

Internal problem ID [14334]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 1. Introduction. Exercises 1.3, page 27
Problem number : 2
Date solved : Tuesday, January 28, 2025 at 06:26:51 AM
CAS classification : [[_linear, `class A`]]

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

Solution by Maple

Time used: 0.001 (sec). Leaf size: 15

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

Solution by Mathematica

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

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