54.1.11 problem 11

Internal problem ID [11325]
Book : Differential Gleichungen, E. Kamke, 3rd ed. Chelsea Pub. NY, 1948
Section : Chapter 1, linear first order
Problem number : 11
Date solved : Tuesday, September 30, 2025 at 07:40:27 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }+f \left (x \right ) y-g \left (x \right )&=0 \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 24
ode:=diff(y(x),x)+f(x)*y(x)-g(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\int g \left (x \right ) {\mathrm e}^{\int f \left (x \right )d x}d x +c_1 \right ) {\mathrm e}^{-\int f \left (x \right )d x} \]
Mathematica. Time used: 0.033 (sec). Leaf size: 51
ode=D[y[x],x]  + f[x]*y[x] - g[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \exp \left (\int _1^x-f(K[1])dK[1]\right ) \left (\int _1^x\exp \left (-\int _1^{K[2]}-f(K[1])dK[1]\right ) g(K[2])dK[2]+c_1\right ) \end{align*}
Sympy. Time used: 2.589 (sec). Leaf size: 41
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(f(x)*y(x) - g(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left (e^{\int f{\left (x \right )}\, dx} - \int f{\left (x \right )} e^{\int f{\left (x \right )}\, dx}\, dx\right ) y{\left (x \right )} + \int \left (f{\left (x \right )} y{\left (x \right )} - g{\left (x \right )}\right ) e^{\int f{\left (x \right )}\, dx}\, dx = C_{1} \]