\[ f(x) y(x)-g(x)+y'(x)=0 \] ✓ Mathematica : cpu = 0.495627 (sec), leaf count = 48
\[\left \{\left \{y(x)\to e^{\int _1^x -f(K[1]) \, dK[1]} \left (\int _1^x g(K[2]) e^{-\int _1^{K[2]} -f(K[1]) \, dK[1]} \, dK[2]+c_1\right )\right \}\right \}\]
✓ Maple : cpu = 0.117 (sec), leaf count = 24
\[ \left \{ y \left ( x \right ) = \left ( \int \!g \left ( x \right ) {{\rm e}^{\int \!f \left ( x \right ) \,{\rm d}x}}\,{\rm d}x+{\it \_C1} \right ) {{\rm e}^{\int \!-f \left ( x \right ) \,{\rm d}x}} \right \} \]
\begin {equation} \frac {dy}{dx}+y\left ( x\right ) f\left ( x\right ) =g\left ( x\right ) \tag {1} \end {equation}
Integrating factor \(\mu =e^{\int f\left ( x\right ) dx}\). Therefore (1) becomes\[ \frac {d}{dx}\left ( e^{\int f\left ( x\right ) dx}y\left ( x\right ) \right ) =e^{\int f\left ( x\right ) dx}g\left ( x\right ) \] Integrating\begin {align*} e^{\int f\left ( x\right ) dx}y\left ( x\right ) & =\int e^{\int f\left ( x\right ) dx}g\left ( x\right ) dx+C\\ y\left ( x\right ) & =e^{-\int f\left ( x\right ) dx}\int e^{\int f\left ( x\right ) dx}g\left ( x\right ) dx+e^{-\int f\left ( x\right ) dx}C\\ & =\left ( \int e^{\int f\left ( x\right ) dx}g\left ( x\right ) dx+C\right ) e^{-\int f\left ( x\right ) dx} \end {align*}