36.1.26 problem 26

Internal problem ID [6281]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.2, Separable Equations. Exercises. page 46
Problem number : 26
Date solved : Sunday, March 30, 2025 at 10:48:39 AM
CAS classification : [_separable]

\begin{align*} \sqrt {y}+\left (1+x \right ) y^{\prime }&=0 \end{align*}

With initial conditions

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

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