2.35.40 Problem 40

2.35.40.1 Maple
2.35.40.2 Mathematica
2.35.40.3 Sympy

Internal problem ID [13964]
Book : Handbook of exact solutions for ordinary differential equations. By Polyanin and Zaitsev. Second edition
Section : Chapter 2, Second-Order Differential Equations. section 2.1.3-1. Equations with exponential functions
Problem number : 40
Date solved : Friday, December 19, 2025 at 08:54:26 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} \left (a \,{\mathrm e}^{\lambda x}+b \right ) y^{\prime \prime }+\left ({\mathrm e}^{\lambda x} c +d \right ) y^{\prime }+k \left (\left (-a k +c \right ) {\mathrm e}^{\lambda x}+d -b k \right ) y&=0 \\ \end{align*}
2.35.40.1 Maple. Time used: 0.276 (sec). Leaf size: 91
ode:=(a*exp(lambda*x)+b)*diff(diff(y(x),x),x)+(c*exp(lambda*x)+d)*diff(y(x),x)+k*((-a*k+c)*exp(lambda*x)+d-b*k)*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = c_1 \,{\mathrm e}^{-k x}+c_2 \,{\mathrm e}^{\frac {\left (b k -d \right ) x}{b}} \operatorname {hypergeom}\left (\left [\frac {2 b k -d}{b \lambda }, \frac {-a d +c b}{b \lambda a}\right ], \left [\frac {\left (2 k +\lambda \right ) b -d}{b \lambda }\right ], -\frac {a \,{\mathrm e}^{\lambda x}}{b}\right ) \]

Maple trace

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 
      A Liouvillian solution exists 
      Reducible group (found an exponential solution) 
      Group is reducible, not completely reducible 
      Solution has integrals. Trying a special function solution free of integr\ 
als... 
      -> Trying a solution in terms of special functions: 
         -> Bessel 
         -> elliptic 
         -> Legendre 
         -> Kummer 
            -> hyper3: Equivalence to 1F1 under a power @ Moebius 
         -> hypergeometric 
            -> heuristic approach 
            <- heuristic approach successful 
         <- hypergeometric successful 
      <- special function solution successful 
         -> Trying to convert hypergeometric functions to elementary form... 
         <- elementary form could result into a too large expression - returnin\ 
g special function form of solution, free of uncomputed integrals 
      <- Kovacics algorithm successful 
   Change of variables used: 
      [x = ln(t)/lambda] 
   Linear ODE actually solved: 
      (-a*k^2*t-b*k^2+c*k*t+d*k)*u(t)+(a*lambda^2*t^2+b*lambda^2*t+c*lambda*t^2\ 
+d*lambda*t)*diff(u(t),t)+(a*lambda^2*t^3+b*lambda^2*t^2)*diff(diff(u(t),t),t) \ 
= 0 
<- change of variables successful
 
2.35.40.2 Mathematica. Time used: 2.592 (sec). Leaf size: 176
ode=(a*Exp[\[Lambda]*x]+b)*D[y[x],{x,2}]+(c*Exp[\[Lambda]*x]+d)*D[y[x],x]+k*((c-a*k)*Exp[\[Lambda]*x]+d-b*k)*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to c_1 \left (e^{\lambda x}\right )^{-\frac {k}{\lambda }}-\frac {b c_2 \lambda \left (e^{\lambda x}\right )^{\frac {b k-d}{b \lambda }} \left (a e^{\lambda x}+b\right )^{\frac {a d-b c}{a b \lambda }} \left (\frac {a e^{\lambda x}}{b}+1\right )^{\frac {b c-a d}{a b \lambda }} \operatorname {Hypergeometric2F1}\left (\frac {b c-a d}{a b \lambda },-\frac {d-2 b k}{b \lambda },\frac {b (2 k+\lambda )-d}{b \lambda },-\frac {a e^{x \lambda }}{b}\right )}{d-2 b k} \end{align*}
2.35.40.3 Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
d = symbols("d") 
k = symbols("k") 
lambda_ = symbols("lambda_") 
y = Function("y") 
ode = Eq(k*(-b*k + d + (-a*k + c)*exp(lambda_*x))*y(x) + (a*exp(lambda_*x) + b)*Derivative(y(x), (x, 2)) + (c*exp(lambda_*x) + d)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
False