58.12.12 problem 12

Internal problem ID [14797]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.4. Variation of parameters. Exercises page 162
Problem number : 12
Date solved : Thursday, October 02, 2025 at 09:55:00 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&=\tan \left (x \right )^{3} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 27
ode:=diff(diff(y(x),x),x)+y(x) = tan(x)^3; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (x \right ) c_2 +\cos \left (x \right ) c_1 +\frac {\tan \left (x \right )}{2}+\frac {3 \ln \left (\sec \left (x \right )+\tan \left (x \right )\right ) \cos \left (x \right )}{2} \]
Mathematica. Time used: 0.029 (sec). Leaf size: 39
ode=D[y[x],{x,2}]+y[x]==Tan[x]^3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{2} \sec (x) \left (3 \cos ^2(x) \text {arctanh}(\sin (x))+\sin (x)+c_1 \cos (2 x)+c_2 \sin (2 x)+c_1\right ) \end{align*}
Sympy. Time used: 0.253 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - tan(x)**3 + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{2} \sin {\left (x \right )} + \left (C_{1} - \frac {3 \log {\left (\sin {\left (x \right )} - 1 \right )}}{4} + \frac {3 \log {\left (\sin {\left (x \right )} + 1 \right )}}{4}\right ) \cos {\left (x \right )} + \frac {\tan {\left (x \right )}}{2} \]