2.2   ODE No. 2

\[ a y(x)+c \left (-e^{b x}\right )+y'(x)=0 \]

Mathematica : cpu = 0.0820509 (sec), leaf count = 34

DSolve[-(c*E^(b*x)) + a*y[x] + Derivative[1][y][x] == 0,y[x],x]
 
\[\left \{\left \{y(x)\to \frac {c e^{x (a+b)-a x}}{a+b}+c_1 e^{-a x}\right \}\right \}\]

Maple : cpu = 0.009 (sec), leaf count = 25

dsolve(diff(y(x),x)+a*y(x)-c*exp(b*x) = 0,y(x))
 
\[y \left (x \right ) = \left (\frac {c \,{\mathrm e}^{\left (a +b \right ) x}}{a +b}+c_{1} \right ) {\mathrm e}^{-a x}\]

Hand solution

\begin{equation} \frac {dy}{dx}+ay\left ( x\right ) =ce^{bx}\tag {1}\end{equation}

Integrating factor \(\mu =e^{\int adx}=e^{ax}\). Hence (1) becomes

\begin{align*} \frac {d}{dx}\left ( \mu y\left ( x\right ) \right ) & =\mu ce^{bx}\\ \mu y\left ( x\right ) & =\int \mu ce^{bx}dx+C \end{align*}

Replacing \(\mu \) by \(e^{ax}\)

\begin{align*} y\left ( x\right ) & =ce^{-ax}\int e^{\left ( a+b\right ) x}dx+Ce^{-ax}\\ & =ce^{-ax}\frac {e^{\left ( a+b\right ) x}}{a+b}+Ce^{-ax}\\ & =\frac {ce^{\left ( a+b\right ) x-ax}}{a+b}+Ce^{-ax}\end{align*}

Can be reduced to

\[ y\left ( x\right ) =c\frac {e^{bx}}{a+b}+Ce^{-ax}\]