20.4.22 problem Problem 38

Internal problem ID [3657]
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 38
Date solved : Sunday, March 30, 2025 at 02:02:11 AM
CAS classification : [[_homogeneous, `class D`], _Bernoulli]

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

Maple. Time used: 0.004 (sec). Leaf size: 28
ode:=diff(y(x),x)-y(x)/x = 4*x^2/y(x)*cos(x); 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \sqrt {8 \sin \left (x \right )+c_1}\, x \\ y &= -\sqrt {8 \sin \left (x \right )+c_1}\, x \\ \end{align*}
Mathematica. Time used: 0.289 (sec). Leaf size: 36
ode=D[y[x],x]-1/x*y[x]==4*x^2/y[x]*Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -x \sqrt {8 \sin (x)+c_1} \\ y(x)\to x \sqrt {8 \sin (x)+c_1} \\ \end{align*}
Sympy. Time used: 0.416 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*x**2*cos(x)/y(x) + Derivative(y(x), x) - y(x)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - x \sqrt {C_{1} + 8 \sin {\left (x \right )}}, \ y{\left (x \right )} = x \sqrt {C_{1} + 8 \sin {\left (x \right )}}\right ] \]