How can it be justified that the phase difference between voltage and current for inductor is $\pi/2?$ The inductor is an ideal one, the phase difference is with respect to current, and the voltage varies by the law $V=V_Lsin(\omega t).$
One can prove that the current function will come out to be $I=I_Lsin(\omega t-\frac{\pi}{2}).$
It can also be proved that the phase difference b/w the functions wrt to the later function will be $\frac{T}{4}$ where $T$ is the fundamental period of the function $cos(\omega t).$ All books mention this (tough without giving proof). All books also mention that the phase difference is also $\frac{\pi}{2}.$ Some hint that they think this because there is $-\frac{\pi}{2}$ in the current function. But that's stupid.
If one accepts that both are phase difference then $\frac{T}{4}=\frac{\pi}{2}$ then $\omega=1.$ So $\frac{\pi}{2}$ will be phase difference only when $\omega=1.$ So it is clear that , in general, $\frac{\pi}{2}$ must not be phase difference; it is not true for $\omega=2.$
You can judge this graphically as well. As you move the slider for $w$ in this graph you will note that the phase difference changes and does not remain constant to $\frac{\pi}{2}.$
But again all the books have written that hence there should be mistake in my reasoning but where?
 A: It's because the voltage across an inductor is related to the current going through it by a time derivative
$$V_L=L\frac{\text dI}{\text dt}$$
and the derivative of sines and cosines give you functions that are $\pi/2$ out of phase. This is independent of $\omega$ for $\sin(\omega t)$ or $\cos(\omega t)$.
As an aside, note that this is also why the lag for an ideal capacitor goes the other way
$$V_C=\frac1C\int I\,\text dt$$
A: The sinusoidal voltage and current for an inductor vary as shown below.

Both variations are of the same frequency with the voltage leading the current by a phase of $\pi/2$ which is consistent with the relationship between voltage and current for an inductor, $v\propto \frac{di}{dt}$ both mathematically (as shown by others) and by inspection of the graphs.
A: To find the phase difference between two quantities, their equations must have same trigonometric ratio and same sign.
Say you want to find the phase difference between two following quantities
$x_{1}=a \sin⁡(\omega t)$ and $x_{2}=b \cos⁡(\omega t)$
Firstly, both equations have same signs. Now, use the quadrant formulas to have sine ratio in the second equation. Now, we can write,
$x_{1}=a \sin⁡(ωt)$ and $x_{2}=b \sin⁡(\omega t+\frac{\pi}{2})$
Now we can say that the phase of $x_{1}$ is $\omega t$ and that of $x_{2}$ is $\omega t+\frac{\pi}{2}$ .
So, the phase difference between $x_{1}$ and $x_{2}$ is $π/2$  and $x_2$ is leading ahead of $x_{1}$.
Let’s see another example.
$y_{1}=p \sin⁡(\omega t)$ and $y_2=-q \sin⁡(\omega t)$
Here both the equations must have same trigonometric ratios and same sign.
So, we’ll rewrite the equation of $y_{2}$ as, $y_{2}=q \sin⁡(\omega t + \pi)$
Now the phase of $y_{1}$ is $\omega t$ and that of $y_{2}$ is $\omega t + \pi$.
So, the phase difference between $y_1$ and $y_2$ is $\pi$  and $y_{2}$ is leading ahead of $y_{1}$.
