60.1.11 problem 11

Internal problem ID [10025]
Book : Differential Gleichungen, E. Kamke, 3rd ed. Chelsea Pub. NY, 1948
Section : Chapter 1, linear first order
Problem number : 11
Date solved : Wednesday, March 05, 2025 at 08:04:38 AM
CAS classification : [_linear]

\begin{align*} y^{\prime }+f \left (x \right ) y-g \left (x \right )&=0 \end{align*}

Maple. Time used: 0.003 (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 fd x}d x +c_{1} \right ) {\mathrm e}^{-\int fd x} \]
Mathematica. Time used: 0.053 (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]
 
\[ 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 ) \]
Sympy. Time used: 3.889 (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} \]