18.1.21 problem Problem 14.24 (d)

Internal problem ID [3477]
Book : Mathematical methods for physics and engineering, Riley, Hobson, Bence, second edition, 2002
Section : Chapter 14, First order ordinary differential equations. 14.4 Exercises, page 490
Problem number : Problem 14.24 (d)
Date solved : Tuesday, March 04, 2025 at 04:41:39 PM
CAS classification : [[_homogeneous, `class A`], _rational, _Riccati]

\begin{align*} y^{\prime }-\frac {y^{2}}{x^{2}}&={\frac {1}{4}} \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 21
ode:=diff(y(x),x)-y(x)^2/x^2 = 1/4; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {x \left (\ln \left (x \right )+c_{1} -2\right )}{2 \ln \left (x \right )+2 c_{1}} \]
Mathematica. Time used: 0.094 (sec). Leaf size: 36
ode=D[y[x],x]-y[x]^2/x^2==1/4; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {x (\log (x)-2+4 c_1)}{2 (\log (x)+4 c_1)} \\ y(x)\to \frac {x}{2} \\ \end{align*}
Sympy. Time used: 0.180 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - 1/4 - y(x)**2/x**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (\frac {1}{2} - 8 x^{2}\right ) \]