65.4.5 problem 9.1 (v)

Internal problem ID [13664]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 9, First order linear equations and the integrating factor. Exercises page 86
Problem number : 9.1 (v)
Date solved : Monday, March 31, 2025 at 08:07:05 AM
CAS classification : [_linear]

\begin{align*} x^{\prime }+x \tanh \left (t \right )&=3 \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 13
ode:=diff(x(t),t)+x(t)*tanh(t) = 3; 
dsolve(ode,x(t), singsol=all);
 
\[ x = 3 \tanh \left (t \right )+c_1 \,\operatorname {sech}\left (t \right ) \]
Mathematica. Time used: 0.054 (sec). Leaf size: 23
ode=D[x[t],t]+x[t]*Tanh[t]==3; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \text {sech}(t) \left (\int _1^t3 \cosh (K[1])dK[1]+c_1\right ) \]
Sympy. Time used: 0.475 (sec). Leaf size: 20
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(x(t)*tanh(t) + Derivative(x(t), t) - 3,0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = C_{1} e^{- t} \tanh {\left (t \right )} + C_{1} e^{- t} + 3 \tanh {\left (t \right )} \]