The question is :- If $PQ$ is an infinite current-carrying conductor, and $AB$ and $CD$ are smooth conducting rods on which a conductor $EF$ moves with a constant velocity $V$. Find the force that needs to act on $EF$ to maintain a constant velocity,
A diagram :- 
I understand the physics, but I need help understanding the math. the law that I used here is Fraday's law.
so $$-\frac{d\phi}{dt}=\frac{dBA}{dt}$$
and $B(x)$ = $\frac{\mu I}{2\pi x}$
where $B$ is the magnetic field
so the flux as an integral is written as $$\int_a^b \frac{\mu I*l}{2\pi x} dx=\frac{\mu Il}{2\pi}\ln{\frac{b}{a}}$$ where $l$ is the instantaneous distance of $EF$ from pint $B$
from which we can then obtain the EMF as $$d \frac{\frac{\mu Il}{2\pi}\ln{\frac{b}{a}}}{dt} = \frac{\mu Iv}{2\pi}\ln{\frac{b}{a}}$$
where $v$ is the velocity This is what I did, and what my book did too, however, I have a problem with this method despite using it as I treated $l$ as a constant in one expression and as a variable in another.
What is the mathematically correct way to do this?
Credit for image:- Toppr.com