74.8.30 problem 30

Internal problem ID [16087]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 2. First Order Equations. Review exercises, page 80
Problem number : 30
Date solved : Thursday, March 13, 2025 at 07:48:46 AM
CAS classification : [[_homogeneous, `class C`], _exact, _rational, [_Abel, `2nd type`, `class A`]]

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

With initial conditions

\begin{align*} y \left (0\right )&=1 \end{align*}

Maple. Time used: 0.997 (sec). Leaf size: 22
ode:=2*x-y(x)-2+(2*y(x)-x)*diff(y(x),x) = 0; 
ic:=y(0) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {x}{2}+\frac {\sqrt {-3 x^{2}+8 x +4}}{2} \]
Mathematica. Time used: 0.127 (sec). Leaf size: 29
ode=(2*x-y[x]-2)+(2*y[x]-x)*D[y[x],x]==0; 
ic={y[0]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} \left (x-i \sqrt {3 x^2-8 x-4}\right ) \]
Sympy. Time used: 2.186 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x + (-x + 2*y(x))*Derivative(y(x), x) - y(x) - 2,0) 
ics = {y(0): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x}{2} + \frac {\sqrt {- 27 x^{2} + 72 x + 36}}{6} \]