86.2.2 problem 2

Internal problem ID [23076]
Book : An introduction to Differential Equations. By Howard Frederick Cleaves. 1969. Oliver and Boyd publisher. ISBN 0050015044
Section : Chapter 3. Some standard types of differential equations. Exercise 3c at page 50
Problem number : 2
Date solved : Thursday, October 02, 2025 at 09:19:02 PM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (1\right )&=2 \\ \end{align*}
Maple. Time used: 0.007 (sec). Leaf size: 11
ode:=x*diff(y(x),x)+y(x)-1 = 0; 
ic:=[y(1) = 2]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {x +1}{x} \]
Mathematica. Time used: 0.016 (sec). Leaf size: 10
ode=x*D[y[x],x]+(y[x]-1)==0; 
ic={y[1]==2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{x}+1 \end{align*}
Sympy. Time used: 0.106 (sec). Leaf size: 3
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) + y(x) - 1,0) 
ics = {y(0): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 1 \]