15.14.18 problem 18

Internal problem ID [3190]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 23, page 106
Problem number : 18
Date solved : Tuesday, March 04, 2025 at 04:05:40 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.004 (sec). Leaf size: 26
ode:=diff(diff(y(x),x),x)-diff(y(x),x)-2*y(x) = x^2-8; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{2 x} c_2 +{\mathrm e}^{-x} c_{1} -\frac {x^{2}}{2}+\frac {x}{2}+\frac {13}{4} \]
Mathematica. Time used: 0.016 (sec). Leaf size: 36
ode=D[y[x],{x,2}]-D[y[x],x]-2*y[x]==x^2-8; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{4} \left (-2 x^2+2 x+13\right )+c_1 e^{-x}+c_2 e^{2 x} \]
Sympy. Time used: 0.179 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 - 2*y(x) - Derivative(y(x), x) + Derivative(y(x), (x, 2)) + 8,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- x} + C_{2} e^{2 x} - \frac {x^{2}}{2} + \frac {x}{2} + \frac {13}{4} \]