71.4.20 problem 20

Internal problem ID [14321]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 2. The Initial Value Problem. Exercises 2.2, page 53
Problem number : 20
Date solved : Monday, March 31, 2025 at 12:17:36 PM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (3\right )&=4 \end{align*}

Maple. Time used: 0.067 (sec). Leaf size: 44
ode:=diff(y(x),x) = y(x)/(-x^2+4)+x^(1/2); 
ic:=y(3) = 4; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\left (4 \,5^{{3}/{4}}+5 \int _{3}^{x}\frac {\sqrt {\textit {\_z1}}\, \left (\textit {\_z1} -2\right )^{{1}/{4}}}{\left (\textit {\_z1} +2\right )^{{1}/{4}}}d \textit {\_z1} \right ) \left (x +2\right )^{{1}/{4}}}{5 \left (x -2\right )^{{1}/{4}}} \]
Mathematica. Time used: 0.122 (sec). Leaf size: 63
ode=D[y[x],x]==y[x]/(4-x^2)+Sqrt[x]; 
ic={y[3]==4}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \exp \left (\int _3^x\frac {1}{4-K[1]^2}dK[1]\right ) \left (\int _3^x\exp \left (-\int _3^{K[2]}\frac {1}{4-K[1]^2}dK[1]\right ) \sqrt {K[2]}dK[2]+4\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-sqrt(x) + Derivative(y(x), x) - y(x)/(4 - x**2),0) 
ics = {y(3): 4} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out