7.5.2 problem 2

Internal problem ID [106]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Section 1.6 (substitution and exact equations). Problems at page 72
Problem number : 2
Date solved : Saturday, March 29, 2025 at 04:31:40 PM
CAS classification : [[_homogeneous, `class A`], _rational, _Bernoulli]

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

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