64.12.25 problem 25

Internal problem ID [13458]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.4. Variation of parameters. Exercises page 162
Problem number : 25
Date solved : Monday, March 31, 2025 at 07:58:29 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.012 (sec). Leaf size: 17
ode:=sin(x)^2*diff(diff(y(x),x),x)-2*sin(x)*cos(x)*diff(y(x),x)+(cos(x)^2+1)*y(x) = sin(x)^3; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (x \right ) \left (c_2 +c_1 x +\frac {1}{2} x^{2}\right ) \]
Mathematica. Time used: 0.058 (sec). Leaf size: 24
ode=Sin[x]^2*D[y[x],{x,2}]-2*Sin[x]*Cos[x]*D[y[x],x]+(Cos[x]^2+1)*y[x]==Sin[x]^3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} \left (x^2+2 c_2 x+2 c_1\right ) \sin (x) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((cos(x)**2 + 1)*y(x) - sin(x)**3 + sin(x)**2*Derivative(y(x), (x, 2)) - 2*sin(x)*cos(x)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -((-sin(x) + Derivative(y(x), (x, 2)))*sin(x)**2 + y(x)*cos(x)**2 + y(x))/(2*sin(x)*cos(x)) + Derivative(y(x), x) cannot be solved by the factorable group method