30.2.23 problem 27

Internal problem ID [7451]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.3, Linear equations. Exercises. page 54
Problem number : 27
Date solved : Sunday, October 12, 2025 at 01:33:21 AM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (0\right )&=2 \\ \end{align*}
Maple. Time used: 0.227 (sec). Leaf size: 48
ode:=diff(y(x),x)+y(x)*(1+sin(x)^2)^(1/2) = x; 
ic:=[y(0) = 2]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \left (\int _{0}^{x}\textit {\_z1} \,{\mathrm e}^{-\sqrt {2}\, \operatorname {EllipticE}\left (\cos \left (\textit {\_z1} \right ), \frac {\sqrt {2}}{2}\right ) \operatorname {csgn}\left (\sin \left (\textit {\_z1} \right )\right )}d \textit {\_z1} +2\right ) {\mathrm e}^{\operatorname {csgn}\left (\sin \left (x \right )\right ) \operatorname {EllipticE}\left (\cos \left (x \right ), \frac {\sqrt {2}}{2}\right ) \sqrt {2}} \]
Mathematica. Time used: 0.118 (sec). Leaf size: 31
ode=D[y[x],x]+y[x]*Sqrt[1+Sin[x]^2]==x; 
ic={y[0]==2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-E(x|-1)} \left (\int _0^xe^{E(K[1]|-1)} K[1]dK[1]+2\right ) \end{align*}
Sympy. Time used: 5.931 (sec). Leaf size: 63
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x + sqrt(sin(x)**2 + 1)*y(x) + Derivative(y(x), x),0) 
ics = {y(0): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \int x e^{E\left (x\middle | -1\right )}\, dx + \int \sqrt {\sin ^{2}{\left (x \right )} + 1} y{\left (x \right )} e^{E\left (x\middle | -1\right )}\, dx = - \int \limits ^{0} x e^{E\left (x\middle | -1\right )}\, dx + \int \limits ^{0} \sqrt {\sin ^{2}{\left (x \right )} + 1} y{\left (x \right )} e^{E\left (x\middle | -1\right )}\, dx \]