RC Circuit - Differential equation (beginner question)
The equation is established by the virtue of Kirchhoff's voltage law that net
"The directed sum of electric potential differences around a closed loop is zero." So therefore as taking this loop (E,R,R,L) is a closed loop law holds.

Now coming to eliminating i2 that can be done by forming a loop of(E,R,R).
And solving the set of equations.

TIP: Use can use Laplace transform for quicker solution