59.11.6 problem 18.1 (vi)

Internal problem ID [15076]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 18, The variation of constants formula. Exercises page 168
Problem number : 18.1 (vi)
Date solved : Thursday, October 02, 2025 at 10:02:40 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} \left (\tan \left (x \right )^{2}-1\right ) y^{\prime \prime }-4 \tan \left (x \right )^{3} y^{\prime }+2 y \sec \left (x \right )^{4}&=\left (\tan \left (x \right )^{2}-1\right ) \left (1-2 \sin \left (x \right )^{2}\right ) \end{align*}

Using reduction of order method given that one solution is

\begin{align*} y&=\sec \left (x \right )^{2} \end{align*}
Maple. Time used: 0.333 (sec). Leaf size: 29
ode:=(tan(x)^2-1)*diff(diff(y(x),x),x)-4*tan(x)^3*diff(y(x),x)+2*y(x)*sec(x)^4 = (tan(x)^2-1)*(1-2*sin(x)^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (2 x +4 c_1 \right ) \tan \left (x \right )}{4}+\sec \left (x \right )^{2} c_2 -\frac {\cos \left (x \right )^{2}}{4}+\frac {1}{2} \]
Mathematica. Time used: 0.239 (sec). Leaf size: 63
ode=(Tan[x]^2-1)*D[y[x],{x,2}]-4*Tan[x]^3*D[y[x],x]+2*y[x]*Sec[x]^4==(Tan[x]^2-1)*(1-2*Sin[x]^2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {1}{2} \sqrt {\sin ^2(x)} \sec (x) \arctan \left (\frac {\cos (x)}{\sqrt {\sin ^2(x)}}\right )-\frac {1}{4} \cos ^2(x)+c_1 \sec ^2(x)+c_2 \sqrt {\sin ^2(x)} \sec (x)+\frac {1}{2} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((2*sin(x)**2 - 1)*(tan(x)**2 - 1) + (tan(x)**2 - 1)*Derivative(y(x), (x, 2)) + 2*y(x)/cos(x)**4 - 4*tan(x)**3*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -((-cos(2*x) + Derivative(y(x), (x, 2)))*cos(x)**4*tan(x)**2 + (cos(2*x) - Derivative(y(x), (x, 2)))*cos(x)**4 + 2*y(x))/(4*cos(x)**4*tan(x)**3) + Derivative(y(x), x) cannot be solved by the factorable group method