85.33.84 problem 85

Internal problem ID [22707]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter two. First order and simple higher order ordinary differential equations. A Exercises at page 65
Problem number : 85
Date solved : Thursday, October 02, 2025 at 09:11:16 PM
CAS classification : [[_homogeneous, `class C`], _Riccati]

\begin{align*} y^{\prime }&=1-\left (x -y\right )^{2} \end{align*}

With initial conditions

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