15.1.29 problem 29

Internal problem ID [2869]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 5, page 21
Problem number : 29
Date solved : Sunday, March 30, 2025 at 12:35:34 AM
CAS classification : [_separable]

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

With initial conditions

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

Maple. Time used: 0.277 (sec). Leaf size: 35
ode:=(x^2+x+1)*diff(y(x),x) = y(x)^2+2*y(x)+5; 
ic:=y(1) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -1+2 \cot \left (\frac {4 \sqrt {3}\, \pi }{9}-\frac {4 \sqrt {3}\, \arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right )}{3}+\frac {\pi }{4}\right ) \]
Mathematica. Time used: 0.822 (sec). Leaf size: 44
ode=(x^2+x+1)*D[y[x],x]==y[x]^2+2*y[x]+5; 
ic=y[1]==1; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to 2 \tan \left (\frac {4 \arctan \left (\frac {2 x+1}{\sqrt {3}}\right )}{\sqrt {3}}+\frac {1}{36} \left (9-16 \sqrt {3}\right ) \pi \right )-1 \]
Sympy. Time used: 0.856 (sec). Leaf size: 42
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x**2 + x + 1)*Derivative(y(x), x) - y(x)**2 - 2*y(x) - 5,0) 
ics = {y(1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 2 \tan {\left (\frac {4 \sqrt {3} \operatorname {atan}{\left (\frac {\sqrt {3} \left (2 x + 1\right )}{3} \right )}}{3} - \frac {4 \sqrt {3} \pi }{9} + \frac {\pi }{4} \right )} - 1 \]