23.3.8 problem 8

Internal problem ID [5722]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 3. THE DIFFERENTIAL EQUATION IS LINEAR AND OF SECOND ORDER, page 311
Problem number : 8
Date solved : Tuesday, September 30, 2025 at 02:02:06 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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