8.10.1 problem 1

Internal problem ID [2583]
Book : Differential equations and their applications, 4th ed., M. Braun
Section : Chapter 2. Second order differential equations. Section 2.4. The method of variation of parameters. Excercises page 156
Problem number : 1
Date solved : Tuesday, September 30, 2025 at 05:47:26 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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