# Find the general solution of $\Large \frac{dy}{dx}\normalsize =ay-e^{mx}$

Toolbox:
• A linear differential equation is of the form $\large\frac{dy}{dx}$$+Py=Q • The required solution is ye^{\large\int pdx}$$=\int Q \times e^{\large\int pdx}+c$
• Where $e^{\large\int pdx}$ is the integrating factor
• $\int e^{ax}dx=\large\frac{1}{a} $$e^{ax}+c Step 1: Given \large\frac{dy}{dx}$$=ay-e^{mx}$
This can be written as
$\large\frac{dy}{dx}$$-ay=-e^{mx} This is of the form \large\frac{dy}{dx}$$+Py=Q$
Clearly this is a linear differential equation, Where $P=-a$ and $Q=-e^{mx}$
The solution for a linear differential equation,
$y \times I.F=\int Q.I.F dx+c$
Let us first find the integrating factor I.F which is $e^{\large\int pdx}$
$\int pdx=\int -adx=-ax$
Hence $e^{\large\int pdx}=e^{-ax}$
Substituting this for I.F we get
Step 2:
$y.e^{-ax}=\int -e^{-mx}.e^{-ax}dx+c$
$=-\int e^{-(m+a)x}dx+c$
On integrating this we get
$ye^{-ax}=-\bigg[-\bigg(\large\frac{1}{-(m+a)}\bigg)$$e^{-(m+a)x}\bigg]+c =>ye^{-ax}=-\bigg(\bigg[\large\frac{1}{(m+a)}\bigg]$$e^{-(m+a)x}\bigg)+c$
Multiplying throughout by $(a+m)e^{ax}$
$y(a+m)=e^{mx}+c\;e^{-ax}(a+m)$
But $(a+m)$ is also a constant, hence let us write $c(a+m)$ as K. we get $(a+m)y=e^{mx}+Ke^{-ax}$
Hence the required solution is
$(a+m)y=e^{mx}+Ke^{-ax}$