The equivalen reactance of an inductor and a capacitor
Basically the magnitude of the net impedance is the difference between the two impedances and you can ignore the sign if it becomes negative. Taking the square root of the difference of the squares is fundamentally wrong because capacitive and inductive reactances share the same axis: -



The above picture shows an inductor (reactance 300 ohms) in series with a resistor of 400 ohms. If you were trying to calculate the net impedance of R and XL then square rooting the sum of the squares is appropriate.

If the reactance (vertical axis) becomes negative then this is due to the dominant impedance being capacitive rather than inductive. An inductor in series with a capacitor produces an impedance somewhere on the vertical axis and, when the two impedances have identical magnitudes they cancel to zero. this is called series resonance. You might have heard of it.