12.1.20 problem Problem 14.24 (c)

Internal problem ID [3476]
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 (c)
Date solved : Tuesday, September 30, 2025 at 06:39:50 AM
CAS classification : [[_homogeneous, `class A`], _rational, _Riccati]

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

With initial conditions

\begin{align*} y \left (1\right )&=1 \\ \end{align*}
Maple. Time used: 0.022 (sec). Leaf size: 18
ode:=diff(y(x),x)-y(x)^2/x^2 = 1/4; 
ic:=[y(1) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {x \left (\ln \left (x \right )-4\right )}{2 \ln \left (x \right )-4} \]
Mathematica. Time used: 0.081 (sec). Leaf size: 20
ode=D[y[x],x]-y[x]^2/x^2==1/4; 
ic=y[1]==1; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {x (\log (x)-4)}{2 (\log (x)-2)} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - 1/4 - y(x)**2/x**2,0) 
ics = {y(1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
ValueError : Couldnt solve for initial conditions