82.27.2 problem Ex. 2

Internal problem ID [18798]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter VI. Linear equations with constant coefficients. problems at page 73
Problem number : Ex. 2
Date solved : Thursday, March 13, 2025 at 12:59:13 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.003 (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.069 (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 \]