This is only possible with analog input i.e. AUX input.
You can use a subwoofer with our powered speakers, but the subwoofer must also be self-powered. You will need an RCA Y-splitter. From the audio source run one set of the RCA’s to the speakers, and the other set of RCA’s to the subwoofer. Note that speakers without a sub-out do not have a low-pass filter, so they will continue to play bass frequencies when connected to the subwoofer.