This is we call the frequency domain analysis. It calculate similar to the resistor network but the capacitor and inductor are consider as a complex resistance or call it impedence. If you just talking about idea capactior or inductor, the phase angle will be 90degree different on sine wave. The main problem is in a network with some resistors, capacitors and inductors....
You need to know any waveform has the equvalence to a series of sine wave with different frequency and phase angle. If your waveform is not perfect, The calculation will has error. The easy understanding example is square wave. By matematics, a square wave contain a lot of component with different frequency. If you just consider it is a simple sine wave the calculation will not work.
Also, the capacitor and inductor in high frequency need to consider the resistant on it.
I suggest you read a basic circuit textbook. It is easy to calculate.
I hope it help.