4.1.39 \(y'(x)=f(x)+g(x) y(x)\)

ODE
\[ y'(x)=f(x)+g(x) y(x) \] ODE Classification

[_linear]

Book solution method
Linear ODE

Mathematica
cpu = 0.164215 (sec), leaf count = 47

\[\left \{\left \{y(x)\to \exp \left (\int _1^xg(K[1])dK[1]\right ) \left (\int _1^x\exp \left (-\int _1^{K[2]}g(K[1])dK[1]\right ) f(K[2])dK[2]+c_1\right )\right \}\right \}\]

Maple
cpu = 0.033 (sec), leaf count = 24

\[[y \left (x \right ) = \left (\int f \left (x \right ) {\mathrm e}^{-\left (\int g \left (x \right )d x \right )}d x +\textit {\_C1} \right ) {\mathrm e}^{\int g \left (x \right )d x}]\] Mathematica raw input

DSolve[y'[x] == f[x] + g[x]*y[x],y[x],x]

Mathematica raw output

{{y[x] -> E^Inactive[Integrate][g[K[1]], {K[1], 1, x}]*(C[1] + Inactive[Integrat
e][f[K[2]]/E^Inactive[Integrate][g[K[1]], {K[1], 1, K[2]}], {K[2], 1, x}])}}

Maple raw input

dsolve(diff(y(x),x) = f(x)+g(x)*y(x), y(x))

Maple raw output

[y(x) = (Int(f(x)*exp(-Int(g(x),x)),x)+_C1)*exp(Int(g(x),x))]