43.2.3 problem 1(c)

Internal problem ID [8879]
Book : An introduction to Ordinary Differential Equations. Earl A. Coddington. Dover. NY 1961
Section : Chapter 1.6 Introduction– Linear equations of First Order. Page 41
Problem number : 1(c)
Date solved : Tuesday, September 30, 2025 at 05:58:16 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }-2 y&=x^{2}+x \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 18
ode:=diff(y(x),x)-2*y(x) = x^2+x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{2 x} c_1 -\frac {\left (x +1\right )^{2}}{2} \]
Mathematica. Time used: 0.068 (sec). Leaf size: 34
ode=D[y[x],x]-2*y[x]==x^2+x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{2 x} \left (\int _1^xe^{-2 K[1]} K[1] (K[1]+1)dK[1]+c_1\right ) \end{align*}
Sympy. Time used: 0.074 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 - x - 2*y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{2 x} - \frac {x^{2}}{2} - x - \frac {1}{2} \]