12.3.20 problem 21

Internal problem ID [1597]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. separable equations. Section 2.2 Page 52
Problem number : 21
Date solved : Tuesday, March 04, 2025 at 12:53:34 PM
CAS classification : [_separable]

\begin{align*} x +y y^{\prime }&=0 \end{align*}

With initial conditions

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

Maple. Time used: 0.031 (sec). Leaf size: 15
ode:=x+y(x)*diff(y(x),x) = 0; 
ic:=y(3) = -4; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -\sqrt {-x^{2}+25} \]
Mathematica. Time used: 0.079 (sec). Leaf size: 18
ode=x+y[x]*D[y[x],x]==0; 
ic=y[3]==-4; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\sqrt {25-x^2} \]
Sympy. Time used: 0.340 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x + y(x)*Derivative(y(x), x),0) 
ics = {y(3): -4} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \sqrt {25 - x^{2}} \]