38.3.10 problem 18

Internal problem ID [8277]
Book : A First Course in Differential Equations with Modeling Applications by Dennis G. Zill. 12 ed. Metric version. 2024. Cengage learning.
Section : Chapter 1. Introduction to differential equations. Review problems at page 34
Problem number : 18
Date solved : Tuesday, September 30, 2025 at 05:21:17 PM
CAS classification : [_separable]

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

With initial conditions

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