71.1.6 problem 20

Internal problem ID [14236]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 1. Introduction. Exercises page 14
Problem number : 20
Date solved : Wednesday, March 05, 2025 at 10:40:55 PM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }+\frac {1}{2 y}&=0 \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 23
ode:=diff(y(x),x)+1/2/y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \sqrt {-x +c_{1}} \\ y &= -\sqrt {-x +c_{1}} \\ \end{align*}
Mathematica. Time used: 0.068 (sec). Leaf size: 35
ode=D[y[x],x]+1/(2*y[x])==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\sqrt {-x+2 c_1} \\ y(x)\to \sqrt {-x+2 c_1} \\ \end{align*}
Sympy. Time used: 0.219 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) + 1/(2*y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \sqrt {C_{1} - x}, \ y{\left (x \right )} = \sqrt {C_{1} - x}\right ] \]