75.3.1 problem 1

Internal problem ID [19905]
Book : A short course on differential equations. By Donald Francis Campbell. Maxmillan company. London. 1907
Section : Chapter III. Ordinary differential equations of the first order and first degree. Exercises at page 33
Problem number : 1
Date solved : Thursday, October 02, 2025 at 05:00:45 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }+\frac {y}{x}&=-x^{2}+1 \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 19
ode:=diff(y(x),x)+y(x)/x = -x^2+1; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-\frac {\left (x^{2}-1\right )^{2}}{4}+c_1}{x} \]
Mathematica. Time used: 0.017 (sec). Leaf size: 24
ode=D[y[x],x]+1/x*y[x]==1-x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {x^3}{4}+\frac {x}{2}+\frac {c_1}{x} \end{align*}
Sympy. Time used: 0.126 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2 + Derivative(y(x), x) - 1 + y(x)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1}}{x} - \frac {x^{3}}{4} + \frac {x}{2} \]