20.2.10 problem Problem 10

Internal problem ID [3602]
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.4, Separable Differential Equations. page 43
Problem number : Problem 10
Date solved : Sunday, March 30, 2025 at 01:54:06 AM
CAS classification : [_separable]

\begin{align*} y^{\prime }&=\frac {x^{2} y-32}{-x^{2}+16}+2 \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 22
ode:=diff(y(x),x) = (x^2*y(x)-32)/(-x^2+16)+2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {{\mathrm e}^{-x} \left (x +4\right )^{2} c_1}{\left (x -4\right )^{2}}+2 \]
Mathematica. Time used: 0.183 (sec). Leaf size: 40
ode=D[y[x],x]==(x^2*y[x]-32)/(16-x^2)+2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {e^{-x} \left (2 e^x (x-4)^2+c_1 (x+4)^2\right )}{(x-4)^2} \\ y(x)\to 2 \\ \end{align*}
Sympy. Time used: 0.404 (sec). Leaf size: 58
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - 2 - (x**2*y(x) - 32)/(16 - x**2),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x^{2} e^{C_{1}} e^{- x}}{x^{2} - 8 x + 16} + \frac {8 x e^{C_{1}} e^{- x}}{x^{2} - 8 x + 16} + 2 + \frac {16 e^{C_{1}} e^{- x}}{x^{2} - 8 x + 16} \]