78.1.34 problem 3 (b)

Internal problem ID [18018]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 1. The Nature of Differential Equations. Separable Equations. Section 2. Problems at page 9
Problem number : 3 (b)
Date solved : Monday, March 31, 2025 at 04:56:48 PM
CAS classification : [_quadrature]

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

With initial conditions

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

Maple. Time used: 0.020 (sec). Leaf size: 12
ode:=diff(y(x),x) = 2*cos(x)*sin(x); 
ic:=y(0) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -\frac {\cos \left (2 x \right )}{2}+\frac {3}{2} \]
Mathematica. Time used: 0.004 (sec). Leaf size: 17
ode=D[y[x],x]==2*Sin[x]*Cos[x]; 
ic={y[0]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} (3-\cos (2 x)) \]
Sympy. Time used: 0.131 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*sin(x)*cos(x) + Derivative(y(x), x),0) 
ics = {y(0): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {3}{2} - \frac {\cos {\left (2 x \right )}}{2} \]