15.16.8 problem 8

Internal problem ID [3228]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 25, page 112
Problem number : 8
Date solved : Sunday, March 30, 2025 at 01:21:56 AM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.002 (sec). Leaf size: 21
ode:=x^2*diff(diff(y(x),x),x)+3*x*diff(y(x),x)+y(x) = 1-x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {c_2}{x}-\frac {x}{4}+1+\frac {c_1 \ln \left (x \right )}{x} \]
Mathematica. Time used: 0.026 (sec). Leaf size: 26
ode=x^2*D[y[x],{x,2}]+3*x*D[y[x],x]+y[x]==1-x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {x}{4}+\frac {c_1}{x}+\frac {c_2 \log (x)}{x}+1 \]
Sympy. Time used: 0.240 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), (x, 2)) + 3*x*Derivative(y(x), x) + x + y(x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} + C_{2} \log {\left (x \right )} + \frac {x \left (4 - x\right )}{4}}{x} \]