20.4.46 problem Problem 64

Internal problem ID [3681]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.8, Change of Variables. page 79
Problem number : Problem 64
Date solved : Sunday, March 30, 2025 at 02:05:06 AM
CAS classification : [[_1st_order, `_with_symmetry_[F(x),G(x)*y+H(x)]`]]

\begin{align*} \frac {y^{\prime }}{y}+p \left (x \right ) \ln \left (y\right )&=q \left (x \right ) \end{align*}

Maple. Time used: 0.080 (sec). Leaf size: 27
ode:=diff(y(x),x)/y(x)+p(x)*ln(y(x)) = q(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{\left (\int {\mathrm e}^{\int p \left (x \right )d x} q \left (x \right )d x -c_1 \right ) {\mathrm e}^{-\int p \left (x \right )d x}} \]
Mathematica. Time used: 0.195 (sec). Leaf size: 109
ode=D[y[x],x]/y[x]+p[x]*Log[y[x]]==q[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\int _1^x\exp \left (-\int _1^{K[2]}-p(K[1])dK[1]\right ) (\log (y(x)) p(K[2])-q(K[2]))dK[2]+\int _1^{y(x)}\left (\frac {\exp \left (-\int _1^x-p(K[1])dK[1]\right )}{K[3]}-\int _1^x\frac {\exp \left (-\int _1^{K[2]}-p(K[1])dK[1]\right ) p(K[2])}{K[3]}dK[2]\right )dK[3]=c_1,y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
p = Function("p") 
q = Function("q") 
ode = Eq(p(x)*log(y(x)) - q(x) + Derivative(y(x), x)/y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -(-p(x)*log(y(x)) + q(x))*y(x) + Derivative(y(x), x) cannot be solved by the factorable group method