88.13.1 problem 1

Internal problem ID [24084]
Book : Elementary Differential Equations. By Lee Roy Wilcox and Herbert J. Curtis. 1961 first edition. International texbook company. Scranton, Penn. USA. CAT number 61-15976
Section : Chapter 4. Linear equations. Exercises at page 86
Problem number : 1
Date solved : Thursday, October 02, 2025 at 09:58:59 PM
CAS classification : [[_linear, `class A`]]

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