89.18.6 problem 6

Internal problem ID [24706]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 9. Nonhomogeneous Equations: Undetermined coefficients. Oral Exercises at page 146
Problem number : 6
Date solved : Thursday, October 02, 2025 at 10:47:18 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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