2.3.27 problem 28

Internal problem ID [703]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 1.4. Separable equations. Page 43
Problem number : 28
Date solved : Tuesday, September 30, 2025 at 04:06:34 AM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (4\right )&=\frac {\pi }{4} \\ \end{align*}
Maple. Time used: 0.130 (sec). Leaf size: 10
ode:=2*x^(1/2)*diff(y(x),x) = cos(y(x))^2; 
ic:=[y(4) = 1/4*Pi]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \arctan \left (-1+\sqrt {x}\right ) \]
Mathematica. Time used: 0.314 (sec). Leaf size: 17
ode=2*x^(1/2)*D[y[x],x] == Cos[y[x]]^2; 
ic=y[4]==Pi/4; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\arctan \left (1-\sqrt {x}\right ) \end{align*}
Sympy. Time used: 1.012 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*sqrt(x)*Derivative(y(x), x) - cos(y(x))**2,0) 
ics = {y(4): pi/4} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 2 \operatorname {atan}{\left (\frac {\sqrt {- 2 \sqrt {x} + x + 2} - 1}{\sqrt {x} - 1} \right )} \]