30.1.21 problem 21

Internal problem ID [7411]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.2, Separable Equations. Exercises. page 46
Problem number : 21
Date solved : Tuesday, September 30, 2025 at 04:31:36 PM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (\pi \right )&=1 \\ \end{align*}
Maple. Time used: 0.678 (sec). Leaf size: 48
ode:=1/theta*diff(y(theta),theta) = y(theta)*sin(theta)/(y(theta)^2+1); 
ic:=[y(Pi) = 1]; 
dsolve([ode,op(ic)],y(theta), singsol=all);
 
\[ y = \frac {{\mathrm e}^{-\cos \left (\theta \right ) \theta +\sin \left (\theta \right )+\frac {1}{2}}}{\sqrt {\frac {{\mathrm e}^{-2 \cos \left (\theta \right ) \theta +2 \sin \left (\theta \right )+1}}{\operatorname {LambertW}\left ({\mathrm e}^{-2 \cos \left (\theta \right ) \theta -2 \pi +2 \sin \left (\theta \right )+1}\right )}}} \]
Mathematica. Time used: 1.726 (sec). Leaf size: 29
ode=1/\[Theta]*D[ y[\[Theta]] , \[Theta] ]== y[\[Theta]]*Sin[\[Theta]]/(y[\[Theta]]^2+1); 
ic={y[Pi]==1}; 
DSolve[{ode,ic},y[\[Theta]],\[Theta],IncludeSingularSolutions->True]
 
\begin{align*} y(\theta )&\to \sqrt {W\left (\exp \left (2 \int _{\pi }^{\theta }K[1] \sin (K[1])dK[1]+1\right )\right )} \end{align*}
Sympy
from sympy import * 
theta = symbols("theta") 
y = Function("y") 
ode = Eq(-y(theta)*sin(theta)/(y(theta)**2 + 1) + Derivative(y(theta), theta)/theta,0) 
ics = {y(pi): 1} 
dsolve(ode,func=y(theta),ics=ics)
 
ValueError : Couldnt solve for initial conditions