23.3.27 problem 27

Internal problem ID [5741]
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 : 27
Date solved : Tuesday, September 30, 2025 at 02:02:22 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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