65.11.6 problem 18.1 (vi)

Internal problem ID [13716]
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 : Wednesday, March 05, 2025 at 10:13:39 PM
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.526 (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.55 (sec). Leaf size: 408
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]
 
\[ y(x)\to \exp \left (\int _1^{\cos (x)}\frac {3 K[1]-2 K[1]^3}{4 K[1]^4-6 K[1]^2+2}dK[1]-\frac {1}{2} \int _1^{\cos (x)}\frac {6 K[2]^4-9 K[2]^2+4}{2 K[2]^5-3 K[2]^3+K[2]}dK[2]\right ) \left (\int _1^{\cos (x)}\frac {\exp \left (\int _1^{K[4]}\frac {3 K[1]-2 K[1]^3}{4 K[1]^4-6 K[1]^2+2}dK[1]+\frac {1}{2} \int _1^{K[4]}\frac {6 K[2]^4-9 K[2]^2+4}{2 K[2]^5-3 K[2]^3+K[2]}dK[2]\right ) \left (2 K[4]^2-1\right ) \int _1^{K[4]}\exp \left (-2 \int _1^{K[3]}\frac {3 K[1]-2 K[1]^3}{4 K[1]^4-6 K[1]^2+2}dK[1]\right )dK[3]}{K[4]^2-1}dK[4]+\int _1^{\cos (x)}\exp \left (-2 \int _1^{K[3]}\frac {3 K[1]-2 K[1]^3}{4 K[1]^4-6 K[1]^2+2}dK[1]\right )dK[3] \left (\int _1^{\cos (x)}\frac {\exp \left (\int _1^{K[5]}\frac {3 K[1]-2 K[1]^3}{4 K[1]^4-6 K[1]^2+2}dK[1]+\frac {1}{2} \int _1^{K[5]}\frac {6 K[2]^4-9 K[2]^2+4}{2 K[2]^5-3 K[2]^3+K[2]}dK[2]\right ) \left (1-2 K[5]^2\right )}{K[5]^2-1}dK[5]+c_2\right )+c_1\right ) \]
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