83.12.2 problem 2

Internal problem ID [19095]
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, March 13, 2025 at 01:40:12 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.005 (sec). Leaf size: 19
ode:=diff(diff(y(x),x),x)-y(x) = 2+5*x; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = c_{2} {\mathrm e}^{-x}+{\mathrm e}^{x} c_{1} -2-5 x \]
Mathematica. Time used: 0.013 (sec). Leaf size: 24
ode=D[y[x],{x,2}]-y[x]==2+5*x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -5 x+c_1 e^x+c_2 e^{-x}-2 \]
Sympy. Time used: 0.066 (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 \]