OK, I'm answering this now because no one else has chosen to. Which surprises me since I don't think this is a trivial problem. I hope it wasn't part of an introductory physics course. Or I'm missing something big. So the below is my take which may be subject to revision by others or even myself:
Part (a): You seem to be trying to compute the B field a distance d away from the coil center. Is that what is asked?
As I see it, the flux thru the coil is just the surface-current-induced B field of the permanent magnet (the needle) which, since the needle is assumed uniforly magnetized, would initially (t=0) be a constant Φ0 = πA2B with B = μ0M since the needle is half-way into the coil. But over a short time Δt as the needle leaves the plane of the coil, Φ → 0. Don't know any other way to look at it. So there is a step decrease in Φ from Φ0 to 0, and emf(t) = V(t) = -N dΦ/dt = NπA2μ0M / Δt.
Part (b): To get the work done in bringing the needle from its mid-point to where its end is in the coil plane you can just equate that work with the electrical energy dissipated = ∫V2/R dt from L/2v - Δt/2 to L/2v +Δt/2T. Unfortunately, doing this implies that the work is inversely proportinal to the rate of decay of Φ as the needle leaves the coil plane. So no hard-and-fast answer.