23.3.11 problem 11

Internal problem ID [5725]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 3. THE DIFFERENTIAL EQUATION IS LINEAR AND OF SECOND ORDER, page 311
Problem number : 11
Date solved : Tuesday, September 30, 2025 at 02:02:08 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y+y^{\prime \prime }&=\sec \left (x \right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 22
ode:=y(x)+diff(diff(y(x),x),x) = sec(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\ln \left (\sec \left (x \right )\right ) \cos \left (x \right )+\cos \left (x \right ) c_1 +\sin \left (x \right ) \left (x +c_2 \right ) \]
Mathematica. Time used: 0.015 (sec). Leaf size: 22
ode=y[x] + D[y[x],{x,2}] == Sec[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to (x+c_2) \sin (x)+\cos (x) (\log (\cos (x))+c_1) \end{align*}
Sympy. Time used: 0.132 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), (x, 2)) - 1/cos(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + x\right ) \sin {\left (x \right )} + \left (C_{2} + \log {\left (\cos {\left (x \right )} \right )}\right ) \cos {\left (x \right )} \]