64.5.11 problem 11

Internal problem ID [13253]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, section 2.3 (Linear equations). Exercises page 56
Problem number : 11
Date solved : Monday, March 31, 2025 at 07:43:36 AM
CAS classification : [_linear]

\begin{align*} r^{\prime }+r \tan \left (t \right )&=\cos \left (t \right ) \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 10
ode:=diff(r(t),t)+r(t)*tan(t) = cos(t); 
dsolve(ode,r(t), singsol=all);
 
\[ r = \left (t +c_1 \right ) \cos \left (t \right ) \]
Mathematica. Time used: 0.059 (sec). Leaf size: 12
ode=D[r[t],t]+r[t]*Tan[t]==Cos[t]; 
ic={}; 
DSolve[{ode,ic},r[t],t,IncludeSingularSolutions->True]
 
\[ r(t)\to (t+c_1) \cos (t) \]
Sympy. Time used: 0.430 (sec). Leaf size: 8
from sympy import * 
t = symbols("t") 
r = Function("r") 
ode = Eq(r(t)*tan(t) - cos(t) + Derivative(r(t), t),0) 
ics = {} 
dsolve(ode,func=r(t),ics=ics)
 
\[ r{\left (t \right )} = \left (C_{1} + t\right ) \cos {\left (t \right )} \]