18.1.2 problem Problem 14.2 (b)

Internal problem ID [3458]
Book : Mathematical methods for physics and engineering, Riley, Hobson, Bence, second edition, 2002
Section : Chapter 14, First order ordinary differential equations. 14.4 Exercises, page 490
Problem number : Problem 14.2 (b)
Date solved : Tuesday, March 04, 2025 at 04:39:59 PM
CAS classification : [_separable]

\begin{align*} \frac {y^{\prime }}{\tan \left (x \right )}-\frac {y}{x^{2}+1}&=0 \end{align*}

Maple. Time used: 0.000 (sec). Leaf size: 19
ode:=diff(y(x),x)/tan(x)-y(x)/(x^2+1) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = c_{1} {\mathrm e}^{\int \frac {\tan \left (x \right )}{x^{2}+1}d x} \]
Mathematica. Time used: 9.503 (sec). Leaf size: 34
ode=D[y[x],x]/Tan[x]-y[x]/(1+x^2)==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to c_1 \exp \left (\int _1^x\frac {\tan (K[1])}{K[1]^2+1}dK[1]\right ) \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 1.644 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x)/tan(x) - y(x)/(x**2 + 1),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{\int \frac {\tan {\left (x \right )}}{x^{2} + 1}\, dx} \]