Query on writing KVL equation for an RL circuit
I'd use KCL (not KVL) with the bottom node "grounded" and the top node as \$V\$:

$$\frac{V}{R}+\frac1{L}\int V\:\text{d}t=0\:\text{A}$$

Taking the derivative with respect to time:

$$\begin{align*}\frac1{R}\frac{\text{d}V}{\text{d}t}+\frac{V}{L}&amp;=0\:\frac{\text{A}}{\text{s}}\\\\\frac{\text{d}V}{\text{d}t}+\frac{R}{L}\,V&amp;=0\:\frac{\text{A}}{\text{s}}\end{align*}$$

The integrating factor is then \$\mu=e^{^{\int\frac{R}{L}\text{d}t}}=e^{^{\frac{R}{L}t}}\$ and the solution is:

$$\begin{align*}V&amp;=e^{^{-\frac{R}{L}t}}\int0\:\text{A}\cdot e^{^{\frac{R}{L}t}}\:\text{d}t\\\\&amp;=e^{^{-\frac{R}{L}t}}\left(0\:\text{V}+C_0\right)\\\\&amp;=C_0\cdot e^{^{-\frac{R}{L}t}}\end{align*}$$

From initial conditions, we know that \$C_0=I_0\cdot R\$. So:

$$\begin{align*}V_t&amp;=I_0\cdot R\cdot e^{^{-\frac{R}{L}t}}\end{align*}$$

Here, \$I_0\$ is the initial current in the specified direction.



Using your approach, let's start with a schematic:







simulate this circuit &ndash; Schematic created using CircuitLab

The above schematic will help you keep the signs straight, I think. Note that \$V=L\,\frac{\text{d} I}{\text{d} t}\$ where \$V\$ here is the difference between the top of \$L\$ and the bottom of \$L\$ when the current in \$L\$ is positive when it is down in direction. So in the above case, we find that \$\left(0\:\text{V}-V\right)=L\,\frac{\text{d} I}{\text{d} t}\$ or \$V=-L\,\frac{\text{d} I}{\text{d} t}\$. So,

$$\begin{align*}
0\:\text{V}-L\,\frac{\text{d} I}{\text{d} t} - I\cdot R&amp;=0\:\text{V}\\\\
\frac{\text{d} I}{\text{d} t} + I\cdot \frac{R}{L}&amp;=0\:\text{V}
\end{align*}$$

The integrating factor (again) is then \$\mu=e^{^{\int\frac{R}{L}\text{d}t}}=e^{^{\frac{R}{L}t}}\$ and the solution is:

$$\begin{align*}I&amp;=e^{^{-\frac{R}{L}t}}\int0\:\text{V}\cdot e^{^{\frac{R}{L}t}}\:\text{d}t\\\\&amp;=e^{^{-\frac{R}{L}t}}\left(0\:\text{A}+C_0\right)\\\\&amp;=C_0\cdot e^{^{-\frac{R}{L}t}}\end{align*}$$

From initial conditions, we know that \$C_0=I_0\$. So:

$$\begin{align*}I_t&amp;=I_0\cdot e^{^{-\frac{R}{L}t}}\end{align*}$$

Here again, \$I_0\$ is the initial current in the specified direction, with positive values being down.

I don't like this approach quite so much, in this case, because you have to "think more" about the signs. It works fine. It's just slightly more "twisting of the mind" to make sure everything is fine. The KCL approach is much easier to keep straight because all you do is make sure that you put the outgoing currents on the left and the incoming currents on the right (or visa versa.) And at least to me, that's easier to keep track of.