59.11.5 problem 18.1 (v)

Internal problem ID [15075]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 18, The variation of constants formula. Exercises page 168
Problem number : 18.1 (v)
Date solved : Thursday, October 02, 2025 at 10:02:39 AM
CAS classification : [[_2nd_order, _missing_y]]

\begin{align*} x^{\prime \prime }-4 x^{\prime }&=\tan \left (t \right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 24
ode:=diff(diff(x(t),t),t)-4*diff(x(t),t) = tan(t); 
dsolve(ode,x(t), singsol=all);
 
\[ x = \int \left (\int \tan \left (t \right ) {\mathrm e}^{-4 t}d t +c_1 \right ) {\mathrm e}^{4 t}d t +c_2 \]
Mathematica. Time used: 60.091 (sec). Leaf size: 82
ode=D[x[t],{t,2}]-4*D[x[t],t]==Tan[t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to \int _1^t\left (e^{4 K[1]} c_1+\frac {1}{20} \left (-5 i \operatorname {Hypergeometric2F1}\left (2 i,1,1+2 i,-e^{2 i K[1]}\right )-(2-4 i) e^{2 i K[1]} \operatorname {Hypergeometric2F1}\left (1,1+2 i,2+2 i,-e^{2 i K[1]}\right )\right )\right )dK[1]+c_2 \end{align*}
Sympy. Time used: 0.399 (sec). Leaf size: 29
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-tan(t) - 4*Derivative(x(t), t) + Derivative(x(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = C_{1} + \left (C_{2} + \frac {\int e^{- 4 t} \tan {\left (t \right )}\, dt}{4}\right ) e^{4 t} + \frac {\log {\left (\cos {\left (t \right )} \right )}}{4} \]