12.3.4 problem 5

Internal problem ID [1581]
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 : 5
Date solved : Saturday, March 29, 2025 at 11:00:17 PM
CAS classification : [_separable]

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

Maple. Time used: 0.004 (sec). Leaf size: 25
ode:=(3*y(x)^3+3*y(x)*cos(y(x))+1)*diff(y(x),x)+(2*x+1)*y(x)/(x^2+1) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ \ln \left (x^{2}+1\right )+\arctan \left (x \right )+y^{3}+3 \sin \left (y\right )+\ln \left (y\right )+c_1 = 0 \]
Mathematica. Time used: 0.351 (sec). Leaf size: 40
ode=(3*y[x]^3+3*y[x]*Cos[y[x]]+1)*D[y[x],x]+((2*x+1)*y[x])/(1+x^2)== 0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \text {InverseFunction}\left [\text {$\#$1}^3+\log (\text {$\#$1})+3 \sin (\text {$\#$1})\&\right ]\left [-\arctan (x)-\log \left (x^2+1\right )+c_1\right ] \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 2.382 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((2*x + 1)*y(x)/(x**2 + 1) + (3*y(x)**3 + 3*y(x)*cos(y(x)) + 1)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y^{3}{\left (x \right )} + \log {\left (x^{2} + 1 \right )} + \log {\left (y{\left (x \right )} \right )} + 3 \sin {\left (y{\left (x \right )} \right )} + \operatorname {atan}{\left (x \right )} = C_{1} \]