76.5.11 problem 11

Internal problem ID [17360]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 2. First order differential equations. Section 2.7 (Substitution Methods). Problems at page 108
Problem number : 11
Date solved : Monday, March 31, 2025 at 03:59:41 PM
CAS classification : [[_homogeneous, `class A`], _rational, _Bernoulli]

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

With initial conditions

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

Maple. Time used: 0.091 (sec). Leaf size: 19
ode:=x*y(x)*diff(y(x),x) = x^2+y(x)^2; 
ic:=y(2) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\sqrt {8 \ln \left (x \right )-8 \ln \left (2\right )+1}\, x}{2} \]
Mathematica. Time used: 0.178 (sec). Leaf size: 24
ode=x*y[x]*D[y[x],x]==x^2+y[x]^2; 
ic={y[2]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} x \sqrt {8 \log (x)+1-8 \log (2)} \]
Sympy. Time used: 0.439 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + x*y(x)*Derivative(y(x), x) - y(x)**2,0) 
ics = {y(2): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \sqrt {2 \log {\left (x \right )} - \log {\left (4 \right )} + \frac {1}{4}} \]