12.1.18 problem 10(a)

Internal problem ID [1536]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 1, Introduction. Section 1.2 Page 14
Problem number : 10(a)
Date solved : Saturday, March 29, 2025 at 10:58:02 PM
CAS classification : [[_1st_order, _with_linear_symmetries], _Clairaut]

\begin{align*} y^{\prime }&=-\frac {x}{2}-1+\frac {\sqrt {x^{2}+4 x +4 y}}{2} \end{align*}

Maple. Time used: 0.016 (sec). Leaf size: 23
ode:=diff(y(x),x) = -1/2*x-1+1/2*(x^2+4*x+4*y(x))^(1/2); 
dsolve(ode,y(x), singsol=all);
 
\[ x -\sqrt {x^{2}+4 x +4 y}-c_1 = 0 \]
Mathematica. Time used: 0.841 (sec). Leaf size: 47
ode=D[y[x],x] ==1/2*(-(x+2)+Sqrt[x^2+4*x+4*y[x]]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {1}{4} \left (-2 x+2 e^{c_1} (x+1)+1+e^{2 c_1}\right ) \\ y(x)\to 1 \\ y(x)\to \frac {1}{4} (1-2 x) \\ \end{align*}
Sympy. Time used: 0.776 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x/2 - sqrt(x**2 + 4*x + 4*y(x))/2 + Derivative(y(x), x) + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1}^{2}}{4} + \frac {C_{1} x}{2} - x \]