2.3.16 Problem 16

2.3.16.1 Solved using first_order_ode_riccati
2.3.16.2 Maple
2.3.16.3 Mathematica
2.3.16.4 Sympy

Internal problem ID [13296]
Book : Handbook of exact solutions for ordinary differential equations. By Polyanin and Zaitsev. Second edition
Section : Chapter 1, section 1.2. Riccati Equation. subsection 1.2.3. Equations Containing Exponential Functions
Problem number : 16
Date solved : Wednesday, December 31, 2025 at 01:02:24 PM
CAS classification : [_Riccati]

2.3.16.1 Solved using first_order_ode_riccati

11.024 (sec)

Entering first order ode riccati solver

\begin{align*} y^{\prime }&=a \,{\mathrm e}^{k x} y^{2}+y b +c \,{\mathrm e}^{s x}+d \,{\mathrm e}^{-k x} \\ \end{align*}
In canonical form the ODE is
\begin{align*} y' &= F(x,y)\\ &= a \,{\mathrm e}^{k x} y^{2}+y b +c \,{\mathrm e}^{s x}+d \,{\mathrm e}^{-k x} \end{align*}

This is a Riccati ODE. Comparing the ODE to solve

\[ y' = \textit {the\_rhs} \]
With Riccati ODE standard form
\[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]
Shows that \(f_0(x)=c \,{\mathrm e}^{s x}+d \,{\mathrm e}^{-k x}\), \(f_1(x)=b\) and \(f_2(x)={\mathrm e}^{k x} a\). Let
\begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{u \,{\mathrm e}^{k x} a} \tag {1} \end{align*}

Using the above substitution in the given ODE results (after some simplification) in a second order ODE to solve for \(u(x)\) which is

\begin{align*} f_2 u''(x) -\left ( f_2' + f_1 f_2 \right ) u'(x) + f_2^2 f_0 u(x) &= 0 \tag {2} \end{align*}

But

\begin{align*} f_2' &=k \,{\mathrm e}^{k x} a\\ f_1 f_2 &=b \,{\mathrm e}^{k x} a\\ f_2^2 f_0 &={\mathrm e}^{2 k x} a^{2} \left (c \,{\mathrm e}^{s x}+d \,{\mathrm e}^{-k x}\right ) \end{align*}

Substituting the above terms back in equation (2) gives

\[ {\mathrm e}^{k x} a u^{\prime \prime }\left (x \right )-\left (k \,{\mathrm e}^{k x} a +b \,{\mathrm e}^{k x} a \right ) u^{\prime }\left (x \right )+{\mathrm e}^{2 k x} a^{2} \left (c \,{\mathrm e}^{s x}+d \,{\mathrm e}^{-k x}\right ) u \left (x \right ) = 0 \]
Unable to solve. Will ask Maple to solve this ode now.

The solution for \(u \left (x \right )\) is

\begin{equation} \tag{3} u \left (x \right ) = c_1 \,{\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+c_2 \,{\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right ) \end{equation}
Taking derivative gives
\begin{equation} \tag{4} u^{\prime }\left (x \right ) = c_1 \left (\frac {b}{2}+\frac {k}{2}\right ) {\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\frac {2 c_1 \,{\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \left (-\operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}+1, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}\, {\mathrm e}^{-\frac {x \left (k +s \right )}{2}} \operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )}{2 \sqrt {c}\, \sqrt {a}}\right ) \sqrt {c}\, \sqrt {a}\, \left (\frac {k}{2}+\frac {s}{2}\right ) {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}+c_2 \left (\frac {b}{2}+\frac {k}{2}\right ) {\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\frac {2 c_2 \,{\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \left (-\operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}+1, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}\, {\mathrm e}^{-\frac {x \left (k +s \right )}{2}} \operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )}{2 \sqrt {c}\, \sqrt {a}}\right ) \sqrt {c}\, \sqrt {a}\, \left (\frac {k}{2}+\frac {s}{2}\right ) {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s} \end{equation}
Substituting equations (3,4) into (1) results in
\begin{align*} y &= \frac {-u'}{f_2 u} \\ y &= \frac {-u'}{u \,{\mathrm e}^{k x} a} \\ y &= -\frac {\left (c_1 \left (\frac {b}{2}+\frac {k}{2}\right ) {\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\frac {2 c_1 \,{\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \left (-\operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}+1, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}\, {\mathrm e}^{-\frac {x \left (k +s \right )}{2}} \operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )}{2 \sqrt {c}\, \sqrt {a}}\right ) \sqrt {c}\, \sqrt {a}\, \left (\frac {k}{2}+\frac {s}{2}\right ) {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}+c_2 \left (\frac {b}{2}+\frac {k}{2}\right ) {\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\frac {2 c_2 \,{\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \left (-\operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}+1, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}\, {\mathrm e}^{-\frac {x \left (k +s \right )}{2}} \operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )}{2 \sqrt {c}\, \sqrt {a}}\right ) \sqrt {c}\, \sqrt {a}\, \left (\frac {k}{2}+\frac {s}{2}\right ) {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right ) {\mathrm e}^{-k x}}{a \left (c_1 \,{\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+c_2 \,{\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )\right )} \\ \end{align*}
Doing change of constants, the above solution becomes
\[ y = -\frac {\left (\left (\frac {b}{2}+\frac {k}{2}\right ) {\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\frac {2 \,{\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \left (-\operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}+1, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}\, {\mathrm e}^{-\frac {x \left (k +s \right )}{2}} \operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )}{2 \sqrt {c}\, \sqrt {a}}\right ) \sqrt {c}\, \sqrt {a}\, \left (\frac {k}{2}+\frac {s}{2}\right ) {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}+c_3 \left (\frac {b}{2}+\frac {k}{2}\right ) {\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\frac {2 c_3 \,{\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \left (-\operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}+1, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}\, {\mathrm e}^{-\frac {x \left (k +s \right )}{2}} \operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )}{2 \sqrt {c}\, \sqrt {a}}\right ) \sqrt {c}\, \sqrt {a}\, \left (\frac {k}{2}+\frac {s}{2}\right ) {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right ) {\mathrm e}^{-k x}}{a \left ({\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+c_3 \,{\mathrm e}^{\frac {\left (b +k \right ) x}{2}} \operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )\right )} \]
Simplifying the above gives
\begin{align*} y &= -\frac {{\mathrm e}^{-k x} \left (-2 \sqrt {a}\, \sqrt {c}\, \left (\operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}+k +s}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right ) c_3 +\operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}+k +s}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )\right ) {\mathrm e}^{\frac {x \left (k +s \right )}{2}}+\left (c_3 \operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )\right ) \left (\sqrt {-4 a d +b^{2}+2 b k +k^{2}}+b +k \right )\right )}{2 a \left (c_3 \operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )\right )} \\ \end{align*}

Summary of solutions found

\begin{align*} y &= -\frac {{\mathrm e}^{-k x} \left (-2 \sqrt {a}\, \sqrt {c}\, \left (\operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}+k +s}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right ) c_3 +\operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}+k +s}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )\right ) {\mathrm e}^{\frac {x \left (k +s \right )}{2}}+\left (c_3 \operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )\right ) \left (\sqrt {-4 a d +b^{2}+2 b k +k^{2}}+b +k \right )\right )}{2 a \left (c_3 \operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )+\operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {c}\, \sqrt {a}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )\right )} \\ \end{align*}
2.3.16.2 Maple. Time used: 0.003 (sec). Leaf size: 334
ode:=diff(y(x),x) = a*exp(k*x)*y(x)^2+b*y(x)+c*exp(s*x)+d*exp(-k*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {{\mathrm e}^{-\frac {x \left (k -s \right )}{2}} \sqrt {c}\, a \left (\operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}+k +s}{k +s}, \frac {2 \sqrt {a}\, \sqrt {c}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right ) c_1 +\operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}+k +s}{k +s}, \frac {2 \sqrt {a}\, \sqrt {c}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )\right )-\frac {\sqrt {a}\, {\mathrm e}^{-k x} \left (\operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {a}\, \sqrt {c}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right ) c_1 +\operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {a}\, \sqrt {c}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )\right ) \left (\sqrt {-4 a d +b^{2}+2 b k +k^{2}}+b +k \right )}{2}}{a^{{3}/{2}} \left (\operatorname {BesselY}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {a}\, \sqrt {c}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right ) c_1 +\operatorname {BesselJ}\left (\frac {\sqrt {-4 a d +b^{2}+2 b k +k^{2}}}{k +s}, \frac {2 \sqrt {a}\, \sqrt {c}\, {\mathrm e}^{\frac {x \left (k +s \right )}{2}}}{k +s}\right )\right )} \]

Maple trace

Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
trying Bernoulli 
trying separable 
trying inverse linear 
trying homogeneous types: 
trying Chini 
differential order: 1; looking for linear symmetries 
trying exact 
Looking for potential symmetries 
trying Riccati 
trying Riccati sub-methods: 
   trying Riccati_symmetries 
   trying Riccati to 2nd Order 
   -> Calling odsolve with the ODE, diff(diff(y(x),x),x) = (b+k)*diff(y(x),x)-a 
*exp(k*x)*(c*exp(s*x)+d*exp(-k*x))*y(x), y(x) 
      *** Sublevel 2 *** 
      Methods for second order ODEs: 
      --- Trying classification methods --- 
      trying a symmetry of the form [xi=0, eta=F(x)] 
      checking if the LODE is missing y 
      -> Heun: Equivalence to the GHE or one of its 4 confluent cases under a \ 
power @ Moebius 
      -> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = exp(int\ 
(r(x), dx)) * 2F1([a1, a2], [b1], f) 
      -> Trying changes of variables to rationalize or make the ODE simpler 
         trying a quadrature 
         checking if the LODE has constant coefficients 
         checking if the LODE is of Euler type 
         trying a symmetry of the form [xi=0, eta=F(x)] 
         checking if the LODE is missing y 
         -> Trying a Liouvillian solution using Kovacics algorithm 
         <- No Liouvillian solutions exists 
         -> Trying a solution in terms of special functions: 
            -> Bessel 
            <- Bessel successful 
         <- special function solution successful 
         Change of variables used: 
            [x = ln(t)/(k+s)] 
         Linear ODE actually solved: 
            (a*c*t+a*d)*u(t)+(-b*k*t-b*s*t+k*s*t+s^2*t)*diff(u(t),t)+(k^2*t^2+2\ 
*k*s*t^2+s^2*t^2)*diff(diff(u(t),t),t) = 0 
      <- change of variables successful 
   <- Riccati to 2nd Order successful
 

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=a \,{\mathrm e}^{k x} y \left (x \right )^{2}+b y \left (x \right )+c \,{\mathrm e}^{s x}+d \,{\mathrm e}^{-k x} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d x}y \left (x \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=a \,{\mathrm e}^{k x} y \left (x \right )^{2}+b y \left (x \right )+c \,{\mathrm e}^{s x}+d \,{\mathrm e}^{-k x} \end {array} \]
2.3.16.3 Mathematica. Time used: 5.127 (sec). Leaf size: 1636
ode=D[y[x],x]==a*Exp[k*x]*y[x]^2+b*y[x]+c*Exp[s*x]+d*Exp[-k*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} \text {Solution too large to show}\end{align*}
2.3.16.4 Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
d = symbols("d") 
k = symbols("k") 
s = symbols("s") 
y = Function("y") 
ode = Eq(-a*y(x)**2*exp(k*x) - b*y(x) - c*exp(s*x) - d*exp(-k*x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -a*y(x)**2*exp(k*x) - b*y(x) - c*exp(s*x) - d*exp(-k*x) + Derivative(y(x), x) cannot be solved by the lie group method