20.4.3 problem Problem 11

Internal problem ID [3638]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.8, Change of Variables. page 79
Problem number : Problem 11
Date solved : Tuesday, March 04, 2025 at 04:55:36 PM
CAS classification : [[_homogeneous, `class A`], _rational, _Riccati]

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

Maple. Time used: 0.006 (sec). Leaf size: 15
ode:=diff(y(x),x) = 1/2*(x+y(x))^2/x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \tan \left (\frac {\ln \left (x \right )}{2}+\frac {c_{1}}{2}\right ) x \]
Mathematica. Time used: 0.263 (sec). Leaf size: 17
ode=D[y[x],x]==(x+y[x])^2/(2*x^2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x \tan \left (\frac {\log (x)}{2}+c_1\right ) \]
Sympy. Time used: 0.298 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (x + y(x))**2/(2*x**2),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x \left (i C_{1} + i e^{i \log {\left (x \right )}}\right )}{C_{1} - e^{i \log {\left (x \right )}}} \]