86.4.2 problem 2

Internal problem ID [23109]
Book : An introduction to Differential Equations. By Howard Frederick Cleaves. 1969. Oliver and Boyd publisher. ISBN 0050015044
Section : Chapter 4. Linear equations of the first order. Exercise 4b at page 64
Problem number : 2
Date solved : Thursday, October 02, 2025 at 09:22:52 PM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (\frac {\pi }{4}\right )&=1 \\ \end{align*}
Maple. Time used: 0.018 (sec). Leaf size: 29
ode:=sin(x)*diff(y(x),x)+2*y(x)*cos(x) = 4*cos(x)^3; 
ic:=[y(1/4*Pi) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {\cos \left (2 x \right )^{2}+2 \cos \left (2 x \right )-2}{-2+2 \cos \left (2 x \right )} \]
Mathematica. Time used: 0.041 (sec). Leaf size: 24
ode=Sin[x]*D[y[x],x]+2*y[x]*Cos[x]==4*Cos[x]^3; 
ic={y[Pi/4]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {3 \csc ^2(x)}{4}-\cos ^2(x) \cot ^2(x) \end{align*}
Sympy. Time used: 1.481 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*y(x)*cos(x) + sin(x)*Derivative(y(x), x) - 4*cos(x)**3,0) 
ics = {y(pi/4): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {\frac {3}{4} - \cos ^{4}{\left (x \right )}}{\sin ^{2}{\left (x \right )}} \]