12.5.17 problem 13

Internal problem ID [1641]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Transformation of Nonlinear Equations into Separable Equations. Section 2.4 Page 68
Problem number : 13
Date solved : Thursday, March 13, 2025 at 04:03:53 PM
CAS classification : [_Bernoulli]

\begin{align*} y^{\prime }-y&=x \sqrt {y} \end{align*}

With initial conditions

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

Maple. Time used: 0.044 (sec). Leaf size: 26
ode:=diff(y(x),x)-y(x) = x*y(x)^(1/2); 
ic:=y(0) = 4; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \left (-8 x -16\right ) {\mathrm e}^{\frac {x}{2}}+x^{2}+4 x +16 \,{\mathrm e}^{x}+4 \]
Mathematica. Time used: 0.154 (sec). Leaf size: 28
ode=D[y[x],x]-y[x]==x*y[x]^(1/2); 
ic=y[0]==4; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \left (x-4 e^{x/2}+2\right )^2 \\ y(x)\to (x+2)^2 \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*sqrt(y(x)) - y(x) + Derivative(y(x), x),0) 
ics = {y(0): 4} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : Initial conditions produced too many solutions for constants