75.30.5 problem 814

Internal problem ID [17196]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 3 (Systems of differential equations). Section 23. Methods of integrating nonhomogeneous linear systems with constant coefficients. Exercises page 234
Problem number : 814
Date solved : Monday, March 31, 2025 at 03:44:22 PM
CAS classification : system_of_ODEs

\begin{align*} \frac {d}{d t}x \left (t \right )&=y \left (t \right )\\ \frac {d}{d t}y \left (t \right )&=-x \left (t \right )+\frac {1}{\cos \left (t \right )} \end{align*}

Maple. Time used: 0.204 (sec). Leaf size: 47
ode:=[diff(x(t),t) = y(t), diff(y(t),t) = -x(t)+1/cos(t)]; 
dsolve(ode);
 
\begin{align*} x \left (t \right ) &= \sin \left (t \right ) c_2 +\cos \left (t \right ) c_1 +t \sin \left (t \right )+\ln \left (\cos \left (t \right )\right ) \cos \left (t \right ) \\ y \left (t \right ) &= \cos \left (t \right ) c_2 -\sin \left (t \right ) c_1 +t \cos \left (t \right )-\ln \left (\cos \left (t \right )\right ) \sin \left (t \right ) \\ \end{align*}
Mathematica. Time used: 0.003 (sec). Leaf size: 43
ode={D[x[t],t]==y[t],D[y[t],t]==-x[t]+1/Cos[t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to (t+c_2) \sin (t)+\cos (t) (\log (\cos (t))+c_1) \\ y(t)\to (t+c_2) \cos (t)-\sin (t) (\log (\cos (t))+c_1) \\ \end{align*}
Sympy. Time used: 0.113 (sec). Leaf size: 51
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-y(t) + Derivative(x(t), t),0),Eq(x(t) + Derivative(y(t), t) - 1/cos(t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = C_{1} \sin {\left (t \right )} + C_{2} \cos {\left (t \right )} + t \sin {\left (t \right )} + \log {\left (\cos {\left (t \right )} \right )} \cos {\left (t \right )}, \ y{\left (t \right )} = C_{1} \cos {\left (t \right )} - C_{2} \sin {\left (t \right )} + t \cos {\left (t \right )} - \log {\left (\cos {\left (t \right )} \right )} \sin {\left (t \right )}\right ] \]