77.12.2 problem 2

Internal problem ID [20459]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter III. Ordinary linear differential equations with constant coefficients. Exercise III (D) at page 37
Problem number : 2
Date solved : Thursday, October 02, 2025 at 06:03:04 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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