85.35.7 problem 14

Internal problem ID [22727]
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. C Exercises at page 68
Problem number : 14
Date solved : Thursday, October 02, 2025 at 09:14:04 PM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }+y^{2}&=x^{2}+1 \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 25
ode:=diff(y(x),x)+y(x)^2 = x^2+1; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x -\frac {{\mathrm e}^{-x^{2}}}{c_1 -\frac {\sqrt {\pi }\, \operatorname {erf}\left (x \right )}{2}} \]
Mathematica. Time used: 0.097 (sec). Leaf size: 36
ode=D[y[x],x]+y[x]^2==1+x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x+\frac {2 e^{-x^2}}{\sqrt {\pi } \text {erf}(x)+2 c_1}\\ y(x)&\to x \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + y(x)**2 + Derivative(y(x), x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : bad operand type for unary -: list