30.1.22 problem 22

Internal problem ID [7412]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.2, Separable Equations. Exercises. page 46
Problem number : 22
Date solved : Tuesday, September 30, 2025 at 04:31:39 PM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (0\right )&=2 \\ \end{align*}
Maple. Time used: 0.099 (sec). Leaf size: 15
ode:=x^2+2*y(x)*diff(y(x),x) = 0; 
ic:=[y(0) = 2]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {\sqrt {-3 x^{3}+36}}{3} \]
Mathematica. Time used: 0.07 (sec). Leaf size: 18
ode=x^2+2*y[x]*D[y[x],x]==0; 
ic={y[0]==2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \sqrt {4-\frac {x^3}{3}} \end{align*}
Sympy. Time used: 0.247 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2 + 2*y(x)*Derivative(y(x), x),0) 
ics = {y(0): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {\sqrt {36 - 3 x^{3}}}{3} \]