44.3.10 problem 18

Internal problem ID [6991]
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 : Wednesday, March 05, 2025 at 04:01:27 AM
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.049 (sec). Leaf size: 27
ode:=(2*y(x)-2)*diff(y(x),x) = 2*x-1; 
ic:=y(0) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\begin{align*} y &= 1-\sqrt {\left (x -1\right ) x} \\ y &= 1+\sqrt {\left (x -1\right ) x} \\ \end{align*}
Mathematica. Time used: 0.09 (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.556 (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 ] \]