35.6.22 problem 22

Internal problem ID [6172]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 6. SECOND-ORDER LINEAR EQUATIONSWITH CONSTANT COEFFICIENTS AND RIGHT-HAND SIDE NOT ZERO. page 422
Problem number : 22
Date solved : Sunday, March 30, 2025 at 10:41:55 AM
CAS classification : [[_2nd_order, _missing_y]]

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

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