12.6.5 problem 5

Internal problem ID [1684]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Exact equations. Section 2.5 Page 79
Problem number : 5
Date solved : Saturday, March 29, 2025 at 11:29:54 PM
CAS classification : [_quadrature]

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

Maple. Time used: 0.005 (sec). Leaf size: 47
ode:=(x+y(x))^2+(x+y(x))^2*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= -x \\ y &= c_1 -x \\ y &= -\frac {c_1}{2}-\frac {i \sqrt {3}\, c_1}{2}-x \\ y &= -\frac {c_1}{2}+\frac {i \sqrt {3}\, c_1}{2}-x \\ \end{align*}
Mathematica. Time used: 0.002 (sec). Leaf size: 18
ode=(x+y[x])^2+(x+y[x])^2*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -x \\ y(x)\to -x+c_1 \\ \end{align*}
Sympy. Time used: 0.177 (sec). Leaf size: 5
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x + y(x))**2*Derivative(y(x), x) + (x + y(x))**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} - x \]