\[ a y(x)-b \sin (c x)+y'(x)=0 \] ✓ Mathematica : cpu = 0.0671842 (sec), leaf count = 40
DSolve[-(b*Sin[c*x]) + a*y[x] + Derivative[1][y][x] == 0,y[x],x]
\[\left \{\left \{y(x)\to \frac {b (a \sin (c x)-c \cos (c x))}{a^2+c^2}+c_1 e^{-a x}\right \}\right \}\] ✓ Maple : cpu = 0.041 (sec), leaf count = 38
dsolve(diff(y(x),x)+a*y(x)-b*sin(c*x) = 0,y(x))
\[y \left (x \right ) = {\mathrm e}^{-a x} c_{1}-\frac {b \left (c \cos \left (c x \right )-\sin \left (c x \right ) a \right )}{a^{2}+c^{2}}\]
Hand solution
\begin {equation} \frac {dy}{dx}+ay\left ( x\right ) =b\sin \left ( cx\right ) \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 b\sin \left ( cx\right ) \\ \mu y\left ( x\right ) & =b\int \mu \sin \left ( cx\right ) dx+C \end {align*}
Replacing \(\mu \) by \(e^{ax}\)
\begin {equation} y\left ( x\right ) =be^{-ax}\int e^{ax}\sin \left ( cx\right ) dx+Ce^{-ax}\tag {2} \end {equation}
Using \(\sin \left ( cx\right ) =\frac {e^{icx}-e^{-icx}}{2i}\) then \begin {align*} \int e^{ax}\sin \left ( cx\right ) dx & =\int \frac {e^{\left ( ic+a\right ) x}-e^{\left ( -ic+a\right ) x}}{2i}dx\\ & =\frac {1}{2i}\left ( \frac {e^{\left ( ic+a\right ) x}}{ic+a}-\frac {e^{\left ( -ic+a\right ) x}}{-ic+a}\right ) \\ & =\frac {1}{2i}e^{ax}\left ( \frac {e^{icx}}{ic+a}-\frac {e^{-icx}}{-ic+a}\right ) \\ & =\frac {1}{2i}e^{ax}\left ( \frac {e^{icx}\left ( -ic+a\right ) -e^{-icx}\left ( ic+a\right ) }{\left ( ic+a\right ) \left ( -ic+a\right ) }\right ) \\ & =\frac {1}{2i}e^{ax}\left ( \frac {-ice^{icx}+ae^{icx}-ice^{-icx}-ae^{-icx}}{\left ( c^{2}+a^{2}\right ) }\right ) \\ & =\frac {1}{2i}e^{ax}\left ( \frac {-ic\left ( e^{icx}+e^{-icx}\right ) +a\left ( e^{icx}-e^{-icx}\right ) }{\left ( c^{2}+a^{2}\right ) }\right ) \\ & =\frac {e^{ax}}{\left ( c^{2}+a^{2}\right ) }\left ( \frac {-ic\left ( e^{icx}+e^{-icx}\right ) }{2i}+\frac {a\left ( e^{icx}-e^{-icx}\right ) }{2i}\right ) \\ & =\frac {e^{ax}}{\left ( c^{2}+a^{2}\right ) }\left ( -c\cos cx+a\sin cx\right ) \end {align*}
Therefore (2) becomes
\begin {align*} y\left ( x\right ) & =be^{-ax}\left [ \frac {e^{ax}}{\left ( c^{2}+a^{2}\right ) }\left ( -c\cos cx+a\sin cx\right ) \right ] +Ce^{-ax}\\ & =\frac {b}{\left ( c^{2}+a^{2}\right ) }\left ( -c\cos cx+a\sin cx\right ) +Ce^{-ax} \end {align*}