6.9.36 problem 38 part (a)

Internal problem ID [1792]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 5 linear second order equations. Section 5.6 Reduction or order. Page 253
Problem number : 38 part (a)
Date solved : Tuesday, September 30, 2025 at 05:19:22 AM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }+y^{2}+k^{2}&=0 \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 13
ode:=diff(y(x),x)+y(x)^2+k^2 = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\tan \left (k \left (c_1 +x \right )\right ) k \]
Mathematica. Time used: 1.904 (sec). Leaf size: 35
ode=D[y[x],x]+y[x]^2+k^2==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -k \tan (k (x-c_1))\\ y(x)&\to -i k\\ y(x)&\to i k \end{align*}
Sympy. Time used: 0.589 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
k = symbols("k") 
y = Function("y") 
ode = Eq(k**2 + y(x)**2 + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \frac {k}{\tan {\left (k \left (C_{1} - x\right ) \right )}} \]