80.3.39 problem 42

Internal problem ID [21203]
Book : A Textbook on Ordinary Differential Equations by Shair Ahmad and Antonio Ambrosetti. Second edition. ISBN 978-3-319-16407-6. Springer 2015
Section : Chapter 3. First order nonlinear differential equations. Excercise 3.7 at page 67
Problem number : 42
Date solved : Thursday, October 02, 2025 at 07:26:28 PM
CAS classification : [[_homogeneous, `class A`], _rational, _Bernoulli]

\begin{align*} x^{\prime }&=\frac {t^{2}+x^{2}}{2 x t} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 23
ode:=diff(x(t),t) = 1/2*(t^2+x(t)^2)/t/x(t); 
dsolve(ode,x(t), singsol=all);
 
\begin{align*} x &= \sqrt {\left (t +c_1 \right ) t} \\ x &= -\sqrt {\left (t +c_1 \right ) t} \\ \end{align*}
Mathematica. Time used: 0.119 (sec). Leaf size: 38
ode=D[x[t],t]==(x[t]^2+t^2)/(2*t*x[t]); 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to -\sqrt {t} \sqrt {t+c_1}\\ x(t)&\to \sqrt {t} \sqrt {t+c_1} \end{align*}
Sympy. Time used: 0.247 (sec). Leaf size: 22
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(Derivative(x(t), t) - (t**2 + x(t)**2)/(2*t*x(t)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ \left [ x{\left (t \right )} = - \sqrt {t \left (C_{1} + t\right )}, \ x{\left (t \right )} = \sqrt {t \left (C_{1} + t\right )}\right ] \]