32.1.9 problem 9

Internal problem ID [7714]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 24. First order differential equations. Test excercise 24. page 1067
Problem number : 9
Date solved : Tuesday, September 30, 2025 at 05:01:50 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }+y \tanh \left (x \right )&=2 \sinh \left (x \right ) \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 14
ode:=diff(y(x),x)+y(x)*tanh(x) = 2*sinh(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\cosh \left (x \right )^{2}-\frac {1}{2}+c_1 \right ) \operatorname {sech}\left (x \right ) \]
Mathematica. Time used: 0.06 (sec). Leaf size: 23
ode=D[y[x],x]+y[x]*Tanh[x]==2*Sinh[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \text {sech}(x) \left (\int _1^x\sinh (2 K[1])dK[1]+c_1\right ) \end{align*}
Sympy. Time used: 3.405 (sec). Leaf size: 36
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)*tanh(x) - 2*sinh(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \int \frac {2 e^{x} \sinh {\left (x \right )}}{\tanh {\left (x \right )} + 1}\, dx - \int \left (- \frac {y{\left (x \right )} e^{x} \tanh {\left (x \right )}}{\tanh {\left (x \right )} + 1}\right )\, dx = C_{1} \]