32.6.2 problem Exercise 12.2, page 103

Internal problem ID [5867]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 2. Special types of differential equations of the first kind. Lesson 12, Miscellaneous Methods
Problem number : Exercise 12.2, page 103
Date solved : Tuesday, March 04, 2025 at 11:49:33 PM
CAS classification : [`y=_G(x,y')`]

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

Maple. Time used: 0.005 (sec). Leaf size: 23
ode:=cos(y(x))*diff(y(x),x)+sin(y(x)) = x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = -\arcsin \left (-x^{2}+2 x -2+{\mathrm e}^{-x} c_{1} \right ) \]
Mathematica. Time used: 13.893 (sec). Leaf size: 23
ode=Cos[y[x]]*D[y[x],x]+Sin[y[x]]==x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \arcsin \left (x^2-2 x-2 c_1 e^{-x}+2\right ) \]
Sympy. Time used: 4.757 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + sin(y(x)) + cos(y(x))*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \operatorname {asin}{\left (C_{1} e^{- x} - x^{2} + 2 x - 2 \right )} + \pi , \ y{\left (x \right )} = - \operatorname {asin}{\left (C_{1} e^{- x} - x^{2} + 2 x - 2 \right )}\right ] \]