1.2.15 problem 17

Internal problem ID [33]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Section 1.3. Problems at page 27
Problem number : 17
Date solved : Tuesday, September 30, 2025 at 03:38:49 AM
CAS classification : [_separable]

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

With initial conditions

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